Android fundamentals

Android app contain source, resource like layouts, drawable contents, menu, String, icons, and build setting to compile and run the android application. Android app are written in java.

Android sdk tool compile your source, along with any data and resource file to an archive file with .apk extension called android package. An apk contains all the necessary files of your app that is required to install the apk on Android powered devices.


Android security sandbox

Once an apk installed on a device, each android app lives in its own security sandbox:

  • The Android operating system is a multi-user Linux system in which each app is a different user.
  • By default, the system assigns each app a unique Linux user ID (the ID is used only by the system and is unknown to the app). The system sets permissions for all the files in an app so that only the user ID assigned to that app can access them.
  • Each process has its own virtual machine (VM), so an app's code runs in isolation from other apps.
  • By default, every app runs in its own Linux process. Android starts the process when any of the app's components need to be executed, then shuts down the process when it's no longer needed or when the system must recover memory for other apps.
In this way, the Android system implements the principle of least privilege. That is, each app, by default, has access only to the components that it requires to do its work and no more. This creates a very secure environment in which an app cannot access parts of the system for which it is not given permission.


Data/File sharing between android apps

There are 2 ways to share data/file of one application with other:

  • It's possible to arrange for two apps to share the same Linux user ID, in which case they are able to access each other's files
  • An app can request permission to access device data such as the user's contacts, SMS messages, the mountable storage (SD card), camera, Bluetooth, and more. The user has to explicitly grant these permissions.


Share & Like

Tutorial topics

About ApnaTutorials.com

ApnaTutorials.com is for Java, J2ee, Html5 and android developers. All tutorials are well explained and are easy to understand. We have tested every tutorials on our developement environment before posting it in public domain.