cache to sd card

Search This thread

saul972

Senior Member
May 9, 2007
107
2
Dallas
Has anyone tried this


http://modmygphone.com/forums/showthread.php?t=4851


Root the phone. How to do it is already here...

Now:
cd /data/data/com.android.browser/cache
rm -R webviewCache
mkdir /sdcard/webviewCache
ln -s /sdcard/webviewCache webviewCache

You are changing to the cache directory.
Deleting the web cache directory.
Making a new one on the sdcard.
Linking symbolically the new one to the old one.

Now open your browser and surf. Your phone does NOT know you did this and it thinks it still has the old one. If you plug your phone into your computer and check you will see a lot of files with 8 character names. (after having surfed of course)

To your phone it is as though the webviewCache is still in the same spot. In reality it is on your SD Card where you have plenty of room for it.

******Warning*****

After doing this to my phone a few hours I tried dowloading an app from the market and I was getting error messages. So I reset my phone thinking it would fix the problem but when i tried to get pass the google log in screen it said my account didn't have the data plan. I re-flashed using the RC28 update.zip file and got it back up. just my experience
 
Last edited:

cookzitall

Senior Member
Oct 16, 2007
223
5
can some one help..when i run the first line cd /data/data/com.android.browser/cache it said canr cd to thats location....wat is the problem???

i just noticed that the first line only works if u have cache saved already....i cleared mine n thats y it didnt read the whole line lol opps
 
Last edited:

neoobs

Retired Moderator
Mar 25, 2008
1,239
11
Has anyone tried this


http://modmygphone.com/forums/showthread.php?t=4851


Root the phone. How to do it is already here...

Now:
cd /data/data/com.android.browser/cache
rm -R webviewCache
mkdir /sdcard/webviewCache
ln -s /sdcard/webviewCache webviewCache

You are changing to the cache directory.
Deleting the web cache directory.
Making a new one on the sdcard.
Linking symbolically the new one to the old one.

Now open your browser and surf. Your phone does NOT know you did this and it thinks it still has the old one. If you plug your phone into your computer and check you will see a lot of files with 8 character names. (after having surfed of course)

To your phone it is as though the webviewCache is still in the same spot. In reality it is on your SD Card where you have plenty of room for it.

The last line could essentially save apps on the SD card as well can it not?

BTW apps are saved in several locations, the main apk is in /data/app/ while the data itself is saved in /data/data/ I wonder if you could just link to /data/ as sdcard/data/
 

haitiankid4lyf

Senior Member
May 25, 2008
268
0
quick question.. where does the cache go if u remove the sdcard and/or you mount it to a pc?
does it save on the device?
does it just not save?
or does it give you an error?
 

hbguy

Senior Member
Jul 17, 2007
173
0
Huntington Beach
undo changes??

Happy Thanksgiving everyone,

I was wondering if anyone could write out the code on how we could undo these changes. I'm sure its very similar to what stericson wrote for the market cache but I just wanted to make sure on the details. Thank you! :)

hbguy
 

budvar

Member
May 7, 2007
6
0
The undo for this would be:

Code:
cd /data/data/com.android.browser/cache
rm webviewCache
mkdir webviewCache
chmod 771 webviewCache
busybox chown app_18 app_18 webviewCache
rm -R /sdcard/webviewCache


To explain:
- change to the correct directory
- remove symbolic link to the sd card
- re-create original directory
- change the access permissions back to defaults
- change ownership back to defaults
- remove cache on the sd card

Few points on this.
I've not actually done this completely, just used my linux knowledge, and tested the chmod/chown steps procedure on my TC5-RC8, but not really sure if it's necessary (there for the sake of accuracy)
Had to use busybox chown as chown not natively found
I'm new to android and have made the assumption everyone's webviewCache is orginally owned by app_18? For all I know, this is randomly generated. I'm sure someone can confirm.

I wouldn't use this method and randomly remove the sdcard...that would be asking for data corruption on the sd card...
 

hanumantmk

New member
Nov 28, 2008
4
0
webcache owner

Don't think the app owner is always 18. Permissions on my webcache dir are for app_24
 

Studio1b

