0

I am unable to find a way to access the Running Services screen which we normally access using:

Menu -> Setting -> Applications -> Running Services

As per some programmers its impossible and even i did not get anything after searching for few days on internet but few apps like Advance task killer and Advance task manager easily accessing this screen by one click from their apps.

Cœur
  • 37,241
  • 25
  • 195
  • 267
Varundroid
  • 9,135
  • 14
  • 63
  • 93
  • possible duplicate of [How to check all the running services in android?](http://stackoverflow.com/questions/5523718/how-to-check-all-the-running-services-in-android) – CommonsWare Apr 07 '11 at 11:07

3 Answers3

2

There is no intent for that in android settings code. Check the code below.

<activity android:name="RunningServices"
              android:label="@string/runningservices_settings_title"
              android:clearTaskOnLaunch="true">
        <intent-filter>
            <action android:name="android.intent.action.MAIN" />
            <category android:name="android.intent.category.DEFAULT" />
            <category android:name="android.intent.category.MONKEY" />
            <category android:name="android.intent.category.VOICE_LAUNCH" />
            <category android:name="com.android.settings.SHORTCUT" />
        </intent-filter>
    </activity>

As commonsware said in other thread, the closet is manage application intent. Are you sure the third party apps does it. If so what is the name of the app ? I think they get the running services via package manager and then create a UI similar to that.

Stephane Rolland
  • 38,876
  • 35
  • 121
  • 169
Vinoth
  • 5,687
  • 11
  • 44
  • 56
  • @Vinoth tahts what i was thinking may be they get all the running services and then created a UI similar to OS's default UI. btw name of those apps are Advance Task Manager and Advance Task Killer. – Varundroid Apr 07 '11 at 12:16
  • @Vinoth i got all the service using getRunningServices() and created the nearly same layout as Running Services screen but can you tell me how android really stop the service because i tried stopping a service using stopService() but it seems it doesn't working. Can you please help me on this part???? – Varundroid Apr 08 '11 at 13:05
  • 1
    I worked on modifying the setting application so i know a bit about this code. Android uses forceStopPacakge API to stop service or activity. You need to pass the package name to this API. However there is one catch. Your app needs to be signed like platform app to get access to this API. – Vinoth Apr 08 '11 at 16:53
  • You can find the code here -http://grepcode.com/file/repository.grepcode.com/java/ext/com.google.android/android-apps/2.2.1_r1/com/android/settings/InstalledAppDetails.java/ – Vinoth Apr 08 '11 at 16:53
  • and is there any way which i can use to sign my app just like platform app???? :( – Varundroid Apr 08 '11 at 17:59
  • Unless you have platform keys and certificate you cannot do it. Are you developing this as a third party app or system app ? – Vinoth Apr 09 '11 at 04:51
  • Its a Third party app which is full featured System Manager. Can i still sign it as platform one? and where to get this platform key and certificate? And i am thinking to explore NDK as google said if you think android framework is not capable of doing what you want it to then you can try NDK. what is your opinion about NDK? – Varundroid Apr 09 '11 at 06:34
  • 1
    AOSP platform key and certificate are on build/target folder. But again different manufactures will have different keys. Did you try to use restartPackage() in Activity Manager. Although this API is depreciated it will work. This will basically do the force stop. Try this API once before going to NDK. You need to add "android.permission.RESTART_PACKAGES" to your manifest file. – Vinoth Apr 09 '11 at 10:23
  • yeah i tried restartPackage() and its working fine but the problem is when its execute then an activity will be killed and services will be restarted and as soon as services restart it will restart the activity. I need to stop the service so when i kill the activity it wont get restart. and take a look at the code below. – Varundroid Apr 09 '11 at 11:48
  • public void stopTheService() { Intent in = new Intent(); n.setAction("com.bla.bla"); stopService(n); } tell me if i did any mistake in this code. – Varundroid Apr 09 '11 at 11:48
  • and i really appreciate the way you are helping me. seriously thanks man. – Varundroid Apr 09 '11 at 11:54
  • If you want the activity not be started again then you must use forceClosePackage().I am not sure if there is any other way to do it. I looked at the free task manager code and they seem to do the same thing. http://code.google.com/p/freetaskmanager/source/browse/trunk/src/org/freecoder/taskmanager/MiscUtil.java – Vinoth Apr 09 '11 at 12:48
0

Maybe this is what you search for?

http://developer.android.com/reference/android/app/ActivityManager.html#getRunningServices%28int%29

dbrettschneider
  • 3,173
  • 1
  • 29
  • 28
-1

Here is solution for this question

Click Here

Varundroid
  • 9,135
  • 14
  • 63
  • 93