cache to sd card - G1 Android Development

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

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

saul972 said:
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.
Click to expand...
Click to collapse
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/

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?

it just doesn't save, I tried it

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

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...

thanks budvar!
can someone confirm please?
hbguy

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

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

so what lines do i change from budvars explanation? also how would I find with app_xx i am suppose to use if his explanation?
hbguy

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.

Would this not also undo actions
Settings->applications->manage applications->browser: clear data

There are other ways to move cache to your microSD..
http://androidcommunity.com/forums/f7/modified-rc30-the-real-benefits-8090/
damnitpud said:
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
Click to expand...
Click to collapse

...which is the same method as described in the 1st post...
But thanks for the other examples.
I feel a script coming on...

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?

haitiankid4lyf said:
Would this not also undo actions
Settings->applications->manage applications->browser: clear data
Click to expand...
Click to collapse
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...

Anyone find a way to move the gmail cache to the sdcard?

s0niqu3 said:
Anyone find a way to move the gmail cache to the sdcard?
Click to expand...
Click to collapse
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...

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

Related

Deleting system sounds

Was just wondering if anyone has deleted ringtones, notification or alarms successfully? `ould love to get rid of them if possible. Tried making a copy of jf rc30, deleting them and amazon apk then installing but didn't work gave me error message.
i removed unused ringtones w/o any issues
If you have JF's RC30 1.31 installed you should be able to just delete them. Astro should let you goto where they are saved and just delete em. You may need to use DroidSans Tweak tools to remount /system as read/write first.
Hmmm, changing to read/write and trying to use Astro gave me "error deleting file"
Any other ideas?
Dharkaron said:
If you have JF's RC30 1.31 installed you should be able to just delete them. Astro should let you goto where they are saved and just delete em. You may need to use DroidSans Tweak tools to remount /system as read/write first.
Click to expand...
Click to collapse
No neither of those work but thanks for the effort to help. I tried those when i first got root. Im gonna try deleting the same way as i did amazon and see if it works.
stats555 said:
No neither of those work but thanks for the effort to help. I tried those when i first got root. Im gonna try deleting the same way as i did amazon and see if it works.
Click to expand...
Click to collapse
Word let me know if this works. I asked in another thread how to do it but no one answered. All I got was the "yes you can delete them" response
I deleted all of my ringtones without any issues. Just use adb shell and remove them. You can also "pull" them first if want to have a backup. In adb shell type "cd /system/media/audio/ringtones". Now you are in the ringtones folder, now type "ls" and then a list of all the ringtones will display. Once you know the name of the one you want to delete just type "rm filename.ogg" and thats it.
BlueBoar said:
I deleted all of my ringtones without any issues. Just use adb shell and remove them. You can also "pull" them first if want to have a backup. In adb shell type "cd /system/media/audio/ringtones". Now you are in the ringtones folder, now type "ls" and then a list of all the ringtones will display. Once you know the name of the one you want to delete just type "rm filename.ogg" and thats it.
Click to expand...
Click to collapse
Worked great thanks!
No problem, that was one of the first things I did was to change all of the ringtones. Couldn't stand the ones that came with it.
BlueBoar said:
No problem, that was one of the first things I did was to change all of the ringtones. Couldn't stand the ones that came with it.
Click to expand...
Click to collapse
Yeah i hear you on that, just a bunch of crap taking up space. I use mp3's for ringtones so no need to waste system space on them! I just learned how to use adb thank god!
Update - deleted most of the ringtones and 4 notifications, freed up 2mb's
BlueBoar said:
I deleted all of my ringtones without any issues. Just use adb shell and remove them. You can also "pull" them first if want to have a backup. In adb shell type "cd /system/media/audio/ringtones". Now you are in the ringtones folder, now type "ls" and then a list of all the ringtones will display. Once you know the name of the one you want to delete just type "rm filename.ogg" and thats it.
Click to expand...
Click to collapse
Sweet worked like a charm! Thanks a bunch
Ok I read how to delete the ringtones but what is ADB Shell? Lke where do i go to type in all those commands?
My phone is rooted JF1.41 with the latest RC33 modded update.
Cargo75 said:
Ok I read how to delete the ringtones but what is ADB Shell? Lke where do i go to type in all those commands?
My phone is rooted JF1.41 with the latest RC33 modded update.
Click to expand...
Click to collapse
You can do it all right from the phone with Terminal.
Type
Code:
su
mount -o rw,remount -t yaffs2 /dev/block/mtdblock03 /system
cd /system/media/sounds/(whichever directory you want)
ls
rm (whichever .ogg file you want)
The .ogg files are case sensitive, so beatplunker.ogg isn't the same as BeatPlunker.ogg
Also the .ogg extension has to be at the end of each file you rm.
If you want to save a backup on your sd card I just typed this before I started removing things. Good luck
Code:
cp /system/media/sounds /sdcard
Beast84 said:
You can do it all right from the phone with Terminal.
Type
Code:
su
mount -o rw,remount -t yaffs2 /dev/block/mtdblock03 /system
cd /system/media/sounds/(whichever directory you want)
ls
rm (whichever .ogg file you want)
The .ogg files are case sensitive, so beatplunker.ogg isn't the same as BeatPlunker.ogg
Also the .ogg extension has to be at the end of each file you rm.
If you want to save a backup on your sd card I just typed this before I started removing things. Good luck
Code:
cp /system/media/sounds /sdcard
Click to expand...
Click to collapse
wow, thank you!
Cargo75 said:
wow, thank you!
Click to expand...
Click to collapse
No problem. Just figured I'd pass some of the knowledge these fine peeps here have passed on to me
Cargo75 said:
Ok I read how to delete the ringtones but what is ADB Shell? Lke where do i go to type in all those commands?
My phone is rooted JF1.41 with the latest RC33 modded update.
Click to expand...
Click to collapse
In the future, you may what to do this through your PC to prevent carpel tunnel... You can download the Android SDK from here: http://developer.android.com/sdk/1.1_r1/index.html
Extract it to your drive. Navigate to that folder in a command prompt window then "tools". Once there you can run(make sure the G1 is plugged in the usb):
adb remount (remounts the system read/write)
adb shell (this drops you into the shell to interact with your phone)
cd /system/media/audio/
From there you should be able to follow the proceeding directions.
I went and did all this and even went the extra mile and pushed some of my custom mp3's to the file (about 3 meg worth). Is this going to cause problems with updating in the future?
You don't need to remount the system to read/write manually if it already has been done with DroidSans do you?
I usuall y do the mount through Terminal emulator.
mount -o rw,remount -t yaffs2 /dev/block/mtdblock3 /system
rm -r /system/media/audio/ringtones
rm -r /system/media/audio/notifications
bam gone!
I tried to copy and after mounting I typed:
cd /system/media/audio/
ls
then got:
alarms
ringtons
notifications
ui
then I typed: cp /system/media/audio /sdcard
and got this message:
cp: omitting directory '/system/media/audio'
is it something small and dumb that I'm doing or are the files copied?

Any Shortcut to clear browser cache with Anycut/Gscript

Anything on this?
Did you try anything?
Using Gscript it is very simple, create a new script, in the box enter:
rm /data/com.android.browser/cache/webviewCache/*
voila
you can also add:
rm /data/com.android.browser/app_thumbnails/*
to clear up some other temp files
and
rm /data/com.android.browser/databases/webviewCache.db
to remove the history and such. My script has those lines and one to clear the market cache.
Wont work says directory doesnt exist.
rm /data/data/com.android.browser/cache/webviewCache/*
on all the above posted codes it's /data/data it's not that hard look for the gscript thread if you really wanna find this script, someone posted it a while ago

new scripts

Please emal me at if you have a problem.
Thank you alritewhadeva with chmod
Cp the files to /system/bin.
Then chmod 755 (filenames)
Cleartmp
Clears all files in a chosen directory in a certain amount of days. You can chose the directory and the amount days.
Rename
You can rename all files or selected files.
Rmemptydir
Remove empty directories
Search
Search for files and folders
Grepcat
Is like a combination of egrep and cat.
My version of appstosd
There will be a folder in your sdcard called apps(MK47) and it has all your app from the market(free and also paid). This is good for when you wipe your Dream.
here is the scripts.
Might want to update your OP with the attachment and bold the commands so its easier to read Nice work
mohsinkhan47 said:
Please emal me at [email protected] if you have a problem.
Thank you alritewhadeva with chmod
Cp the files to /system/bin.
Then chmod 755 (filenames)
Cleartmp
Clears all files in a chosen directory in a certain amount of days. You can chose the directory and the amount days.
Rename
You can rename all files or selected files.
Rmemptydir
Remove empty directories
Search
Search for files and folders
Grepcat
Is like a combination of egrep and cat.
Click to expand...
Click to collapse
this can come in handy for the hero roms if u use the facebook feature quite often under the people app. i know i tend to show people certain pics of me or friends and it just eats up internal memory. all i do is clear the cache but if i can use this script to do so it'd save me that lil bit of hassle i have to go thru myself, appreciate the script, just curious tho... anyone know where to find where the albums cache is stored? i kno how to brose thru folders but i much rather have somebody that KNOWS rather than me THINKING i know... lol thanks in advance.
Thanks for the scripts. Can you repost the appstosd? The one you posted was empty.
cx92001 said:
Thanks for the scripts. Can you repost the appstosd? The one you posted was empty.
Click to expand...
Click to collapse
I won't be on a computer until Saturday so gtalk to me at
[email protected] invte me and I will give u the app2sd
I can't reach the clutch..
Hi,
I've been looking for a shell search tool for my SE Xperia X10 Android 1.6 phone to search the file system, and this has been the only resource I have found thus far. I have managed to download and copy the scripts to my Android device, but I am unsure on how to execute the .asc scripts on the Android shell.
I was unable to adb push the file to \system\bin. I pushed the file to \data but even mounting the system volume as RW I am unable to mv the scripts to the \system\bin folder.
adb shell
$ su
# mount -o remount,rw /dev/mtdblock3 /system
# mv /data/searh.asc /system/bin
mv /data/searh.asc /system/bin
failed on '/data/searh.asc' - Cross-device link
I tried running the chmod 755 search.asc command anyway, and execute it using ./search.asc, but receive the message:
basename: not found
getopt: not found
[: not found
shift: can't shift that many
Edit: I have now tried this in recovery mode and mounting the /system folder with RW permissions, still no joy.
Could someone please clarify what is required to get these scripts to operate?
I have only dabbled in linux so I am most likely missing something fundamentally obvious here.
Temp-n00b-usr
I managed to find a work around.
I was attempting to locate the Creatouch.apk which was not in /system/app or /data/app. It was infact in /data/app-private. I have manged to pull the .apk for a backup and removed this from the phone now.
I just used the file explorer in Droid Screencast to locate the file by browsing the system.
It would still be handy to be able to search the file system from a PC environment however.

The proper way to remove a system applications

Dears,
I'm using the last Cyanogen and I would remove some applications that stay in /system/app. I know that I can do this just with:
- rm /system/app/NAME.apk
- rm -r /data/data/NAME
but in this way the application data remains in /data/system/packages.xml: I don't want to manually change this file. Is there a more clean and automatic way to do that?
For the applications in /data/app, I can use 'adb uninstall NAME' but it seems that is not appliable to the ones in /system/app. Even after a 'adb remount'.
Any suggestions?
Just delete them.
anyone knows?
i wanna get rid of the default IM.. and amazon mp3
I repeat myself: Just delete them.
It isn't dangerous or "unclean".
Just be a little aware that some apps might seem superfluous, but actually do things other than the part you see. For example, you can't delete the stock Mms.apk and use ChompSMS as your sole SMS application - the stock app also contains the framework for the device to receive SMSes at all. I would rename files rather than deleting them, i.e.
mv thingyouwanttodelete.apk thingyouwanttodelete.old
rather than
rm thingyouwanttodelete.apk
because you can always then put it back afterwards if you find something doesn't work afterwards.
I think Cyanogen latest rom has the system app's folder as read only. So you would need to remount the drive as Rewriteable to make any changes to the files.
njakobs said:
I think Cyanogen latest rom has the system app's folder as read only. So you would need to remount the drive as Rewriteable to make any changes to the files.
Click to expand...
Click to collapse
what are the steps to remount as rw?
chmod +rw?
farbird said:
what are the steps to remount as rw?
chmod +rw?
Click to expand...
Click to collapse
-bash-3.2$ ./adb remount
remount succeeded
adb remount - remounts the /system partition on the device read-write
adb root - restarts adb with root permissions
You can delete stuff in the update.zip then just resign it. I wouldnt delete any com.**** stuff or htc.**** except widgets(on hero) always copy the update zip before you start editing so you can always add what is needed
Start asking your questions in the right sub-forum (Q&A) (Theme) or even in (General), or i will be forced to ban you for 3 days or till you learn.
Thanks
Thread Trashed!!

Battery manager fix!

This is not my doing or work, I just found it and am sharing it so please don't blame me for stealing or using anyone elses work
This is the script I found in squidlys rom and it is saved in system/xbin, if I can figure out how to post a file on here through the xda app on my phone I can give you guys the files used to run the fix. You can run the command in terminal emulator but im guessing first you may want to create a folder on the sd card named stock and then move the file battery manager to it and then run the script and restart the phone, that's what I did and it worked.
#!/system/bin/sh
if busybox [ -e /sdcard/stock/BatteryReport.apk ];
then
mount -o remount,rw -t yaffs2 /dev/block/mtdblock4 /system
busybox cp /sdcard/stock/BatteryReport.apk /system/app
sync
mount -o remount,ro -t yaffs2 /dev/block/mtdblock4 /system
echo 'battery manager fix'
else
echo 'battery manager not fixed'
echo '1) Place battery report App On The SDCard'
echo '2) Turn Off USB Storage'
echo '3) Rerun Script To Try Again'
fi
Sent from my DROID2 using XDA App
Well I can't figure out how to attach a file through the xda app on my phone and I loaded the actual page on my phone and it wont pull up my phones sd card directory so if you want the file I can post them when I get off work but the txt that I posted above is the actual file, I opened it within txt editor and copied it so if you can save it as the same kind of file that is in system/xbin (I don't know the extentions or what kind of files they are) then you could probably do it without my help, the original file name is battmanfix. Thanks for reading
hmm, just looking at the script i'd say it shouldn't work
not sure what squidlys changed in his rom (if it is for droid 2) but the default d2 mount point for /system is /dev/block/mmcblk1p21 and also file system is ext3...
did you test it?
Well I already had the folder on my sd card from the squidly rom and pretty much coppied the file to my xbin in the system folder and ran the command through the terminal emulator and it seemd to work afterwards...there were no errors in the terminal or anything and when I typed in battmanfix it responded with the whole name battery manager fix and I checked my battery manager and it worked... that's exactly what it did with squidlys so idk...
Sent from my DROID2 using XDA App
ok... so here's something funny... Looking at the script, basically all this is doing is replacing (and reactivating) the batteryreport.apk. So... me thinks to myself - "self; what happens if I just try to click on the apk as if I was gonna install it?" obviosly it didn't install, but after doing that, my battery stats were back. Something is obviously happening to where the batteryreport.apk stops syncing with the system, and anything that "reactivates" it allows it to display again...
Just my observations, yours may vary
Well like I said at the begining I just thought it was interesting and I figured id share what I found..and I don't know a whole lot about linux and codes and scripts so thanks for the info and also I didn't write it, just found it..
Sent from my DROID2 using XDA App

Categories

Resources