Uninstalling apps - anything left behind? - Android Software Development

Hi,
I am about to buy my first Android device (HTC Desire), and being a programmer I will of course want to write apps for it.
In the beginning I will naturally test a lot of apps created by others, and I will probably uninstall a lot of them for various reasons (lack of space being one of them).
Now to the question: Will uninstalling an app remove it cleanly and leave no traces behind? I'm not thinking about files possibly generated by the application and stored on the memory card (since that will be manually deletable), but things like settings and possibly files created in inaccessible locations on the device itself.
There is a SQLITE database in the Android system that apps (content providers) can store stuff in. This database obviously takes up space, and the question is if misbehaving applications could store stuff there that would remain after uninstall, effectively leaving garbage behind.
I realize that a hard reset would work to clean everything, but that is a drastic measure.
Assuming no root access, what is the answer to these questions? Please bear with me if these questions are dumb or too basic...
Regards
-Øyvind

To my understanding, apps are spread throughout 4 locations in filesystem.
/data/app - folder for storing apk's
/data/app-private - folder for storing protected apk's
/data/data/{appname} - app storage, settings, db's and so on
/data/dalvik-cache - folder for storing dalvik cache file for an app
From my experience, uninstalling removes all traces of an app from these locations in addition to market link from Market app db. Also with rooted phones manual uninstalling of an app is possible by removing associated content from those 4 locations. Link can also be removed, but that requires a little bit of knowledge of SQL.
If there's something to add to all of this, or if something is wrong, please someone correct me.

Related

Not a Developer - want a deeper understanding of the OS.

I am computer savvy, began building PCs in the late 70's - early 80's, beginning with DOS 1.0. I know a little basic, a little UNIX, etc., but am not a programmer.
I am as psyched about my HTC Hero Android as I am about Windows 7. I love it! Like all users, I download and delete apps on a fairly regular basis. I also rooted my phone to OS 2.1. Here's my (minor) dilemma; the deleted apps (I think) leave artifacts, files and folders. When I rooted the phone, photos and other files are now in different folders. I also see twice the number of photos and wallpaper as the system seems to be creating logo sized duplicates.
I've been searching, without success, for something that will tell me what the file/folder hierarchy is. What's the structure? How to determine which apps use which folders. Which folders are used by the OS and the mobile OS? I want to be able to keep the memory and SD clean just as I do with my PCs, as well as copy files to the appropriate folders so that they will appear correctly in whatever app should be
calling them up.
I hope all this makes sense. And I hope you know of some source of information, be it a book, blog, or other, that will provide some insight in this domain.
Thanks for the help!
I rooted to Damageless' FRESH 2.1.
I have the sdk but have not opened it yet. I'll check out Android Commander.
I have sone some UNIX and did quite a bit in MTOS on large Telecom voice switches, so I can probably eek my way through.
Thanks for the direction BWBL.
Brian
basically Android is a dalvik virtual machine(stripped down java for embedded devices essentially) that is sitting on top of a Linux kernel. My understanding is that unless a program has root, it cannot access internal storage, especially write access. All prefs are saved to a database and applications are completely sandboxed, therefore no artifacts will remain on internal memory. Unfortunately the same cannot be said for your SD card. If you grant a program access to your SD card it can **** all over it and the OS doesn't. protect you. I have found that HTCs stuff is guilty of copying pictures all over.
bnbaldwin53 said:
I am computer savvy, began building PCs in the late 70's - early 80's, beginning with DOS 1.0. I know a little basic, a little UNIX, etc., but am not a programmer.
I am as psyched about my HTC Hero Android as I am about Windows 7. I love it! Like all users, I download and delete apps on a fairly regular basis. I also rooted my phone to OS 2.1. Here's my (minor) dilemma; the deleted apps (I think) leave artifacts, files and folders. When I rooted the phone, photos and other files are now in different folders. I also see twice the number of photos and wallpaper as the system seems to be creating logo sized duplicates.
I've been searching, without success, for something that will tell me what the file/folder hierarchy is. What's the structure? How to determine which apps use which folders. Which folders are used by the OS and the mobile OS? I want to be able to keep the memory and SD clean just as I do with my PCs, as well as copy files to the appropriate folders so that they will appear correctly in whatever app should be
calling them up.
I hope all this makes sense. And I hope you know of some source of information, be it a book, blog, or other, that will provide some insight in this domain.
Click to expand...
Click to collapse
1)Backup apps with androzip.
2)Backup the entire sd to pc(you may need to format but should not).
3)Wipe(data,delvic,uid mismatches). This will get rid of those apk leftovers/uta fc's....
4)Install a fresh copy of damage
5)Now right after initial boot, back up your sd card file structure
6)Drop your pc backup folders in their corresponding freshly set-up counterparts
7)Do yourself a favor and get a good file browser and you can check out the system heirarchy for yourself. These are MY personal faves,
a)androzip-explore sd/free market
b)root explorer-explore system/paid xda
c)astro-both free/market
d)android commander-for pc free/google
e)android sdk is another invaluable tool free/google
If you need further assistance, feel free to pm. Good Luck
Awesome! Thanks Magnus.

