Running a Flutter app on the foreground 24/7 - android

I Have a flutter app that is supposed to be a display app for some contents besides ads for some restaurants...The app is supposed to work 24/7 and will be on andriod tablets only.
I have searched a lot and the latest thing I found was to set the app to be a system app using the following tags
<category android:name="android.intent.category.DEFAULT"/>
<category android:name="android.intent.category.HOME"/>
and the premission
<uses-permission android:name="android.permission.WAKE_LOCK" />
and I am using the "screen" plugin as well to keep the screen always on.
The problem now is the screen is always on and the app running without any problems for 24 and some times for 48 hours then the lock screen shows up and after unlocking the screen the app is on the foreground playing without any problems.
Is there any way to keep the app displaying always on the foreground?
or a way to disable the lock screen from appearing if it causing the issue?

You can use Screen Pinning which requires no code.
Or you can implement Lock task mode.

Related

How do we set up kiosk mode in samsung tablet?

I have samsung tablet tab 8, with android 9 installed.
I have trouble to make this tablet as kiosk app, I want to use it for opening my web page,
so everytime the tablet starts it directly open my web page only ( with wifi settings enabled )
I searched around and found Samsung KNOX, but I think it is a paid service, and I have trouble where to download it.
Is there another solution availible?
You can set it as home app.
add this line inside intent-filter tag of your main activity in the manifest.
<category android:name="android.intent.category.HOME" />
Once is launched OS will ask you to set it as home forever or just once.

AndroidTV Missing DPad functionality

My app is fully usable and navigatable on AndroidTV using the DPad. Well, it certainly is on MY AndroidTV, as well as AVD.
However, Google keeps on rejecting my appeal to have it marked as AndroidTV capable.
There is no feedback, other than
Missing DPad functionality Your app requires user interaction for
menus or app navigation. Please make sure that all menus and app
navigation are fully functional using a DPad. Please refer to our DPAD
Control and Hardware Declaration documentation.
Do you know if they actually test these apps, or do they just look for certain code patterns? The message from them looks automated, and I've not spoken to a person yet.
Would it help if I recorded my app in use and sent them a link to the demonstration?
In my case there were 3 problems.
I had a "Refresh" button that when pressed it was downloading a new image and replaced the current, to the automatic google testing machines - it looks like nothing happens, it was the same image. the fact that I used different drawable to show pressed/released/focused state had nothing to do with it. For those testing machines, if nothing happens then this button has no functionality and the DPAD probably is not working. I have added a simple Toast message that launches every time a user presses the button.
I have contacted support from the link in the rejection email - they are very supportive. they have sent me explanation that includes an old screenshot. apparently - they were using an old version - I don't know why. After explanation - they checked the correct one.
also, they test mostly the production version while most of my development was on the beta version. advance your version to production. in my case partial release of 5 percent was good enough for them to test the new production version.
after all of those measures - 12 hours later - I was approved. Now, I have removed the toast and my app was still accepted.
AndroidTV applications support and expects leanback activities. Also, D-pad needs to minimum remote controller support like up, down, left, right, select, Back, and Home buttons.
D-pad minimum controls
The default controller for a TV device is a D-pad. In general, your app should be operable from a remote controller that only has up, down, left, right, select, Back, and Home buttons. If your app is a game that typically requires a game controller with additional controls, your app should attempt to allow gameplay with these D-pad controls. In this case, your app should also warn the user that a controller is required and allow them to exit your game gracefully using the D-pad controller. For more information about handling navigation with D-pad controller for TV devices, see Create TV navigation.
Adding the below lines to your main activity in AndroidManifest.xml may help Dpad support.
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.DEFAULT" />
<category android:name="android.intent.category.LAUNCHER" />
<category android:name="android.intent.category.LEANBACK_LAUNCHER" />
</intent-filter>
If its not working and these lines already in manifest please share your manifest file.

Use an application as only app on an android device

