Android basic tutorial-1.9 Android program signature packaging, android1.9

Source: Internet
Author: User

Android basic tutorial-1.9 Android program signature packaging, android1.9
Android basic tutorial -- 1.9 Android program signature Packaging

Tags (separated by spaces): basic Android tutorial

This section introduces:

This section describes how to package our program into an Apk file and sign our Apk!
AS mentioned in the previous section, the IDE we will use in subsequent tutorials is Android Studio, so this section also explains AS (which will be used later ).
(For short) package and sign the project!

1. What is a signature? What is the purpose:

For Android apps, we need to use a certificate to digitally sign the APP. Otherwise, the APP cannot be installed on the Android mobile phone. When we debug and run the APP on the mobile phone, yes, AS will automatically use the default key and certificate for signature. However, when we release and compile a dozen times, it will not be automatically signed. At this time, we need to manually sign it!
Signing our APK has the following benefits:

  • 1. application upgrade:If you want users to seamlessly upgrade to a new version, you must use the same certificate for signature. This is because only the same certificate signature is allowed to install the upgraded application. If you use different certificates, the system requires your application to use different package names. In this case, it is equivalent to installing a brand new application. If you want to upgrade the application, the signature certificate must be the same, and the package name must be the same!
  • 2. Application modularization:The Android system allows multiple applications with the same certificate signature to run in one process. The system actually uses them as a single application, in this case, we can deploy our applications in the form of modules, and users can independently upgrade one of the modules.
  • 3. Code or data sharing:Android provides a signature-based permission mechanism, so that an application can publish its own functions for another application signed with the same certificate. Use the same certificate to sign multiple applications. With the signature-based permission check, you can securely share code and data between applications.
    To share data or code between different applications, make them run in the same process and sign them with the same certificate.
    ---- The above content is taken from: Why does android require a signature?
2. How to package a signature in Android Studio:

Okay, because this course is intended for beginners. We will discuss the content packaged through multiple channels later! This section only describes the simplest signature packaging method.
By the way, the default apk generated during debugging described in 1 is in the app/build/outputs/apk directory!
Unlike Eclipse, Eclipse is generated under the bin directory!

Okay. Open the Hello World project on our AS and click the menu:

Build->Generate Signed APK...

② In the pop-up window, if no key exists, create one. If yes, select an existing Key.

③ No. Create a new one. You can fill in related items as needed:

④ Okay. Click OK to view the password information. You may need to enter the password and enter it:

⑤ Click Next:

6. Click Finish. The following prompt will appear after a while, indicating that the application has been successfully packaged and signed:

7. You can see that the packaged APK has been quietly lying in our app directory:

The signature has been packaged in Step 7. to verify the signature, you only need to enter the following cmd command.

Summary

There are many other methods to package Android APK: command line, or Gradle, ANT, MAVEN, etc. There are many methods. This section describes the simplest way to package a signature through a graphical interface! Okay. This is the end of this section. is the simplest packaging signature method get?

Copyright Disclaimer: This article is an original article by the blogger and cannot be reproduced without the permission of the blogger.

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.