0

I have samsung galaxy s2 and I want to create a small app to clear the memory automatically without going to task manager and pressing the "clear memory" button.

I know there are some free apps in the marketplace but I want to create my own. Anyone can point me to any tutorial or just give me a little background on how to start?

I'm fairly new to android programming but I want to learn. I have already search the internet but can't find one.

Thank you

jaypabs
  • 1,519
  • 10
  • 43
  • 62

1 Answers1

4

Firstly, your google searches might yield a few more results if you specify what you mean by memory. It is an ambiguous term because it can refer to harddrive space, or ram, or rom or something else. I am going to assume you mean system memory

Secondly, you should work out what that button actually does. Something like this might shed some light: http://android.nextapp.com/site/systempanel/doc/taskmanagement

Thirdly, because the memory used by the OS and other applications cannot be controlled directly from your application, any memory clearing call will have to be a system call to the OS. So there should be some kind of API you can use to interact with the system and ask it to control other apps.

Android-Close Other Apps This link shows how to close other apps (maybe a good starting point)

This class interacts with other activities on the system: http://developer.android.com/reference/android/app/ActivityManager.html

Either way it is a tricky thing to do as your first app. Goodluck!

Community
  • 1
  • 1
ddoor
  • 5,819
  • 9
  • 34
  • 41