What is an APK?
An APK file ( Android Package Kit ) is the file format used by Android operating systems for distribution and installation of mobile applications. A file using this format can be built from source code written in either Java or Kotlin programming languages and can be generated and signed from Android App Bundles.
.apk files can be considered the equivalent of .exe files for Windows, .dmg files for MacOS or even .deb packages for Debian.
Security
Before attempting any kind of file installation on your device, a word of caution: most applications are managed and installed through the Google Play Store, the official Android store. Installing an .apk file is generally more dangerous than using the play store especially if the source of the file is unknown. Regardless, Android will perform a quick check to ensure that it is not a malware.
Starting from Android Oreo, instead of a single system wide security setting for enabling/disabling installation of app from unverified/unknown sources outside of Google Play Store, this setting is now implemented as a permission that can be granted to individual apps as a more granular way of controlling which application is allowed to install other apps.
Installing APK’s
As an example, let’s assume that we enabled the Allow from this source setting for Google Chrome. Now we can install APK’s we download from Google. The process is simple and straightforward.
We locate the downloaded .apk file in the Downloads folder of the Android device and open the file.
Alternatively, using an USB cable to connect our Android device to our PC, we can enable MTP/File Transfer mode and copy the downloaded APK to our phone. Then we open it.
Opening the .apk file will initiate the installation using Android’s built-in package installer. A prompt will be shown on the phone’s screen to confirm whether we really want to install the app or not.
The installation could take a few seconds to finish. Once it is completed, the app should be installed. We can now launch it from the app drawer.
Emulators
We know how to do it on a physical device, but what about emulators? Surprisingly, installing APK’s on emulated Android devices is even easier.
With the emulator open, we can just drag and drop the .apk file into the emulator and the file will be automatically installed into the Android device.
In conclusion, Google Play Store is still the quickest and safest way to install apps on your Android device. Its Play Protect system makes sure that all apps are free from malware even before you install them. So, you should only resort to manual installation if and when necessary, and it would also be a good idea to disable the installation of apps from unknown sources to further prevent any malicious installations.
Flaviu-Olimpiu Crișan
Android Developer