How to get username using uid on Android
问题 I got several uids like this: 10022, 10011, 1000 Actually I know the usernames of them are u0_a22 , u0_a11 , system . But the question is how can I get the username using codes? There is no /etc/passwd file at all.. 回答1: I wrote a utility class to get the UID/GID name by hardcoding values from android_filesystem_config.h. Usage: String uid = AndroidFilesystemConfig.getNameForId(1000); AndroidFilesystemConfig.java import android.os.Build; import android.util.SparseArray; import java.util