Easy Tutorial
❮ Verilog Data Type Javascript Slideshow ❯

1.9 Android Application Signing and Packaging

Category Android Basic Introduction Tutorial

Introduction:

The second to last section of Chapter One, this section introduces how to package our application into an APK file and sign it with a certificate! In the previous section, we mentioned that we will be using Android Studio as our IDE for subsequent tutorials, so this section will focus on packaging and signing projects in Android Studio (referred to as AS hereafter).


1. What is Signing and Its Purpose:

>

Android apps require a digital signature from a certificate to be installed on Android devices; otherwise, they cannot be installed. During development and testing, AS automatically signs the app with a default key and certificate. However, for actual release builds, the app does not get automatically signed, requiring manual signing. Signing your APK offers the following benefits:

-1. Application Upgrade: To allow users to seamlessly upgrade to a new version, you must use the same certificate. This is because the system only allows installation of upgraded applications if they are signed with the same certificate. If different certificates are used, the system requires the application to have a different package name, effectively treating it as a new application. For an application to be upgraded, the signing certificate and package name must remain the same!

-2. Application Modularity: Android allows multiple applications signed with the same certificate to run in the same process, treating them as a single application. This enables deploying the application in modules, allowing users to independently upgrade individual modules.

-3. Code or Data Sharing: Android provides a permission mechanism based on signatures. An application can expose its functions to another application signed with the same certificate. Signing multiple applications with the same certificate and using signature-based permission checks allow secure sharing of code and data between applications. For applications to share data or code, they must run in the same process and be signed with the same certificate. ————The above content is excerpted from: Why Android Apps Need Signing


2. How to Package and Sign in Android Studio:

Since learners of this course are beginners, we will cover multi-channel packaging later! This section only discusses the simplest method of packaging and signing. By the way, the APK generated during debugging mentioned in point 1 can be found in the directory: app/build/outputs/apk. This is different from Eclipse, which generates the APK in the bin directory.

Follow on WeChat

❮ Verilog Data Type Javascript Slideshow ❯