1

We, my company, are facing a problem. We have a phone in public use where we can't be always near the phone. It's a show room where public user can test our Android app. The problem is :

1) Can we block the phone in our app ? we just pin it but it doesn't block the phone. We found some apps the make something like that but not good results

2) A test user just add a security password to lock the phone. So now, we can't unlock the phone. We need to forbid user to add a lock password but we don't want to add one because if the phone is sleeping, a user should be able to unlock it. **Edit : ** We can't block user from accessing settings

So, is there a solution for that ? like a "ShowRoom" mod ?

If you need more precisions, please ask.

Thanks

Cocorico
  • 1,998
  • 1
  • 22
  • 38

1 Answers1

0

First you need to add the following attribute to your activity:

        android:launchMode="singleTask"

Then add two categories to the intent filter :

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

The result could look something like this:

<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
    package="com.dummy.app"
    android:versionCode="1"
    android:versionName="1.0" >

    <uses-sdk
        android:minSdkVersion="11"
        android:targetSdkVersion="19" />

    <application
        android:allowBackup="true"
        android:icon="@drawable/ic_launcher"
        android:label="@string/app_name"
        android:theme="@style/AppTheme" >
        <activity
            android:name="com.dummy.app.MainActivity"
            android:launchMode="singleTask"
            android:label="@string/app_name" >
            <intent-filter>
                <action android:name="android.intent.action.MAIN" />
                <category android:name="android.intent.category.LAUNCHER" />
                <category android:name="android.intent.category.DEFAULT" />
                <category android:name="android.intent.category.HOME" />
            </intent-filter>
        </activity>
    </application>

</manifest>

please read this answer to block exiting app

https://stackoverflow.com/a/16333555/5223973

if you want to use any third party app to lock your app you can use any android parental control apps

Community
  • 1
  • 1
Askarc Ali
  • 318
  • 4
  • 21