Introducing XDA:DevCon – A Conference For Developers By Developers
XDA Developers Android and Mobile Development Forum
Forgot your password?
 
Post Reply+
Tip us?
 
Stericson
Old
(Last edited by Stericson; 4th January 2009 at 08:08 PM.)
#1  
Stericson's Avatar
Retired Senior Mod / Elite Recognized Developer - Godfather of Android Theming - OP
Thanks Meter 347
Posts: 1,187
Join Date: Nov 2008
Default Solved! - Market eating up space

Note - A user has complained that this hack has the possibility of crashing your market program if implementing. Although it has not happened to anyone that I am aware of, it is still something to consider when doing this! The user cites that when running DDMS from the android sdk a long list of errors is generated refering to this hack, I ran the same tool and didnt see any errors. This doesn't mean however that it isn't true, so, you should take this into consideration before you attempt this. Remember, you are responsible for your own device and what you do to it is your own doing and noone else's. Personally, I am still using this mod with no problems. Your results may vary!

So, as many of you are aware the market app continues to grow and eat up space..well, since having root it has been one of my priorities to figure out how to reduce the apps size and/or force the phone to save whatever data is causing the app to grow on the sdcard. Well, I have officially gotten it all figured out....

In order for you to do this you will need root access, look around on the forums to find out how to gain root access, also if you updated to the official rc30 then you are out of luck, sorry.

I am not responsible if you brick your phone by doing this! This shouldn't brick your phone, but if you do something stupid or wrong and it does brick your phone...then it is all your fault and noone elses! Be forewarned.

First off, if you would like to simply clear the cache that is causing the market app to grow then you need to obtain root on your phone. There are several different methods depending on how your phone is currently set up. For myself, I just have to open terminal emulator and type my secret word, for other you may need to type su, note that this applies to those using the modified rc30 update.

Next, simply type:

rm -r /data/data/com.android.vending/cache/*

That's it! go check the market application and you should be pleasantly surprised to find that it is now down into the kb range and not the mb range, mine was 11mb when I did this.

You will have to clear this cache every now and again as it builds up again unless, you do the following:

Obtain root and type the following commands:
Capitalization is important!
mount -o remount,rw /dev/block/mtdblock3 /
mkdir /sdcard/marketcache
mkdir /sdcard/marketcache/cache
mkdir /sdcard/marketcache/cache/webviewCache
cd /data/data/com.android.vending
rm -R cache
ln -s /sdcard/marketcache/cache cache
cd cache
ls

At this point make sure that you see webviewCache after you type ls

if you do, great, then you are all done and the market cache should now be stored onto you storage card.

if you don't then type the following:

mkdir /sdcard/marketcache/cache/webviewCache
ls

Now you should see the folder webviewCache and you should be done!

You can see this working by going to settings --> sd card & phone storage.
Make a mental note of your sdcards free space and your phone's free space.
now press the home key
open the android market
Browse a bunch of applications, the more the better.
now hold your home key down and go back to settings.
Look at your phone's free space and your sdcards free space.
The phone's free space should be the same and the sdcard's free space should be lower.
now press the home key
now obtain root on your phone once more.
type the following:

rm /sdcard/marketcache/cache/*

hold the home key down and go back to settings.
did your sdcard's free space go back up?

You can also use a file manager to look at the cache files on your sdcard now.

Btw, if you want to undo the changes simply follow this:

Obtain root
rm -r /sdcard/marketcache/cache/webviewCache
rm -r /sdcard/marketcache/cache
rm -r /sdcard/marketcache
mount -o remount,rw /dev/block/mtdblock3 /
rm -r /data/data/com.android.vending/cache/webviewCache
rm -r /data/data/com.android.vending/cache
mkdir /data/data/com.android.vending/cache
mkdir /data/data/com.android.vending/cache/webviewCache

That should do it.

If anyone has any questions let me know!

Stericson
 
cookzitall
Old
#2  
Senior Member
Thanks Meter 4
Posts: 211
Join Date: Oct 2007
Default great job bro

now how bout saving .apk files to sd card lol if possible ofcourse
 
Stericson
Old
#3  
Stericson's Avatar
Retired Senior Mod / Elite Recognized Developer - Godfather of Android Theming - OP
Thanks Meter 347
Posts: 1,187
Join Date: Nov 2008
Yep, I'm workin on that next....
 
cookzitall
Old
#4  
Senior Member
Thanks Meter 4
Posts: 211
Join Date: Oct 2007
yo i justed pmed you..if u can help me out it would be great
 
humble
Old
#5  
humble's Avatar
Senior Member
Thanks Meter 5
Posts: 199
Join Date: Dec 2007
Great job! I think this deserves to be stickyed(my thought's out loud).
One question, have you played with the browser cache?
Device:Nokia N900

Device:Nook Color
ROM:CM Nightly's
KERNEL: Dalingrin's OC kernel [6/18/11]
 
Stericson
Old
#6  
Stericson's Avatar
Retired Senior Mod / Elite Recognized Developer - Godfather of Android Theming - OP
Thanks Meter 347
Posts: 1,187
Join Date: Nov 2008
Thanks, the browser cache has already been done....Check this thread out:

http://forum.xda-developers.com/showthread.php?t=443336
 
humble
Old
#7  
humble's Avatar
Senior Member
Thanks Meter 5
Posts: 199
Join Date: Dec 2007
Ok. Thanks for the link!
Device:Nokia N900

Device:Nook Color
ROM:CM Nightly's
KERNEL: Dalingrin's OC kernel [6/18/11]
 
neoobs
Old
#8  
Retired Moderator
Thanks Meter 9
Posts: 1,268
Join Date: Mar 2008
I keep getting a fail for mkdir saying it is a read only file system.

I guess I can't write to my sdcard from adb... anyone know a fix?
 
humble
Old
#9  
humble's Avatar
Senior Member
Thanks Meter 5
Posts: 199
Join Date: Dec 2007
have you tryed to type su first(before "mount -o remount,rw /dev/block/mtdblock3 /")
Device:Nokia N900

Device:Nook Color
ROM:CM Nightly's
KERNEL: Dalingrin's OC kernel [6/18/11]
 
neoobs
Old
(Last edited by neoobs; 11th November 2008 at 02:56 AM.)
#10  
Retired Moderator
Thanks Meter 9
Posts: 1,268
Join Date: Mar 2008
yea tried that... stll doesnt work

I did it HAHA apparently you gotta mount it first.

 
Post Reply+
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Go to top of page...

XDA PORTAL POSTS

Auto Test Your Android Apps with Robotium

You’ve just finished coding your very first app, but before you release it to the wild, you … more

Open Source CPU Info App for Windows

So you’re playing with your shiny new Windows 8 tablet PC, when one of your like-minded geeky … more

Guide to Using Adobe Air on Android

When writing an app with performance in mind, you most likely want to write it native code using the … more