Android - updating application published to Google Play - requires reinstall - android

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.

Related

Android - Conflicting providers/authorities

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.

Parse.com - I get duplicated push notifications after releasing my application

Finally after a lot of hassle I released my first Android application after migrating from C# to Java :-)
But now I get duplicated notifications on devices where I've debugged my application before finishing coding.
All other users who installed my application after its release get the push notifications properly without any duplication or any kind of problem.
"After googling & searching I found out that this problem only exists on older Parse.com SDK, but it's weird since I'm using the latest one!"
I've been wondering about two things:
Will other users face the same problem after I release an update? ( Version code will be updated - And I'm not using any store, I maintain the updates on a private server & got my own code to do the update process ).
How can I solve this problem? I was thinking about creating a new application entry on my Parse.com account for every single new update ( If I'm sure that there isn't any solution ).
Any help would be appreciated.
After extensive testing & checking ..
I found a proper solution, may be good for some, but a lot will not like it.
It's a bug in Parse's SDK itself as I guess, when you delete the application from a device, it won't delete its record from the database. So, when the app is installed again, the same device will have two different records. So it gets 2 duplicates .. The number grows as much as you uninstall/install!
My solution is to increase the version code and change the version, so it'll be considered as a new application by Parse with new records!

Android development - Users updating app question

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.

can i update an app in the market without incrementing the version?

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.

How do I most easily delete Android application data upon upgrade/update?

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").

Categories

Resources