I'm going to write an application for a special device. The device's OS is android and it connects to a TV with HDMI cable and has a remote control as input hardware.(Like a video player) I need these to be done:
When the user works with it, it should not be clear that the OS is android.
User could not access to the OS system options like "Action bar" or "Setting menu" or etc.
My app be the default app of the system and it runs at start up before any other app even the launcher.
so,
How can I change the android boot logo ?
How can I set my app to be the default application? May I need to set it as launcher?
how can I disable all other android UI tools like launcher and action bar permanently? (even my application close they should not be shown)
May I need a rooted android ? and witch version has these possibilities ?
I've found my answers and share it to others.
How can I change the android boot logo ?
In some devices there is a file in system/media/bootanimation.zip
can be edited and replaced.(When creating zip file should choose
Store in compresstion type.)
In some devices there is a file in system/etc/bootvideo thats in
MP4 file format simply can be replaced.
How can I set my app to be the default application? May I need to set
it as launcher?
Yes, simply add android.intent.category.LAUNCHER to first activity category in the manifest like this:
<activity android:screenOrientation="landscape" android:name=".ActivityStarter">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
How can I disable all other android UI tools like launcher and action bar permanently? (even my application close they should not be shown)
Uninstall all other launcher on the device. also for notification bar you can remove Android UI in system apps. Note that be sure your app is running correctly and does not crash, if not you will lose access to the device.(I installed ES Explore on the device and run it with a hidden button in my app to access my android system tools.)
May I need a rooted android ? and witch version has these possibilities ?
Yes. In this case I used Android 4.4.2 but think other versions would be so.
Android 5.0 supports pinning an app. There's also an app called AppLock that may be relevant.

Blocking a pull-down menu in Android

We have an industrial app running on stock Samsung Android devices. Because it's an industrial app we are trying to have it "take over" the device. We've got this pretty well working by setting in the manifest
<category android:name="android.intent.category.HOME" />
<category android:name="android.intent.category.DEFAULT" />
and by intercepting the Android "back" key via onBackPressed and doing nothing.
Our one remaining conundrum is that Samsung's UI layer, 'Touch Wiz', has a pull-down menu that the user can pull down over the top of our app and access other features from. We're trying to disable that.
Is there anything we can intercept that the way we did the the back button to block that? Any other way to block it?
(if someone suggests "rooting" the device, what could I do as root that would help here?)
Thanks in advance!!
Which stock samsung device are you working with?
and by pull down menu are you speaking of the Notification Bar?
If so this is not a UI feature that is specific to TouchWiz, they may have modified what all can be accessed from the expanded notification bar. But this element exists in stock android as well.
If this is what you are referring to you can set a full_screen flag on your activity or application elements in your manifest. This will hide the notification bar while inside your application.
android:theme="#android:style/Theme.NoTitleBar.Fullscreen"
If it does not work with fullscreen mode home app:
A stock Android has no way to do real kiosk mode and I guess it's not a goal of Android to allow this since you could do evil things with that like build apps that force you to pay money before you can leave them again.
Root will not help here too since that's about the underlying Linux which allows you to access internal files etc. That does not unlock some magically hidden APIs.
What you would need to do is build your own firmware for the device (there might exist something for the device - look in http://forum.xda-developers.com/). In that firmware you are free to change those internals that allow users to escape your app.

How to make unlock screen app for Android

I am trying to develop unlock screen app for Android. I have downloaded some unlock screen app and tested. I finally found one app. That is Fingerprint Screensaver . It is what I exactly want. I mean I wish to replace the pattern unlock screen app. I am wandering how to replace the Android pattern unlock screen app.
I have googled a lot, but I could not find how to do it. Somebody wrote it is a hack. Even the Android does not support, I strongly wish to know how to do that.
If someone knows about it, please give me a clue. Thanks in advance a lot.
Thanks.
You can create a custom unlock screen by adding the following intent filter to the AndroidManifest.xml file for your Activity:
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.HOME" />
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
This is a hack because a dialog box will pop up asking the user which one he wants to use (yours or the default). Worse, if the user accidentally selects your lock screen as the default home screen in the chooser, they could seriously mess up their device. They might end up having to do a factory reset.
The only safe way to create a custom lockscreen is to modify the Android platform itself. This is how OEM skins like HTC Sense or Motoblur create custom lock screens.

Categories

Resources