What is the unique id of android application? Is it package name? Can there be two applications with the same packages names on one device?
There are 2 different things: the Java package and the Android Application package. The second one needs to be Unique.
There is a good article about it here
Yes, the package name is the unique identifier for an android application in the market.
No, there can't be two apps with the same package name in the market/on the device.
I'd like to add one little clarification that wasn't mentioned here.
Although there can't be two apps with the same package name, there can be several launcher activities within one app that user can see in launcher app. For example, standard "Maps" application ("com.google.android.apps.maps" package) has several launcher activities like "Local", "Navigation", "Maps". It doesn't matter for user if these "apps" (or activities, in developer terms) are implemented in one application package or not.
Activity name ("com.google.android.maps.MapsActivity") is not unique itself too, because anyone can create an app with unique package name and an activity located in java package com.google.android.maps called MapsActivity.
Thus, if you want to find unique identifier for all these launcher activities, you should use combination of both app package name ("com.google.android.apps.maps") and activity name ("com.google.android.maps.MapsActivity").
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