Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Develop app run in kiosk mode in android

How to make our app which is act like kiosk mode app( SureLock lockdown app). I have LG E400 rooted android phone Android 2.3.6. I want to develop app like Surelock what shold i need to develop such app.

Can anyone help me to develop such app on my own.

My requirements: Android device boots with my app. For this app all hardware buttons are disabled(Home, Back, Menu) similar to SureLock app.

like image 414
PrasadM Avatar asked Jan 09 '13 10:01

PrasadM


2 Answers

Ok ... after hours of struggling with this my self and finding nothing on net worth while....(does not require rooting of phone)

Home button ::::

<category android:name="android.intent.category.HOME" />

to handle home bottom...

Back button ::::

@Override
public void onBackPressed() {
    // We doing this too stop user from exiting app, normally.
    // super.onBackPressed();
}

For long press home button( recent app activity or google now) or recent app button ...

@Override
protected void onPause() {
    super.onPause();

    ActivityManager activityManager = (ActivityManager) getApplicationContext()
            .getSystemService(Context.ACTIVITY_SERVICE);

    activityManager.moveTaskToFront(getTaskId(), 0);
}

will need permission ...

<uses-permission android:name="android.permission.REORDER_TASKS" />
like image 187
Clifford Avatar answered Oct 20 '22 12:10

Clifford


If your app acts like a home screen and you have no other home screen installed (or checked your app as default) it will start on boot and you won't be able to exit it. Unless you kill the task somehow, but that's not preventable.

Your app has to use the

android.intent.category.HOME

intent to be the first visible app on boot.

If you want some source you can look at Anderweb's ADW Launcher https://github.com/AnderWeb/android_packages_apps_Launcher

like image 31
Dominic Avatar answered Oct 20 '22 12:10

Dominic