What is the name of my application in android?

I am writing an Android application.

It has several packages under src.

How can I determine which one is my application package?

I want to add C @DM permissions:

<permission android:name="YOUR_PACKAGE_NAME.permission.C2D_MESSAGE" android:protectionLevel="signature" />
<uses-permission android:name="YOUR_PACKAGE_NAME.permission.C2D_MESSAGE" />

how will my change YOUR_PACKAGE_NAMEif I create my own MyApplication extends Applicationclass?

+3
source share
1 answer

Your application name is actually defined in AndroidManifest.xml in its first lines. Example:

<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
    package="com.yourcompany.appname"
    android:versionCode="66"
    android:versionName="0.57" >

Pay attention to the package = "com.yourcompany.appname" - this is your package definition.

Other places containing the name of your package may be resources, class paths, packages, etc. But they should all be aligned according to the manifest, because this is what the package manager reads.

+12

All Articles