tags:

views:

52

answers:

2

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

A: 

I would try:

  • Increasing the android:versionCode in your AndroidManifest.xml
  • Generating the apk
  • adb install name.apk
Macarse
This won't let you install over an existing installation. `adb -d shell pm uninstall -k package.name` lets you remove a package without removing the data files or cache. I guess that's the best I can ask for. Thanks.
NKijak
+1  A: 

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.

Greg