- Android Package Name Vs Application ID
- Creating multiple APKs for different purposes.
- How to Get App Package Name on Android [3 Methods]
- Method 1: Get Android App Package Name via Play Store URL
- On PC
- On Mobile
- Method 2: Get Android App Package Name via a Third-Party App
- Method 3: Get Android App Package Name via ADB Commands
- About Chief Editor
- Sadique Hassan
- Android Package Name vs Application ID
- Application Id
- How To Find Package Name Of An Android App
- Package Name Of An Android App
Android Package Name Vs Application ID
Creating multiple APKs for different purposes.
PackageName vs ApplicationId
Nowadays, many times we come to the situation that we need the APK with another different package name. Most of us do it easily, but sometimes we got stuck because of applicationId and packageName.We must know the difference between packageName and applicationId. And the other thing is Java package.
The following are the three which keeps us confusing:
- applicationId: BuildConfig.APPLICATION_ID
- packageName: getApplicationContext().getPackageName()
- Java package: BuildConfig.class.getPackage().toString()
Let’s see with an example
The following is the snippet from the gradle of a sample Android application.
Here we will be having two different APKs.
- Release APK with com.mindorks.example.release
- Debug APK with com.mindorks.example.debug
The following is the snippet from manifest of the same sample Android application.
The following is the project package snippet of the same sample Android application.
So, let’s create a debug APK and see what are the values of all the three.
Read the values carefully.
The following shows the final AndroidManifest file after APK creation.
getPackageName gives the same applicationId which is created at the final moment from the gradle file and it overrides the AndroidManifest package. So the final AndroidManifest contains the same applicationId. So, the getPackageName is the same as the applicationId as the applicationId overrides the packageName in the AndroidManifest at the final moment.
But for the Java code, the package is same as the project structure. The package that is used in your source code to refer to your R class, and to resolve any relative activity, service registrations, continues to be called the package as defined in your manifest. So, the AndroidManifest should have the package same as Java package to resolve relative activity, service.
So, with the same java package, we can create any number of APKs with all unique applicationId.
But the final AndroidManifest contains the package as the unique applicationId only.
If you have to actually change the structure of your project, then you have to change your packageName in Manifest.xml.
If you rename the package name from manifest file, it will have NO impact on the applicationId even if they have the same name.
We can also create multiple APKs through productFlavors like above.
Remember, once an app has been published to Google Play store, the ApplicationId should never be changed.
Источник
How to Get App Package Name on Android [3 Methods]
In this guide, we will share three different methods to get the package name of all the installed apps on your Android device. The apps installed on your device are labeled via two different methods. The first one is the general name that you usually come across such as Facebook, WhatsApp, etc. These are the name that the everyday users deals with and searches for on Play Store.
On the other hand, there’s an associated application ID or app package name, which acts as a unique identifier for each app. For example, Facebook has the package name com.facebook.katana and WhatsApp has com.whatsapp. These are the names used by backend people and developers alike. Furthermore, while you may come across many apps on the Play Store by the name of Facebook, but none could have the com.facebook.katana as their package.
So if you have ever any doubt regarding the app’s authenticity, then you may count on this factor. With that said, how could you get hold of the package name of all the installed apps on your Android device? Well, there are three different methods for the same, and in this guide, we will make you aware of all these three approaches. So without further ado, let’s get started.
Table of Contents
Method 1: Get Android App Package Name via Play Store URL
This method is extremely easy to execute. However, if you are looking to get the name of various installed apps in one go, then it would require quite a lot of manual effort. But for a few apps, this should be your go-to method. Here’s how to use it:
On PC
- First off, head over to the Play Store website on your PC.
- Now search for the desired app (as an example, let’s go with Facebook)
- Then head over to its search bar and check out its URL, it will be something along this line:
- As an example, in the case of Facebook, the URL will be
- Now the portion after be the app’s package name. So for Facebook, it turns out to be com.facebook.katana.
So this was the first method to get the app package name via Play Store and PC. Let’s see how to try out this Play Store trick on your phone.
On Mobile
- Open the Play Store app on your device and search for the desired app (let’s say WhatsApp).
- Under the app listing’s page, tap on the overflow icon situated at the top right and select Share.
- Now just share/save this URL anywhere you wish. The URL will be of the same format as mentioned above, i.e.
- As an example, in the case of WhatsApp, the URL turns out to be
- As before the app package name will be the portion after So for WhatsApp, it turns out to be com.whatsapp.
The other method involves opening the Play Store website on your smartphone browser, changing its view to Desktop Mode, and then getting hold of the URL. With that, we round off this first method to get the package name of all the installed apps on your Android device. Let’s now turn our attention towards the other two methods.
Method 2: Get Android App Package Name via a Third-Party App
The benefit of this method is the fact that you require minimal effort. Furthermore, it is able to display both the user installed as well as system apps. The UI is also user-friendly. However, I have never been in favor of using third-party apps and giving them access to my device, unless it is of paramount importance. With that said, if you wish to try it out, then follow the below instructions:
- To begin with, download the App Package Viewer 2.0 from Play Store.
- Then launch it and select the desired app from the list.
- Now tap on that app’s name and you should get its associated package name.
That’s it. This is perhaps the easiest method to get the package name of all the installed apps on your Android device. Now let’s check out the third and final method to carry out this task.
Method 3: Get Android App Package Name via ADB Commands
The benefit of this method is the fact that apart from getting the app’s package name, you could even remove the user-installed and system-installed apps on your device via these ADB Commands. Without Root! On the flip side, this method requires a few prerequisites and some level of technicalities as well. But if you are ready to challenge your inner-geek, then this method is tailored made for you. Follow along.
- To begin with, download and install the Android SDK Platform Tools on your PC. These are the official ABD binary files provided by Google.
- Extract its content to any convenient location on your PC and you should get the platform-tools folder.
- Now head over to your Android device and enable USB Debugging. This will make your device recognizable by your PC in ADB mode. So head over to Settings > About Phone > Tap on Build Number 7 times > Go back to Settings > System > Developer Options > Enable USB Debugging.
- When that is done, connect your device to the PC via USB cable. Make sure USB Debugging is enabled.
- Then head over to the platform-tools folder, type in CMD in the address bar, and hit Enter. This will launch the Command Prompt.
- Now type in the below command in the CMD window and hit Enter:
Then type in the below command and you should get a list of all the installed apps:
List of Apps on my OnePlus 7T. View Full-Size Image
That’s it. With this, we conclude the guide on how to get the package name of all the installed apps on your Android device. We have shared three different methods for the same, do let us know in the comments which one you ultimately settled for.
About Chief Editor
Sadique Hassan
A technical geek by birth, he always has a keen interest in the Android platform right since the birth of the HTC Dream. The open-source environment always seems to intrigue him with the plethora of options available at his fingertips. “MBA by profession, blogger by choice!”
Источник
Android Package Name vs Application ID
As an Android Developer, you should know that the Package Name that you choose for your app is very important. We are referring to the Package Name of the application which we declare in the Manifest.xml rather than the Java package name (although they will be identical). But there is a difference between the Package Name and the Application ID. In this article, we’ll look at the difference between the two.
Application Id
Every Android app has a unique application ID that looks like a Java package name, such as com.example.myapplication. This ID uniquely identifies your app in Google Play Store. If you want to upload a new version of your app, the application ID (and the certificate you sign it with) must be the same as the original APK—if you change the application ID, Google Play Store treats the APK as a completely different app. Your application ID is defined with the applicationId property in your module’s build.gradle file, as shown below:
The applicationId exactly matches the Java-style package name you chose during project setup in android studio. However, the application ID and package name are independent of each other beyond this point. You can change your code’s package name (your code namespace) and it will not affect the application ID, and vice versa (though, again, you should not change your application ID once you publish your app). However, changing the package name has other consequences you should be aware of, so see the section about how to change the package name.
Источник
How To Find Package Name Of An Android App
Last updated on 04/12/2017 by Pradeep Kumar ( Twitter) | Short URL: https://device.is/2Bw4Yvu
This is a very simple tip to find the package name of an Android app. This tip will be useful for you when you download APK files from Google Play Store. Some online tools require you to provide package name for the Android app you are going to download, so we decided to write this tip here. When I first heard the word “package name” I thought this will be technical, but honestly it is no where near to that.
Package Name Of An Android App
Go to Google Play Store, search and open your desired Android app. Now see the link in the address bar. I decided to open the link of “Subway Surfers” app. It’ll look like this:
Here the Package name of “Subway Surfers” Android app is com.kiloo.subwaysurf
https://play.google.com/store/apps/details?id=com.kiloo.subwaysurf
Similarly you can check this with other popular Android apps, we tried it once again with “WhatsApp” app. See the screenshot below.
Almost all the Android application package names will begin with “com”, heard it is used to avoid name-collisions between applications. After finding the package name for your desired app, you can easily download its APK file from Google Play Store.
Having any queries regarding this? Facing any trouble? Do you have any other easy method? Feel free to share them in the comments below.
Источник