Security and permissions
satya - Sunday, May 16, 2010 11:00:30 PM
vision
The permissions required by an application are declared statically in that application, so they can be known up-front at install time and will not change after that.
satya - Monday, May 17, 2010 9:40:23 PM
android package (.apk) and its linux userid
Each Android package (.apk) file installed on the device is given its own unique Linux user ID, creating a sandbox for it and preventing it from touching other applications (or other applications from touching it). This user ID is assigned to it when the application is installed on the device, and remains constant for the duration of its life on that device.
satya - Monday, May 17, 2010 10:59:35 PM
Data that your package creates
Any data stored by an application will be assigned that application's user ID, and not normally accessible to other packages. When creating a new file with getSharedPreferences(String, int), openFileOutput(String, int), or openOrCreateDatabase(String, int, SQLiteDatabase.CursorFactory), you can use the MODE_WORLD_READABLE and/or MODE_WORLD_WRITEABLE flags to allow any other package to read/write the file. When setting these flags, the file is still owned by your application, but its global read and/or write permissions have been set appropriately so any other application can see it.
satya - Monday, May 17, 2010 11:04:39 PM
example of asking for a permission
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.android.app.myapp" >
<uses-permission android:name="android.permission.RECEIVE_SMS" />
</manifest>
satya - Tuesday, May 18, 2010 3:54:00 PM
android apk file and linux userid
android apk file and linux userid
Search Google for: android apk file and linux userid
Search Android Developers Group for: android apk file and linux userid
Search Android Beginers Group for: android apk file and linux userid
Search Google Code for: android apk file and linux userid
Search Android Issues Database for: android apk file and linux userid
satya - Wednesday, May 19, 2010 5:50:45 PM
application/process tag
...from google docs
The name of a process where all components of the application should run. Each component can override this default by setting its own process attribute. By default, Android creates a process for an application when the first of its components needs to run. All components then run in that process. The name of the default process matches the package name set by the <manifest> element.
By setting this attribute to a process name that's shared with another application, you can arrange for components of both applications to run in the same process ? but only if the two applications also share a user ID and be signed with the same certificate.
If the name assigned to this attribute begins with a colon (':'), a new process, private to the application, is created when it's needed. If the process name begins with a lowercase character, a global process of that name is created. A global process can be shared with other applications, reducing resource usage
satya - Wednesday, May 19, 2010 6:05:47 PM
read this thread for understanding application object model
satya - Wednesday, May 19, 2010 6:18:38 PM
High lights from the above discussion
All code in your apk file run in a process by itself whose PID is the package name. It also gets its own linux user id (unless shared)
Being a single process, all code shares static variables as well
You can take a component however and use the process attribute to place it in a different process. (Not fully sure which globals it uses, and if it loads the whole apk file in the other process)
There is one main thread that handles the process. Content providers may satisfy requests on their own threads (I think I am not too sure) and services may be bound through their own threads...(to be verified)
satya - Wednesday, May 19, 2010 6:19:05 PM
Read the life cycle document again
satya - Wednesday, May 19, 2010 6:36:51 PM
Summarizing service
Basically there are two things that control the lifecycle of a service: (1) clients bound to it, and (2) whether it has been started. Both of those will keep it running. Any started service will raise the importance of its process to a sufficient level that the process will remain running as long as the system isn't getting close to a paging state. In addition, clients bound to it will raise it further if their own process is at a higher level.
satya - Wednesday, May 19, 2010 6:37:37 PM
android local service binding example
android local service binding example
satya - Wednesday, May 19, 2010 6:39:01 PM
android service submitting batch jobs via intents
android service submitting batch jobs via intents
Search for: android service submitting batch jobs via intents
satya - Saturday, March 05, 2011 11:19:24 AM
what does it mean for an android component to declare permission?
what does it mean for an android component to declare permission?
Search for: what does it mean for an android component to declare permission?