I am confused in sharedUserID.what is use of sharedUserId?How to use?Where to use in android?
Every app project must have an AndroidManifest. xml file (with precisely that name) at the root of the project source set. The manifest file describes essential information about your app to the Android build tools, the Android operating system, and Google Play.
By default, Android assigns each app its own unique user ID. However, if this attribute is set to the same value for two or more apps, they will all share the same ID — provided that their certificate sets are identical. Apps with the same user ID can access each other's data and, if desired, run in the same process.
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.
manifest is the root element of the AndroidManifest. xml file. It has package attribute that describes the package name of the activity class.
By default, Android assigns a user id to an application. It is the unique id for your application and means that nobody except the user with this id can reach your application's resources. You cannot access the data of an other application or run it in your current process. when, from an activity, an activity of another application is called android passes the control to the new activity called and they run in totally different processes.
However, in your manifest file, you can explicitly identify a user id for your application. When you declare the same user id for more than one application, they can reach each other's resources (data fields, views, etc.). You can display data from another application or run it in your process.
this is how you use it: from http://developer.android.com/guide/topics/manifest/manifest-element.html
<manifest xmlns:android="http://schemas.android.com/apk/res/android" package="string" android:sharedUserId="string" android:sharedUserLabel="string resource" android:versionCode="integer" android:versionName="string" android:installLocation=["auto" | "internalOnly" | "preferExternal"] > . . .</manifest>
SharedUserId is used to share the data,processes etc between two or more applications. It is defined in AndroidManifest.xml like,
<manifest xmlns:android="http://schemas.android.com/apk/res/android" android:sharedUserId="android.uid.shared" android:sharedUserLabel="@string/sharedUserLabel" ...>
and define the shared parameter in Android.mk for that app, like
LOCAL_CERTIFICATE := shared
Hope its helpful to you.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With