문제

During the upgrade of my android application, I changed the package name. But Android market doesn't allow to upload the changed package name application as an upgrade. If I upload the application as a new application, will the user have two applications on his/her device? How can I make sure that the user doesn't have to download the application again from scratch without reverting the change of my package name?

도움이 되었습니까?

해결책

two package = two different application in market place. Once you upload one app, its package should be same. Also, the key should be same.

다른 팁

Android market is only concerned about the package name in your manifest, not the actual packages name in the source.

You could try to give the old package name in the manifest attribute, then for activities give the new package name instead of relative (ie .MainActivity)

Like this:

<manifest package="your.old.package" ...>
   ...
   <application android:name="your.new.package.MainActivity" ...>

Could work..

I plan to serve two versions of my app (paid/free) this way and using same project and code.

If you change the package name, it's treated as a separate app - not just in the market, but apk's in general will only 'replace' the same package name (and only if they're both signed with the same key).

Although it's possible to phase over to a new key by signing an intermediate package with both keys, there's currently no easy way to phase over the package name.

The best that can be done is this:

  • New apk version is signed with the same key, but has a different package name.
  • When installed, the new apk arranges to use the shared_prefs with the old package name.
  • The data is copied across to the new package name.
  • The new version requests that the old version is removed, and the user sees the uninstall dialog.

Note app data is usually kept here:

/data/data/pac.kage.name/

I haven't tried this, so I can't give anymore details yet. You may also be interested in my request for a seamless way of transitioning the package name.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top