I made an app that use the sharedPreferences and i storage some info there, when i uninstall the app and install again the info storage there always appear, i don´t know why. I don´t programming anything to keep them there.
I just upgrade my Galaxy S to 2.2.1 and i did a back up of all my apps including that i made, i don´t know sure if Android does not erase correctly the app.
I did uninstall others apps like facebook one and apparently erase all files fine.
I need suggestion of what can i do, please.
I have the same problem too, and the problem is in the Galaxy S 2.2.1 ROM. It is buggy.
It saves the shared preferences in /dbdata/databases/app-package
Unfortunatelly when you uninstall the application that place is not cleared! It's frustrating.
It makes SharedPreferences completely useless in Galaxy S. When you uninstall, re-install the app you can never change SharedPreferences again.
I don't know if this is still an open question anymore but so long as you follow the rules in the Internal Data Storage API then the files should be deleted for you automatically when the project exits.
You can save files directly on the device's internal storage... When the user uninstalls your application, these files are removed.
Related
I followed steps from this tutorial:
Exported .apk can install on all my devices, but when I uninstalled and then installed my phone said 'App not installed'. My clients had the same problem even from the first installation.
There are no multiple users on my phone or any other so I can't do 'uninstall for all users'.
After that I tried to export from Android Studio with same keystore and passwords and it just created more problems with the same initial problem and that's 'App not installed'.
After that I resolved many problems that Android Studio made with updates and I still can't export it properly from Visual Studio Code.
My head hurts.
Edit: Now I've tried jarsigner and zipalign and it still doesn't want to install.
EDIT2: Issue goes away when I move .apk to internal storage. Is this a legit solution?
This is a very open ended question and it's quite hard to give a clear answer without further information. But usually 'App not installed' error happens because of following reasons (among others)
Insufficient storage
Corrupted/Contaminated App file
SD Card not mounted in the device
Storage location
Corrupt storage
Application Permission
Incorrect file
things you can try
Do the tried and tested "Have you turned it off and on again"?
Delete unnecessary files/Apps
Reset All the App Preference
Go to Settings on your Android device.
Open Apps or Apps manager.
check for All Apps.
Tap on the menu icon.
Click on ‘Reset App Preferences’.
Clear Data and Cache of Package Installer
Open setting on your Android device.
Look for the option called Apps or Manage apps and tap on it.
Check for the Package Installer App under system Apps
You will find two option of Clear data and Clear cache. (For Android Marshmallow 6.0 users check for option Storage to clear data and cache)
Clear the data and cache to solve the problem.
You could also try changing the bundle id and see if that would do the trick
Hope this helped
So i'm gonna be as elaborative as much as I could..
I have a Xperia L with latest firmware and I was trying to set some third party apps to system apps, and I succeeded after some time I thought that if I could set App updates to system app (meaning removing the older version) and I succeeded again but when I was doing the same to Chrome I stumbled upon to a problem..
So before I tell you what was the problem i'll tell you how I did it..
1.I updated Chrome.
2.I moved the original. apk from "system/app" dir to My SD so that it can be changed to new one. (My set is ROOTED)
3.Then I moved the. apk from "Data/app" folder to "system/app" folder.
4.And renamed it to the Original. apk 's name.
5. And changed the Read/Write Permissions as it should be.
6.That's that.
So after that I tried launching chrome but it said
"Chrome failed to start due to an Unexpected Error"
but with above methods I replaced a lot of apps like Walkman, Calendar, PlayStore, Play Services and some i don't remember...
and they all worked fine even after restarting it..
so then I uninstalled Chrome with Titanium Backup since it was a system app..
and then I tried the same with Album app.
I replaced it's. apk and tried it but it started crashing.. so I deleted it. too and placed the original one back..
and restarted my set..
But now it is stuck on Black Screen after Sony logo...
I know I can Flash the ROM to get going but if there's any other way to do so please let me know..
now i know it's kinda two questions in one but I really need to know both..
Thanks in advance...
You can use Link2SD or other root apps to add them automatically to the system image
I have creaded simple app, which calculate some data what user write to app. Data are saved in sqlite. When I deploy app on my phone, everything is ok, but when i put .apk file to my phone and install it and start it, app drop on start. I tried allow all permissions, but it doesn't help. What is wrong?
I solved it. I just unchecked Use shared runtime in manifest android options.
I'm writing my first app for android and I already faced a irritating bug on Samsung devices with android 2.2.1.
http://code.google.com/p/android/issues/detail?id=14359
The problem is that the shared preferences becomes inaccesible when you reinstall the app, because the directory with preferences is not deleted and new reinstalled version is not owner of the directory. What results in situation when there are lot of settins saved in shared_pref and user updates the app he lose all the settings and cannot save new one.
As these devices with this version of android are still big part of the market and I'm already aware of this bug I would like to find some workaround for this issue.
On rooted devices I can perform chown to solve the problem.
Does anybody has an idea how to solve it on non-rooted devices (without migrating all setings to sql database)?
I was thinking about manually deleting the directory when I'm still its owner, but the problem is when to do it?
Is there any intent on app uninstall or update?
Is there any intent on app uninstall or update?
Update, yes, but this problem should not exist on an update. A regular update does not uninstall and reinstall the app, so the bug should not be triggered.
You do not get control at uninstall time.
For the next version of our application, I want to change the sharedUserId since we now use an internal control dashboard app which must write to the other app's settings files.
But since the app is already installed on many phones, will this be a problem? I ran a little test on the emulator, and I'm seeing exceptions in the device logs that *.bak versions of the preference files cannot be written. Not sure how critical that is. Curiously, safing settings still seems to work, even though the shared_prefs folder had been created using another Linux user ID.
Did anyone try this before?
And to answer my own question again:
No, it's not safe. Since updating an app via Android Market will not remove the database and preference files, the new version will not be able to read or write these files (since they were created under a different Linux user ID), and the app will crash after the update. You would have to ask your users to completely uninstall and reinstall the app, which is certainly not recommended.
As a general rule I conclude from this:
Whenever you start out developing a new app, make sure to set a manual android:process and android:sharedUserId attribute! It doesn't hurt in case you don't need it, but it gives you full control over which apps have access to this app's private resources.
No solution as of now, but starring at registered issues might get Google to fix this:
http://code.google.com/p/android/issues/detail?id=1227
http://code.google.com/p/android/issues/detail?id=14074