I've written a program that, when completed, I plan to add to the Android Marketplace. I have given many files as features for users to store information and reload later, and while debugging, I've noticed the files tend to get deleted when I update the code after a long while (like a few days spread apart--for some reason, it doesn't happen when I update the code often, like every hour when I'm adding new features and testing them out). Note that I use a real phone for testing and not the emulator. What I'm wondering is, will the files get deleted after each release of the app?
I really don't want users to lose their stored information on every update or bug fix I provide, so if that is the case, is there a way around this?
Nope the files doesn't get deleted automatically, but it depends upon where you are storing the files. If the user deletes the app the files associated with it will get deleted too. But in case of an upgrade, No! normally it won't.
In case you are using SQLite for storing data, there is a proper way to handle upgrade there.
Related
I've been noticing for the last month or so that users of my Android app are receiving partial updates. What I mean by this is that their version is up to date and has most of the features that I had made live, but at the same time would still have code that I had changed weeks earlier. This did not affect users that did a clean install though, just the 99% that probably update an app like a normal user would. I could see how this could easily be caused by a lapse of concentration while using "git add" however I've exclusively used "git add -A" for probably the last two months so this is not the case. Recently I got fed up enough with it that I purposely changed some of the log statements here and there just so that if I ran into another user who's phone had partially updated, I could check it out and see what files were up to date or not. Amazingly, I found a mix and match of updated and outdated files. I contacted Google via chat and they said that they would transfer me to an email conversation with a technical representative, but I haven't heard back yet. Has anyone else encountered this issue and how would you go about solving this?
I'm trying to install Kik Messenger twice. I have two accounts and don't like to log out because I lose all of my conversation history. I'm currently using Titanium backup's profile feature, which is a very nice fix, but it's still a pain having to switch back and forth between profiles. I might be looking for "perfect" when perfect doesn't exist. I am completely new to modding apks and Android in general, all of my work on this so far has been "trial and error". Anyways, here's what I have:
I have the Google Play version of Kik installed on my phone. I have extracted that app and modified the package name successfully using apktool. However, when I try to install, I get an error saying something about duplicate provider authority. So I did some research and learned that I'm supposed to edit this part of the AndroidManifest. So I have played around with that a little bit and after I change the authorities, I am able to install the modded app. However, it crashes immediately.
Does anyone know how to fix this problem with the provider/authorities?
The issue you're hitting is that the app has registered certain classes to handle particular events. These need to be unique across all installed apps and point to existing classes in the app that will perform some activity with the supplied information.
You bypassed the safety check when installing by changing the defined handlers in the Manifest but that didn't really fix it as they still need to actually point to a valid, working class that can handle the requests/events.
You would need to decompile, rename the classes involved and all references made to them and recompile the whole app to really fix the problem. However, I'd assume that it would likely be against the license. If the code is open source then it wouldn't be too big a task to rename some classes & packages then build the app. If it's closed source then it is a harder task.
What you can do is either set up your device to use multiple accounts (the OS not the app) as each user has a separate data storage and preference location that should allow you to have two configurations. Or you can request that the developers include some sort of multiple account handling or easy account swap feature.
I have published an application to Google Play store. Now I have update ready, the application uses some serialized objects and the update has changed them a bit, therefore an uninstall before updating is needed.
How do I force users to uninstall the application first or do I have to work this out in code somehow?
I think you should work this out in code. Figure out a way of identifying the old data and converting/upgrading it to your new structures if needed/possible. Even keeping the old object defs around for reading and then converting these in memory to the new structure should work.
One option would be to write some kind of "schema version" pref that at least tells you what the data was written under (missing that pref means it is version 1). At least it will be easier next time.
BTW, the reason I recommend this over just deleting the files is the risk of just repeatedly deleting the files. You need some way of detecting that the files that are there are old (ignorable, deletable or for upgrade) or new and should be kept.
Periodically I'd like to make very minor changes to an app on the market, that don't justify notifying users that they need to upgrade. For instance a little cosmetic tweak. Basically I don't want anyone (including my client, for whom I built the app) to notice that I made the change, but I'd like all new downloads to get the changes. Can I do this, or will making any changes cause everyone to be alerted there is a new version?
I understand where you're coming from but this is a very bad idea. If it were possible you could have a bunch of people with the same version numbers but a different program making it very difficult to track if something goes wrong.
You can however increment only the integer version and leave the text version the same (this only shows in the market anyway).
This will still cause people to get auto updates for your app. I think you should either bundle all your changes up and wait or just accept that everyone will be getting lots of updates for your app.
Unfortunately Prashant's answer is not correct. You only need to increment the code, not the human readable version string.
I frequently leave the user visible version number alone when releasing minor tweaks and bug fixes, saving the market visible version numbering for actual features and major bug fixes.
Well last time i tried to the same thing, i got a message that application version numbers needs to be incremented before uploading a new version of the application. Also, version number and version code need not be in sync. But both needs to be incremented before uploading the new apk in market place. Hope this helps.
So, I have found a bug in a specific sdk that causes it to fail on some Android phones after re-installing a new version of an app which uses the sdk (via adb install -r, and presumably when a user gets an update that has been pushed to the Android market). Is there any way to force an application's data to automatically be cleared upon update of the app? I realize there are different ways that data could be stored, but I just need to essentially simulate an invocation of the "Clear Data" button that'd you find when browsing to the application in the "Manage Applications" section of the Settings (i.e. I just want all data gone).
I am an Android noob and am doing minimal Java coding on this project, so I am basically looking for the simplest solution here. I suppose I could settle on storing a "currentVersion" to disk and then checking it upon launch every time to see if the real current version matches the version that was written to disk on the last launch. Is that the only real way to do this? If so, what's the simplest way to do so?
Thanks!
Is there any way to force an application's data to automatically be cleared upon update of the app?
No, at least for my definition of "automatic".
I suppose I could settle on storing a "currentVersion" to disk and then checking it upon launch every time to see if the real current version matches the version that was written to disk on the last launch. Is that the only real way to do this?
I'd name it lastKnownVersion, but otherwise this approach seems sound and probably is your only viable option.
If so, what's the simplest way to do so?
Ummm...do exactly what you said. Use Java I/O (storing the file somewhere inside of getFilesDir()), or SharedPreferences.
Bear in mind, though, that your users may get rather frustrated if you blow away their data on an app update. Personally, I'd rather we find a better solution to your original problem ("I have found a bug in a specific sdk that causes it to fail on some Android phones after re-installing a new version of an app which uses the sdk").