Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Unique ID of Android app

Tags:

android

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?

like image 774
Alex Avatar asked May 10 '11 14:05

Alex


3 Answers

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

like image 140
Nanne Avatar answered Oct 11 '22 05:10

Nanne


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.

like image 42
WarrenFaith Avatar answered Oct 11 '22 03:10

WarrenFaith


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").

like image 21
Andrei Buneyeu Avatar answered Oct 11 '22 04:10

Andrei Buneyeu