Description:If your previous program is a default signature (that is, debug signature), once the new signature app will not overwrite the installation, the original program must be uninstalled before it can be installed. Because the program covers the installation main check two points:
1) The entry activity for the two programs is the same. Two programs if the package name is not the same, even if all the other code is exactly the same, it will not be considered a different version of the same program;
2) Whether the signatures used by the two programs are the same. If the signatures of the two programs are different, even if the package name is the same, it will not be treated as a different version of the same program and cannot overwrite the installation.
In addition, someone may think that the debug signature application can be installed anyway, there is no need to sign their own. Don't think so, debug signed applications have such two limitations, or risk:
1) The Debug signature app cannot be sold on Android Market, it will force you to use your own signature;
2) Debug.keystore on different machines may not be the same, it means that if you change the machine for the APK version upgrade, then the above program will not cover the installation of the problem. Do not belittle this problem, if you develop the program only you use, of course, no matter, uninstall and install it. But if your software has a lot of customer use, this is a big problem, the equivalent of software does not have upgrade features!--------------------------------------------------------------------------------------------------------------- --------------------------------------------------------------------------------------------------------------- ----------------------------------------------------------------
A few things to note:
One: Multiple programs of the same developer use the same digital certificate as much as possible , which provides the following benefits.
(1) in favor of the program upgrade, when the new version of the program and the old program's digital certificate, the Android system will think that the two programs are different versions of the same program. If the new program and the old version of the digital certificate is not the same, then the Android system think they are different programs, and create a conflict, will require the newly-created program to change the package name.
(2) facilitates the modular design and development of the program. Android allows programs with the same digital signature to run in one process, and the Android program treats them as the same program. So developers can develop their own programs into modules, and users only need to download the appropriate modules when needed.
(3) Data and code can be shared across multiple programs through permissions (permission). Android provides a digital certificate-based permission-granting mechanism that allows applications to share overviews or data with other programs to those that have the same digital credentials as themselves. If the ProtectionLevel of a permission (permission) is signature, this permission can only be granted to programs that have the same digital certificate as the package in which the permission resides.
When signing, you need to consider the validity period of the digital certificate :
(1) The validity period of the digital certificate should include the program's expected life cycle, once the digital certificate expires, the program that holds the digital certificate will not be upgraded properly.
(2) If multiple programs use the same digital certificate, the validity period of the digital certificate will include the expected lifetime of all programs.
(3) Android market enforces that all application digital certificates remain valid until October 22, 2033.
Two: Android digital certificates contain the following points:
(1) all applications must have a digital certificate and the Android system will not install an application without a digital certificate
(2) The digital certificate used by the Android package can be self-signed and does not require an authoritative digital certificate Authority signature Authentication
(3) If you want to formally publish an Android, you must sign the program with a digital certificate generated by a suitable private key , rather than using the ADT plugin or the debug certificate generated by the Ant tool to publish.
(4) Digital certificates are valid , and Android only checks the validity of the certificate when the application is installed. If the program is already installed on the system, it does not affect the normal functionality of the program, even if the certificate expires.
(5) Android uses standard Java tools Keytool and Jarsigner to generate digital certificates and to sign application packages.
(6) Use the zipalign optimization program.
Android does not install an APK program that runs without a digital signature, either on the emulator or on the actual physical device. Android's development tools (ADT plugin and ANT) can help developers sign the APK program in two modes: Debug mode and Release mode.
In debug mode, Android's development tools use a debug digital certificate to sign the program each time they compile, and developers don't need to worry about it.
When you want to publish a program, developers need to use their own digital certificate to sign the APK package, there are two ways to do it.
(1) Use the Keytool in the JDK (for generating digital certificates) and Jarsigner (for signing with digital certificates) on the command line to sign the APK package.
(2) Signing with ADT Export Wizard (if no digital certificate may be required to generate a digital certificate).