Monday, February 15, 2010

» Clear Android Market Search History +

So, I wanted to clear the search history that displays in the Market app when you open the search bar. It seems that from a quick googling many people would like to do the same thing. I found a way that seems to work, but it requires root access.

I figured the Market app probably stores the search history in some type of standard database, rather than in a compressed or encrypted container, so I just grep'd /data for a unique history item (foobarbazbozbiz) that I searched for in the Market for specifically this purpose:

grep -r foobarbazbozbiz *
[...]data/com.android.vending/databases/suggestions.db:[...]foobarbazbozbizfoobarbazbozbiz[...]

It looks like /data/data/com.android.vending/databases/suggestions.db is where the history is stored. And yes, this is just an SQLite3 database. I tried removing the file, but the Market app still shows the same history. Hmmm. Maybe the Market app is still running in the background and holds an open handle to the database? (In Linux, the kernel Android runs on, when a reference to a file is held in memory, the file can be deleted from disk, but it is not actually removed until all the references to it are released--see here).

So I tried killing the Market app:

Menu -> Settings -> Applications -> Manage Applications -> Menu -> Filter -> All -> Market -> Force Stop

That worked. :)

I haven't found any other apps that use the database, but there may be some that do. So far, my phone hasn't exploded, but YMMV.

Ps. Maybe my first Android app will be a "Clear Market Search History" app (looks like the SearchRecentSuggestions class might be helpful; or I'll just do it quick and dirty with the File I/O APIs ;)).

Labels: , ,

1 Comments:

Anonymous Anonymous said...

Check Refine Efficiency: http://refineandroid.doodlekit.com/

Fast, Simple utility:
- market history cleaner;
- cache cleaner (root and non root(individually)), no sd card cache support;
- task killer;
- start up manager;
- strong scheduling features.
Also browser history cleaner.
November 4, 2010 at 7:53 PM

 

Post a Comment

<< Home