weeyas
weeyas

Reputation: 1

android update/install version checking

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

Upvotes: 0

Views: 475

Answers (2)

ianhanniballake
ianhanniballake

Reputation: 199880

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.

Upvotes: 1

lotusight
lotusight

Reputation: 5

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.

Upvotes: 0

Related Questions