In the "Android Phone defender-Package build APK maintenance to the server" article, the implementation of a new version of the APK to the server, when the client apk opened, found that there is a new version, prompting updates. Also implemented using the Xutils tool to download apk from the server side
This article address: http://www.cnblogs.com/wuyudong/p/5903484.html, reprint please indicate source address.
This article implements the download of the native APK installation, the process is very simple, refer to "Android apk installation"
The code is as follows:
/** * Install the corresponding apk @param file installation files */ protected void installapk (file file) { // System Application interface, source code, install APK entry new Intent (); Intent.setaction ("Android.intent.action.VIEW"); Intent.addcategory ("Android.intent.category.DEFAULT"); " Application/vnd.android.package-archive "); StartActivity (intent); }
After you run the project
Click Install
Installation fails, note here
Install APK considerations
Upgrade
1, note: The original application is covered out, the package name is consistent
2. Consistent signature???
Apps running from Eclipse to your phone, using apps in the Bin directory, using the Debug.keystore signature app
Mobile defender version One, right button to run to the phone, so use the signature is Debug.keystore
Mobile defender version Two, packaged separately, generates the corresponding signature file Wuyudongkeystore
Generate an Wuyudongkeystore as a signature file apk
Following the above, the problem can be done
Ps:
Signature is the same, package name is different: build two mobile defender apk, package name is the unique symbol of the app
Different signatures, package name consistent: Overwrite installation failed
1.0 Generating KeyStore
2.0 ... Use the existing KeyStore and password to
keystore+ password properly saved
Android phone Defender--Signature File Description & Package Name Description