0

I am working on a app locker app. The app is complete for initial use with very basic features. I have tried it in AVD[Android 4.3] and it works perfectly. Also my backup device with Generic Android 4.0.4 is good to go with the app. But to my bad luck, my app won't run on my Samsung galaxy S Duos with Android 4.0.4 and also in Samsung Galaxy tab 3 T311.

EDIT : My question is how to get Running Tasks Info in Samsung devices so that My app Can Check if A locked App has been started or not and if yes then the lock-screen comes up asking for password.

Also tell the procedure if other Brands like HTC and LG also require any such extra permission or method.

Here's my Manifest:

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

<uses-sdk 
    android:minSdkVersion="7"
    android:targetSdkVersion="18" />

<uses-permission 
    android:name="android.permission.GET_TASKS">
</uses-permission>
<uses-permission 
    android:name="android.permission.READ_LOGS">
</uses-permission>
<uses-permission 
    android:name="android.permission.RECEIVE_BOOT_COMPLETED" />
<uses-permission android:name="android.permission.READ_PHONE_STATE" />

<application 
    android:icon="@drawable/launcher_icon" 
    android:label="@string/app_name" 
    android:name="ic.lunar.applocker.AppLockerApplication"
    android:allowBackup="true" >

    <activity android:name="ic.lunar.applocker.AppLockerActivity"
              android:label="@string/app_name"
              android:launchMode="singleInstance"
              android:screenOrientation="portrait">
        <intent-filter>
            <action android:name="android.intent.action.MAIN" />
            <category android:name="android.intent.category.LAUNCHER" />
        </intent-filter>
    </activity>
    <activity 
        android:name="ic.lunar.applocker.AppLockerPreferenceActivity" 
        android:label="@string/appLockerPreferenceActivityName" 
        android:screenOrientation="portrait">
    </activity>
    <activity 
        android:name="ic.lunar.applocker.ApplicationListActivity" 
        android:label="@string/appLockerPreferenceActivityName">
    </activity>
    <service 
        android:name="ic.lunar.applocker.DetectorService">

    </service>
    <activity 
        android:name="ic.lunar.applocker.LockScreenActivity" 
        android:noHistory="true" 
        android:launchMode="singleInstance" 
        android:excludeFromRecents="true" 
        android:screenOrientation="portrait"/>

    <receiver 
        android:name="ic.lunar.applocker.StartupServiceReceiver">
        <intent-filter>
            <action android:name="android.intent.action.BOOT_COMPLETED"/>
            <action android:name="android.intent.action.MY_PACKAGE_REPLACED"/>
            <action android:name="android.intent.action.USER_PRESENT"/>
        </intent-filter>
    </receiver>
</application>
</manifest>
Lunar Inc.
  • 13
  • 1
  • 7

1 Answers1

2

The API that you might be using is not recommended. You have to live with this imperfection as the API has not been designed to work. Quoting from the API docs: "Note: this method is only intended for debugging and presenting task management user interfaces. This should never be used for core logic in an application, such as deciding between different behaviors based on the information found here. Such uses are not supported, and will likely break in the future. For example, if multiple applications can be actively running at the same time, assumptions made about the meaning of the data here for purposes of control flow will be incorrect."

More Information

Besides, I have been using the same API and I have seen it not work all the times.

Nitin Sethi
  • 1,416
  • 1
  • 11
  • 19
  • Thanxxx for your answer. But there should be a working solution. and how come this works in generic Android Devices or AOSP as you may call it but not on Samsung's Touchwiz UX ui? – Lunar Inc. Nov 17 '13 at 03:30
  • Well.. I can't say definitively, but it's Samsung which does all sorts of tweaking in AOSP in the name of 'enhancement' ! – Nitin Sethi Nov 17 '13 at 03:34