Doing a clean uninstal of apps

Galaxy S is my first Android device, so please excuse my noob-question:
I just try alot of apps and most of them will be uninstalled by me a few days later. Does Android do a "clean" uninstall, or are there still bits and pieces in something like a registry (yes I am a windows-user ;-)). Or does that depend on the uninstall-method which is provided by the individual app-developer?
Due to the fact that there is no "General Android" - Forum I will post my question in this forum which at least corrsesponds to my current device.
Thanks for your insight.
quicky
This is funny because I also wonder everytime I delete if there are registry pieces missing lool. but I'm sure that doesn't matter.. There are however SOMETIMES folders IN the SD card or the external Drive of a phone (like the 8gb/16gb partition of the Galaxy).
All android phones are like that, sometimes they leave a folder with settings or sometimes empty folders, and sometimes no folders at all.
I think it's just to keep cache or settings.. you can simply delete those when you enter your sd card.
In Android, every app has his own "sandbox". This is like a exclusive folder for the app, where it stores everything and other apps can't access.
When you remove an app from the phone, android removes this "folder" so there is nothing left behind.
There is just one exception to this: the SD card. Some programs will store some information (for example heavy games store maps, voices,...) to a folder in the SD card. So when uninstalling just look if your SD card contains some folder with the app name and safely remove it too (unless you plan reinstalling the app later!).

Any registry scanners??