Senior Member
Nov 28, 2008
214
50
Web on da as would be sweet throw 8gb In and have no worries about on board space or lag time as the unit deletes cache I hope to see this added to the next firmware for users that plan on using a bigger sd card g1 is a great phone :)
 

budvar

Member
May 7, 2007
6
0
Open the browser, then get a terminal on your phone

type

Code:
ps a

(can just use 'ps' but 'ps a' brings back a shorter list)

under the name column look for 'com.android.browser'

on the far left you will see the owner (in my case app_18)

just swap your app_xx in my original example.
 

grickson

Member
Nov 13, 2008
40
0
There are other ways to move cache to your microSD..

http://androidcommunity.com/forums/f7/modified-rc30-the-real-benefits-8090/

EDIT:
I found a few things you can do after having JesusFreke's RC30 loaded. I did not come up with these hacks, i just found them and want to put them in one place, i will give credit to the people who posted them.

Move Browser Cache to SDCard: By grickson from XDA
cd /data/data/com.android.browser/cache
rm -R webviewCache
mkdir /sdcard/cache/webviewCache (if you have already made the cache folder in your microSD)
ln -s /sdcard/webviewCache webviewCache

Move Market Cache to SDCard: By grickson from XDA
cd /data/data/com.android.vending
rm -R cache
mkdir /sdcard/cache/
mkdir /sdcard/cache/marketCache
ln -s /sdcard/cache/marketCache cache

Move StreetView cache to microSD: By grickson
cd /data/data/com.google.android.street
rm -R cache
mkdir /sdcard/cache/streetCache
ln -s /sdcard/cache/streetCache cache
 

budvar

Member
May 7, 2007
6
0
...which is the same method as described in the 1st post...

But thanks for the other examples.

I feel a script coming on...
 

ldondysh

Member
Mar 23, 2006
8
0
umm...didnt work

so im still new to this android programming thing...

iso i followed the steps on the 1st page and everything worked as it should...i think...
Yet when i browse the market or the web i still use up the phones memory and not the sdcard. Anyone have any ideas as to what i did wrong?
 
Last edited:

caleb12

Member
Nov 10, 2008
31
0
Would this not also undo actions
Settings->applications->manage applications->browser: clear data

Sure does... I just spent the last 30 minutes figuring that out... It makes sense though, apparently a "Clear Data" from the Manage Applications location will remove everything in the /data/data/com.android.browser/ folder - everything except for lib. However, if you have a symlink in there... like this how-to suggests, that gets removed as well.

On the bright side... once you do this, you shouldnt have to worry about clearing the data cache again... none the less, something to keep in mind...

I found another location for a sym link as well, if you have a huge calendar (mine is 6MB+) create a symlink from

/data/data/com.android.providers.calendar/databases/calendar.db

I dropped mine on the sdcard, I have a folder called sys with all these caches in it. Now calendar storage reads 4kb...
 

caleb12

Member
Nov 10, 2008
31
0
Anyone find a way to move the gmail cache to the sdcard?

That one is located here:

/data/data/com.google.android.providers.gmail/databases/mailstore.{your_email_address}.com.db

Also, in case anyone has not figured this one out... You can move all your notifications and ringtones to your sdcard as well. They are located in:

/system/media/audio/

I forgot which app installs a media folder to your sdcard, I think it's ringdroid... either way, it's a symlink to the above location - you can either use that or create your own... All I did was adb pull the folders above, and then push them to my /sdcard/media/audio/.

I think with all the hacks in this post we've cleared up a good 15 to 20 megs from the internal memory. I know my market app was up to 11mb, browser was around 3, and my calendar 6... That's quite a bit of room...

I think we need to sticky this post, and update the first post with all the subsequent locations...
 

hbguy

Senior Member
Jul 17, 2007
173
0
Huntington Beach
hey guys,

there are a few threads that are similar to this and should be stickied and compiled together for better organization (mods :) please ) one is called cache to sd and another is called market to sd.

on to my question. i'm not sure if you all use the app steel as the browser but i was wondering how we would do a similar cache to sd as we do for the webviewCache for android browser?

hbguy