APK (file format)
Encyclopedia
Android application package file (APK) is the file format
File format
A file format is a particular way that information is encoded for storage in a computer file.Since a disk drive, or indeed any computer storage, can store only bits, the computer must have some way of converting information to 0s and 1s and vice-versa. There are different kinds of formats for...

 used to distribute and install application software
Application software
Application software, also known as an application or an "app", is computer software designed to help the user to perform specific tasks. Examples include enterprise software, accounting software, office suites, graphics software and media players. Many application programs deal principally with...

 and middleware
Middleware
Middleware is computer software that connects software components or people and their applications. The software consists of a set of services that allows multiple processes running on one or more machines to interact...

 onto the Google's Android operating system. To make an APK file, a program for Android is first compiled, and then all of its parts are packaged into one file. This holds all of that program's code such as (.dex files), resources, assets, certificates, and manifest file. As is the case with many file formats, APK files can have any name needed, but must end with the four character, three letter extension, .apk.

APK files are a variant of the JAR file format, with a .apk file extension, and the MIME type associated with APK files is application/vnd.android.package-archive.

Contents

An APK file is an archive that usually contains the following folders:
  • META-INF directory:
    • MANIFEST.MF: the Manifest file
      Manifest file
      On the Java platform, a Manifest file is a specific file contained within a JAR archive. It is used to define extension and package-related data. It is a metadata file that contains name-value pairs organized in different sections. If a JAR file is intended to be used as an executable file, the...

    • CERT.RSA: The certificate of the application.
    • CERT.SF: The list of resources and SHA-1 digest; for example:


Signature-Version: 1.0
Created-By: 1.0 (Android)
SHA1-Digest-Manifest: wxqnEAI0UA5nO5QJ8CGMwjkGGWE=
...
Name: res/layout/exchange_component_back_bottom.xml
SHA1-Digest: eACjMjESj7Zkf0cBFTZ0nqWrt7w=
...
Name: res/drawable-hdpi/icon.png
SHA1-Digest: DGEqylP8W0n0iV/ZzBx3MW0WGCA=
  • res: the directory containing the resources used by the APK
  • AndroidManifest.xml: An additional Android manifest file, describing the name, version, access rights, referenced library files for the application. This file may be in Android binary XML
    Binary XML
    Binary XML refers to any specification which defines the compact representation of XML in a binary format. While there are several competing formats, none has been widely adopted by a standards organization or accepted as a de facto standard...

     that can be converted into human-readable plaintext XML with tools such as AXMLPrinter2 or apktool.
  • classes.dex: The classes compiled in the dex format understandable by the Dalvik virtual machine
    Dalvik virtual machine
    Dalvik is the process virtual machine in Google's Android operating system. It is the software that runs the apps on Android phones. Dalvik is thus an integral part of Android, which is typically used on mobile devices such as mobile phones, tablet computers and netbooks. Programs are commonly...

  • resources.arsc
The source of this article is wikipedia, the free encyclopedia.  The text of this article is licensed under the GFDL.
 
x
OK