开发者

What determines if an app can be updated in Android Market besides versionCode?

开发者 https://www.devze.com 2023-03-28 08:42 出处:网络
What determines whether or not an app is marked as having an update in the Android Market?Obviously, the package names must be the same and the app in the Market must have a higherversionCode.

What determines whether or not an app is marked as having an update in the Android Market? Obviously, the package names must be the same and the app in the Market must have a higher versionCode.

What else? I noticed that side-loading a previously released version of the app will开发者_JAVA技巧 trigger the "Update" message in the Market app. However, installing the debug version does not have the same effect. It recognizes it as being installed, but does not indicate that an update is available. I assume this is because they are signed with two different signatures. Is that accurate?

If so, if an older version of the app is installed from a third party app store using the same signature and package name, will the Android Market show that the app has an update available? What's the best way to prevent that -- use a different signature?

Are there any other contributing factors that I didn't mention?


The debug version is signed with a different key (automatically created by Eclipse), so it's seen as a different app from the one in Market (signed with your release key). However, with the new Market (3.x) I am getting update notifications even for debug version I installed through Eclipse, so it looks like it's not checking the signature, just the package name and the version. (Updates, of course, fail because the signature is different).

You can (try to) determine how your app was installed using the PackageManager, with something like String installPM = pm.getInstallerPackageName(pname); and do some specific processing based on the installer. The Android Market app might be doing something similar, but you'd have to test to find out.

All in all, the way the Market app works is undisclosed and it may change in the next version, so there is no bullet-proof way to control whether you get update notifications or not.

0

精彩评论

暂无评论...
验证码 换一张
取 消