i'm new in android developing. (and in developing after all)
Here is my problem: If i install my android application onto my mobile device or AVD, i want it to check the current app version number and if it's lower than the one i want to install currently then install it, and if it is higher , then alert the users that they already use the latest version.
Because now when i install the .apk file, it just installs the app again and nothing happens.
Is it possible to develop this?
Best regards,
weeyas
The install process is managed at the system level, so your application has no control over it. As per the versioning guide, the Android system will only allow you to install updates from the same or newer version codes (i.e., version 1 can be replaced by version 2, but version 2 can never be overridden by version 1 unless you do a complete uninstall/reinstall). This applies to both Google Play updates and sideloading APKs yourself.
I don't know if it is possible if you try to install application from .APK file. However, you will not be able to publish the newest apk to Google Play if it has the same or lower version number than the current one.
Related
I have built an android tablet application which is installed only from my web site - manual install.
I will need to be able to provide updates to existing users through the same site - without obliging users to uninstall the existing application.
What do I need to change in my (eclipse) project to permit this ?
Simon -
Apps are designed to be upgraded in place on Android. All you need to do is ensure that the version number of the app being installed is greater than the previous version.
You can still provide debug releases, simply increment a portion of the version to reflect that change and your users can keep getting updates. Otherwise, you may want to have an explicitly Debug and Release version that can be installed side by side and not conflict with each other, but that may be more trouble and confusing than its worth.
I know on iOS that if you raise the min iOS version on a release it means that any devices that are unsupported can still download the previous application that does support them.
Is there such a thing on Android or is at as soon as you release the new APK, the old one is removed from sale?
Whether the APK is removed or not depends on you - if you keep both versions active, GP will resolve which one should every user get - those with newer APIs will get updated one, those with old APIs will still be able do download previous version.
If you are really into "separate API", read this article.
EDIT:
I believe similar question was asked here.
If you raise sdk version user with old sdk will not be able to download it. If user has already installed apk with old sdk and you update apk in gplay, he can use it while he doesn't uninstall it manually.
I have an application already installed on the mobile, am trying to install the update version of it.
I placed the apk inside the data/data folder, using file manager at the path,am trying to install it -
it shows a dialog to replace but not upgarde (Signed with the same key-store and version code/version name has an incremental value).
Could someone explain me more on this?
There is a difference between installing and subsequently, updating, apps off Google Play. Applications installed via a File Manager, for instance, will always prompt you to replace and not update an application. Side-loading apps on devices directly, does not have that mechanism to update. This is true not only for your app, but for every app.
It does not matter how it was signed or even the increment of your app's version.
Upgrade is only possible when you actually follow the installation procedure from Android Market. Else, it would just be a replace.
The README for the market billing sample states:
In-app billing requires version 2.3.0 of the Android Market
application. To run the sample application you must have this version
(or a newer version) installed on your device. You can check the
version of the Android Market application by doing the following:
Open Settings on your device and touch Applications.
In Application Settings, touch Manage applications.
Touch All to list all applications.
Scroll down and touch the Market application.
The version number appears under Market at the top of the screen.
Well, I did just that and discovered that my Market version is very old: 1.82
I thought it would update itself automatically (as described here), but for some strange reason it never did, and I can't find a way to do this manually.
I suspect this has to do with the fact that My Android 2.2.1 is a CyanogenMod-6.1.0-N1.
Any idea how to update the Market application in my phone?
Update: I just discovered this thread, which allows me to report success in upgrading to version 2.2.7. Here is what I did:
Downloaded the Vending-2.2.7-signed-testkeys.update.zip file
Copied the Vending.apk inside it to the sdcard
Downloaded ZipSigner 2 (from the Market)
Selected the new Vending.apk as input, and specified signed-vending.apk as output.
Selected "platform" as key/mode
Signed the file (success).
Ran the resulting signed-vending.apk from File Manager.
Wow! That is some progress. I believe the way from here to 2.3.0 would be easier.
I have been able to upgrade to the latest 3.4.4, thanks to the first reference in Wikipedia. Here is what I did:
1. Downloaded the "Android Market 3.4.4 With Noticeable Speed Improvements" file.
2. Copied the downloaded AndroidMarket_v3.4.4.apk to the sdcard
3. Downloaded ZipSigner 2 (from the Market)
4. Selected the new Vending.apk as input, and specified signed-v3.4.4.apk as output.
5. Selected "platform" as key/mode
6. Signed the file (success).
7. Checked "Allow installation of non-Market applications".
8. Ran the resulting signed-v3.4.4.apk via File Manager.
Works like a charm!
One more solution could be, go to menu, select "update over wifi only". Whenever you come under wifi range, if there are any updates, it will give you a notification. With this you can always have the latest version of the market app since even market app is an apk file :)
I have a new version of my app on the market and an old one installed on tablet. I expect to see download/install option when I navigate to the application page on the market but instead I see "open" button as if the market version were already installed on the device. versionCode is incremented in market's version.
What could be a reason for this?
The version of your app installed using adb is probably not signed, or if it is the signature doesn't match the one on the app in the market. First need to uninstall the version that was installed using adb then the market version should install without a problem.