What is UID on Android?
Asked Answered
L

3

29

What is UID on Android?

Is it ID of a particular user or of a particular application?

Lezlielg answered 18/4, 2011 at 21:7 Comment(1)
You might want to clarify your question a bit. What code are you confused about?Roughneck
S
35

If you're referring to this UID: Android is based on Linux, so basically it's the same UID you have on a Unix-like OS. When installing an app / package, Android by default[1] creates a UID specifically for that package, so that it can have its private resources / storage space. When no packages are using that UID any more (which could be shared), the UID is deleted.

1. You can override this behavior with android:sharedUserId, but it has some drawbacks.

Shirl answered 18/4, 2011 at 21:46 Comment(0)
R
5

This ID is particular to the application

Android assigns a unique user ID (UID) to each Android application and runs it in its own process. Android uses this UID to set up a kernel-level Application Sandbox.

Refer to this doc https://source.android.com/security/app-sandbox

Rajasthani answered 20/3, 2019 at 0:14 Comment(0)
B
1

In Android, UID is actually called AID, which is used to identify the owner of a process and the owner of a resource. Binding those two together, it becomes the backbone of Android application sandboxing mechanism.

A full and detailed description of how it works and what does it means for application need a long article, which you can find it here.

Bolzano answered 11/9, 2016 at 9:16 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.