I want to export a new version of my APPLICATION, and i want to force the user to uninstall and reinstall the app for the new version (for different reasons). Is it possible?
Changing the signature of your app, will do the trick. What happens is that the system will warn the user when installing the new app that this app was found but with a different signature. The user has to uninstall the current app before the new app can be installed.
A more direct way than this does not exist. And there is a chance that many users won't understand why the app does not install. You should try to make your app so that this won't be necessary. Uninstalling the current app will also mean that the users loses it's data.
Another option is to change the package name in the manifest file, but this will mean the user loses all it's app data. Because the app will be installed as totally new app.
It's bad....
Rolf
Change the signature / key of your apk. I have read the this forces a full uninstall on the devices
Screenshot from eclipse.
Related
I've reinstalled windows and accidentally removed the key-store file that I've used for my project. I try to make a new one, but something is not inserted like the last time(alias maybe.) Now I have a problem: When I start to update the.apk file I get the following message:
An existing package by the same name with a conflicting signature is already installed.
My application automatically checks for project updates (new version) on a private server. The problem is that some people already have an app on their phone.
My idea was to compare keys and if it's different to ask the user to remove old apps in some dialog or something like that.
Is something like this possible, if not what are my others options ?
Thanks.
You need to release a new app with a new packagename.
If you no longer have the keystore used to sign your first app, you can never update it again in Play Store.
If you distributed your app manually and have not released it via Play Store, your users can uninstall the app signed with the lost key and install the new one.
There is no way to show a dialog as you cannot update the app. You can only replace it as described above.
I am building a launcher application that I would like to update over the air. I created a service class that successfully checks and compares App version numbers to determine whether an update is needed. If the compared apk version is higher than current version, I download the apk from my cloud server, and then bring up a dialog to install it.
The conflict I am facing is that the update will not install. I receive an error "An existing package by the same name with a conflicting signature is already installed". I am beginning to wonder if my methodology is correct. How can I resolve this? Here is what I am doing.
Once an update is confirmed, I display a dialog and on press of the confirmation button I use an Intent to parse the app URL
Intent i = new Intent(Intent.ACTION_VIEW);
i.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
i.setData(Uri.parse(appUrl));
startActivity(i);
finish();
This actually posts a notification that I have to click and press install on. Once I do, it attempts to install, but then gives me the error on conflicting signatures.
Ideally, I just want it to install without having to see the notification. Thank you in advance.
You need not necessarily use Playstore or any other app hosting service to manage your application upgrades. Your users should enable: Install from un-identified sources (on their android handset)
For auto-upgrade you must release all your APK's with the same Signature. If you just build and run the application from Eclipse, the APK file generated in DIST folder is signed with Debug key (the default key of each machine)
Now if you build the same Code from different machine, the debug key values will be different and you would get the error: "An existing package by the same name with a conflicting signature is already installed" while installing the new APK
Here are a few solutions to it:
Always release the APK for auto-upgrade from same machine (this is definitely impossible)
Sign all the APK's with same signature. In Eclipse: Right click on project > Android Tools > Export Signed Application Package
You are setting it up almost correctly, but you should also set the data type:
i.setType("application/vnd.android.package-archive")
Additionally, do not call finish() after startActivity(). It is not necessary and might cause issues with the new Intent.
Your signature conflict is another problem. See this answer. The APK you are trying to install is signed with a different key that the currently installed one.
Finally, there is no way to install an APK without the user's explicit interaction (unless you have root, of course). This is intention for security reasons.
I have seen the "same signature" error when deploying directly from Android Debug Bridge. I am thinking you will not be successful in this approach, because:
Android security always requires user authorization to install updates (unless you are rooted, or are part of the system like Google Play Store auto-update.
Google play always has to kill the running process to update it. This probably will be ok if you service and the application are actually separate installations (i.e. two apks).
The same signature error I received in ADB is usually when the system is requiring me to completely uninstall the original signature application. Two applications with the same signature cannot be installed concurrently; something is triggering Android to not perform an 'upgrade' of the same package.
Here are the allowable ways to perform an upgrade:
Is there a way to automatically update application on Android?
Some of the applications I have installed on my phone update automatically, I don't even have to click anything. This is the behavior I expect from the application I'm developing myself. Do I have to configure something or will android market take care of this?
This is not a behaviour you can set on the application itself. Each user chooses how the applications he downloads are updated. This is a market setting.
In the latest versions of the market, the default is now set to auto-update, but the user is free to untick the box and decide for manual updates, per application. If you open settings, you can also decide whether it's done on Wi-Fi only or on mobile data as well.
This will be done on all updates except the ones where a permission change occurred. For them, the market will still require a manual update.
Auto update is possible. But you should click app to start it at least.
In the start process, you can send the current version status to server through web service, server will identify the version if there is new version. if yes, a new version apk file will be downloaded, and the most important is how to install a apk file sliently.
Generally, you can run the
pm install -r xxx.apk
the apk will be automatically installed, and your app will be updated.
I'm almost positive you can't force users to update their installed apps, but I think it is the default behaviour of the Android Market.
I modified my application package name and updated the application, Now I want my users to have the new application instead of old one. Is it possible that I can uninstall my previous application while installing this new application or to push a update for old application which uninstall itself and install new one?
Since I modified the package name, do the default update of android will work?
Can some one suggest best way for the same. I can use the same key to sign my new app which i used for the other in case.
Thanks
Pranay
The Android update system is completely based on the package name,sorry!
You can not uninstall applications programmatically.
However this seems like a reasnoble solution:
Put the app with your new package name on the market.
Push an update to the old package, where the application starts, shows a dialog asking the users to upgrade, with a single button that will redirect to the Market page of your new app.
Alternatively, you could have 2 be optional for a period of time, and then "force" users to upgrade after a while.
When I update some applications, I see some show "Manual update". I believe this will force uninstall of old version first and the installs fresh.
1. Is it true?
2. How do I FORCE uninstall of new version (with all preferences etc.), and install the new version fresh?
The manual update isn't going to uninstall your application, then reinstall, what is happening is because the dev has changed a security requirement of the app, the user needs to agree to it again.
So for example, if I developed a word search app with no security requirements, the user agrees to install it and uses it so decides to tick the auto update, or hits update all. My first update is simply adding puzzles - it would update fine.
I now add a feature to read a users SMS and their Contacts and use the internet to send me all the details.
The security privileges of my app have changed - now my app will not be included in the auto update or update all as the user needs to agree to these new security privileges and thus hopefully alerting the user to the outrages nature of the security requirements for this type of app.
Read More Here
If what you are trying to achieve is wiping all users data, then you need to add this to your code as I don't think it is possible to do this as a market update option (I could be wrong as its not something I would normally recommend).
To do it in code, a simple look at the app version code, and if its below X then delete prefs & or DB would do the trick I would have thought.