Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7696937
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T21:53:47+00:00 2026-05-31T21:53:47+00:00

The documentation ( http://developer.android.com/guide/topics/manifest/manifest-element.html#uid ) only states I can’t use raw strings and the

  • 0

The documentation (http://developer.android.com/guide/topics/manifest/manifest-element.html#uid) only states I can’t use raw strings and the API level it was added, but doesn’t explain why I would want to use it.
If I already set android:sharedUserID to “com.foo.bar” what value should I put in the string referenced by android:sharedUserLabel, and most importantly why!?

Thank you

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-31T21:53:48+00:00Added an answer on May 31, 2026 at 9:53 pm

    As far as I understand from the AOSP actually you can use this label just to display a pretty name to a user (if you have several processes in the same uid). For instance, here is a part of code in the RunningState.java file:

        // If we couldn't get information about the overall
        // process, try to find something about the uid.
        String[] pkgs = pm.getPackagesForUid(mUid);
    
        // If there is one package with this uid, that is what we want.
        if (pkgs.length == 1) {
            try {
                ApplicationInfo ai = pm.getApplicationInfo(pkgs[0], 0);
                mDisplayLabel = ai.loadLabel(pm);
                mLabel = mDisplayLabel.toString();
                mPackageInfo = ai;
                return;
            } catch (PackageManager.NameNotFoundException e) {
            }
        }
    
        // If there are multiple, see if one gives us the official name
        // for this uid.
        for (String name : pkgs) {
            try {
                PackageInfo pi = pm.getPackageInfo(name, 0);
                if (pi.sharedUserLabel != 0) {
                    CharSequence nm = pm.getText(name,
                            pi.sharedUserLabel, pi.applicationInfo);
                    if (nm != null) {
                        mDisplayLabel = nm;
                        mLabel = nm.toString();
                        mPackageInfo = pi.applicationInfo;
                        return;
                    }
                }
            } catch (PackageManager.NameNotFoundException e) {
            }
        }
    

    Basically, it does the following things. At first, it tries to get information about the overall process. If it has not find, it tries to get information using UID of the application as a parameter (this is a part of code that I’ve given here). If there is only one package with this UID the information about the process is got from this package. But if there are several packages (using shareUserId) then it iterates and tries to find official (pretty) name.

    As a confirmation to my words I found the following string in MediaProvider:

    <!-- Label to show to user for all apps using this UID. -->
    <string name="uid_label">Media</string>
    

    Thus, all process that uses android:sharedUserId="android.media" will have name Media.

    I do not think that this feature will be used a lot by ordinary developers and is useful for them.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

The documentation at http://developer.android.com/reference/android/database/sqlite/SQLiteOpenHelper.html#getWritableDatabase%28%29 states: Database upgrade may take a long time, you should
I refer to the documentation at http://developer.android.com/guide/practices/ui_guidelines/icon_design.html#icon-sets Hence, I plan to have the following
I am following the android licensing documentation ( http://developer.android.com/guide/publishing/licensing.html ) and when i get
The Activity Lifecycle is giving me headaches. The documentation at http://developer.android.com/reference/android/app/Activity.html is so darn
I was looking at this page: http://developer.android.com/guide/basics/what-is-android.html The section about Applicatiosn says that android
The documentation shows the orientation of the Axes: http://developer.android.com/reference/android/hardware/SensorEvent.html But it doesn't specify where
I was reading this documentation page, http://developer.android.com/reference/android/util/Log.html . The section here caught my eye:
I'm trying to get the maps api tutorial in the documentation ( http://developer.android.com/resources/tutorials/views/hello-mapview.html )
http://developer.apple.com/mac/library/documentation/DeveloperTools/gcc-4.0.1/gcc/Thread_002dLocal.html Documents __thread yet my g++ complains that __thread is not supported on my
http://developer.apple.com/library/mac/#documentation/Foundation/Reference/NSURLConnectionDelegate_Protocol/Reference/Reference.html#//apple_ref/occ/intf/NSURLConnectionDelegate Just wondering why this protocol reference doesn't include information on methods like didReceiveData,

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.