Kiosk mode in Android at runtime - android

Setting any application in Kiosk mode in run time and maintaining its state even after switching off the device in android.
We have created an application which display the list of all the installed application in the android. We select few of the application to run in kiosk mode. Now we want that even after restarting the device, application should be in kiosk mode.
But it is not happening in my case.
Kindly help us

I have Completed Kiosk mode in Android. I have two methods to handle this scenario
1.)Make your application as home launcher so it gets loaded whenever you restart the device.
2)If you dont want to make it as launcher, Then create a broadcast receiver with Boot_Completed receiver and start your application from it.

Related

Prevent my app to sleep when device goes to sleep mode

I have written an app that should be running continually event if device goes to sleep mode.I have tried many things like services (with startForground also) , alarm manager and persistant="true", but when device go to sleep (by user or by device) , my app is terminated.and even PowerManager does not work too.
There is an option in device setting that is 'Keep running after screen off' (in huawei device : setting > app > my app options > battery > Keep running after screen off). So when this option is active , the app is running for ever.I want implement something like this in my app programitically.
I saw some apps that implemented this , but I dont know how.
So how can I do that?
Use ForgroundService.
If you check your device applications with an app manager, you can see that some of them using a sevice that is always running. even if you stop them, some of them start working again.
see more about services behavior in android developer.
and search for "keeping a service alive".
On some devices (Huawei, Xiaomi, LG) there is a special setting that contains a list of apps that are allowed to run in the background. It sounds like you are talking about trying to accomplish the same thing. This cannot be done on those devices. On those devices, unless your app is added to the list of apps that are allowed to run in the background ("Protected Apps" on Huawei), the Android framework will not restart your app if it is shutdown. There is no way for you to programatically add your app to this list, and there is no way for you to work around this feature.
Certain apps need to keep the screen turned on, such as games or movie apps. The best way to do this is to use the FLAG_KEEP_SCREEN_ON in your activity (and only in an activity, never in a service or other app component).
getWindow().addFlags(WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON);

How to access camera or gallery in android Kiosk Mode app?

i am using kiosk mode in my android app. Here kiosk service should be called every two second and the app open for every two seconds. My app needs to access gallery or camera app. But my app does not let me access these things because every two seconds it comes to foreground if we try to go to other applications. Now my problem is i need to access camera and gallery in kiosk service which should be called for every two seconds.
Afaiu you are using background service which runs continuously in gap of 2 second.
Instead of using background service i would suggest you should use screen pinning option for android lollipop or more devices. To get more information regarding this you can read http://www.sureshjoshi.com/mobile/android-kiosk-mode-without-root/ .
Also ,you have to make your application a launcher application,so that everytime user presses the launcher icon your application starts.
To disable power on/off button you can use System Dialog Disable feature.
By using this you can get following benefits :-
1) Power consumptions/Memory usage is minimized.
2) According to your usage you can disable/enable the kiosk mode.
3) You can start the other application from your application by disabling the kiosk mode application.
Regards
Ajay

how to create android app that launch when device boot and block to go device home

I am trying to make an android app that will show only my app and other native app will work under my app's interface.. That means when the device starts my app will load by default and user not allowed to exit from my app by pressing any key or buttons in the device.
is there any way to do this, please help me to solve this problem.

How to prevent launching other application from my application

I want to write an application that can prevent some application from launching. My requirement is to block some application for some period. So what is the way to block or prevent others application from starting or launching through my application.
My question is -- Is it possible to prevent launching other application from my application? If yes then what is the way.
I tried killing the running application. But it only kills when the application is in the background. When the application is in opened state(displayed on the screen) the killing of the application is not working.
So what is the way to block or prevent others application from starting or launching through my application.
Write your own home screen, so you are the one doing the launching, and implement your launching rules there.
This will cover basic scenarios. It will not help with:
Stopping apps that are launched via notifications (e.g., in response to an incoming SMS)
Stopping apps that are launched via other things in the system bar on tablets (e.g., some tablets let you get to the Settings app from there)
Stopping the user from rebooting their device in safe mode and getting rid of your home screen
The only way to handle those scenarios is to create your own ROM mod with adjustments to the operating system, then distribute that ROM mod (e.g., on your own devices).

Does android keep a log of when it starts?

I'm making a parental control/accountability app for android. It consists of a monitoring service that runs in the background and starts when the phone is booted.
Unfortunately, I have found that when android is started in "Safe Mode", services are not started automatically, and because of this my app has a serious flaw.
While in safe mode, the web and other apps can be started without my monitoring service running.
I thought that if it isn't possible to monitor app activity while in safe mode, maybe I could at least have my app detect if the phone was previously in safe mode. Then it could maybe alert the parent or accountability partner?
Does Android keep any log of this? Or any boot log in general?

Categories

Resources