How can you reproduce the procedure that occurs when a Android market app is updated?
I have an app that reads and writes files during onCreate
. The problem is that when the app is installed via the Market and run the first time the files it needs to get have no access to them. I get FileNotFound exceptions even though the file is there. If I back out of the app and reopen it then the files can be read.
This is not the same behavior when pushing the apk from eclipse or adb. In fact I was able to reproduce 开发者_如何学Cthe problem using eclipse and thought I fixed it doing adb uninstalls and eclipse installs but the problem persists for users pulling the update from the market.
If you increase your CodeVersion, then build your apk (signed with the same cert as the previous market application), running adb -d install -r package.name will install the application without removing the data. It basically does an update. I believe using the -l option will ensure that the CodeVersion number is also of a greater value than is currently on the phone.
I would try:
- Increasing the
android:versionCode
in your AndroidManifest.xml - Generating the apk
adb install name.apk
adb -d shell pm uninstall -k package.name lets you remove a package without removing the data files or cache.
精彩评论