Now please don't start some flaming about how Android doesn't have a "registry" - It has ways of storing persistent application data not on the SD cards (http://developer.android.com/guide/topics/data/data-storage.html)
So are there any programs to list/scan/edit these private and primitive data sets?
The find and grep command-line tools are the classic ways to look for things on UNIX/linux/android.
You also need to deal with binary vs ASCII files. The file tool can help determine this.
The combination of these tools is left as an exercise for the reader.
Yeah, I don't understand your reply.
I was wondering if there were apps for non hacked Android phones (if the original app can write, surely another an can peek)
With android's permission setup, applications cannot modify data for other applications unless the app you wish to modify stores its data in a file on the sd card, or provides a "content provider" for other apps to work off of.
General system settings are found at http://developer.android.com/reference/android/provider/Settings.System.html
Most programs will store their settings with the "SharedPreferences" class (http://developer.android.com/guide/topics/data/data-storage.html#pref), which cannot be modified by other applications (as far as I know).
Aside from the global settings, the only real way to view or modify app specific settings is if that app has an accessible ContentProvider (http://developer.android.com/guide/topics/providers/content-providers.html).
If you want to poke around any deeper, then you need root access and to look through the sql tables directly. See http://davanum.wordpress.com/2007/12/11/android-how-to-poke-around-the-sqlite3-databases/.

[Q] removing app content from SD on uninstall

So I've been searching and searching ... but haven't found anything regarding this.
I've got a considerable amount of content on the SD card ... let's call these "shared pictures" ... storing these on the device memory is a real douchy move because it'll take up a lot of space that the user would want for their apps.
This data is currently stored on the SDCard, but here's the problem: What do I do with this data when the app gets uninstalled?
None of it is protected and it doesn't really matter if it's left on the SD, but why leave clutter behind?
I've been searching for either:
- an uninstall hook: Andy tells me when my app is being uninstalled and I delete my junk
- I register my folder with Andy and when Andy is uninstalling my app, it also deletes the folder.
Is there a standard way to accomplish this on Android?
Thanks.
I am not sure if I understand what you are trying to do. I assume the following:
You have an installed application with it's data in your phone.
You uninstall the app.
Then you are reinstall it and you want your data back.
If this is the situation then you can see this and with little further research you will accomplish it!
Edit: I was incorrect, it depends on the SDK/API level and where you store the data.
See SimonVT's link below
removed
I assume you are NOT refering to the App2SD feature. I haven't found anything that deletes the cached files off the SD card when an app is uninstalled (or even prompts you to for that matter).
But, I know what you mean. I had tried a couple podcast apps and they left HUGE files on my SD without asking me if I wanted to remove them.
I found out because they kept popping up in my Gallery app.
Sent from my EVO using XDApremium. (Support XDA)
removed
To clear things up, I'm writing an app and am mainly wondering if there's a way to know when my app is being uninstalled so I can clean up my app's files.
Sent from my LG-P999 using XDA App

[Q] 4.2 multiuser+app data in sdcard (i.e.Games)

So far my understanding is that if user 1 downloads/installs an app, and then user 2 goes "hmm you know what I want that app too" - it doesn't re download it just gives user 2 access to the already installed app. Which is cool, cuz apps are in /data/app.
But some apps, mostly games and so on, download extra data onto the sdcard. Now currently I assume none of them work cuz they look for the non existing /sdcard instead of /mnt/sdcard/0 or something; my question is how is this SUPPOSED to work? If user 1 download GTA3, downloads the data onto his folder in sdcard, then user 2 does the same thing, will i have to redownload all that data and thus use up twice the space? do they have another system for data saved in sdcard and multiuser?
TjPhysicist said:
So far my understanding is that if user 1 downloads/installs an app, and then user 2 goes "hmm you know what I want that app too" - it doesn't re download it just gives user 2 access to the already installed app. Which is cool, cuz apps are in /data/app.
But some apps, mostly games and so on, download extra data onto the sdcard. Now currently I assume none of them work cuz they look for the non existing /sdcard instead of /mnt/sdcard/0 or something; my question is how is this SUPPOSED to work? If user 1 download GTA3, downloads the data onto his folder in sdcard, then user 2 does the same thing, will i have to redownload all that data and thus use up twice the space? do they have another system for data saved in sdcard and multiuser?
Click to expand...
Click to collapse
Found this and the answer looks promising
http://blogs.computerworld.com/android/21327/android-42-multiuser-support
"With apps, the system is intelligent: If one user goes into the Play Store and installs an app that another user has already downloaded onto the tablet, Android will "install" the app for the user -- basically making it available to her -- but won't actually redownload it. And that user's app-specific data and settings will remain separate from other users' information; when a new user opens the app, it's as if the app is being opened for the first time. I tested this with a handful of apps, including third-party programs like Facebook, and it worked flawlessly."
I haven't tried it myself but its something I wanted to understand too.
TimmyUK said:
Found this and the answer looks promising
http://blogs.computerworld.com/android/21327/android-42-multiuser-support
"With apps, the system is intelligent: If one user goes into the Play Store and installs an app that another user has already downloaded onto the tablet, Android will "install" the app for the user -- basically making it available to her -- but won't actually redownload it. And that user's app-specific data and settings will remain separate from other users' information; when a new user opens the app, it's as if the app is being opened for the first time. I tested this with a handful of apps, including third-party programs like Facebook, and it worked flawlessly."
I haven't tried it myself but its something I wanted to understand too.
Click to expand...
Click to collapse
The thing is unlike stuff like "facebook details" or smthg, game data is NOT private or user specific. duplicating serves no purpose. The only way to change i spose is to get all extra game data etc to go into /data/<whatever> instead of in an sdcard folder. .

Categories

Resources