Skip to content Skip to sidebar Skip to footer

Change Default Package From Com.example For Eclipse Android Projects

I am using Eclipse 4.2 with Android SDK. I am wondering if it is possible to change the default package ID com.example that shows in the 'New Android Application' wizard as you typ

Solution 1:

No, you cannot change the default; it's hardcoded in the plugin sources.

(For the curious, it's in com.android.ide.eclipse.adt.internal.wizards.templates.NewProjectPage#SAMPLE_PACKAGE_PREFIX in the ADT code base). We should consider persisting the most recently set package prefix and inserting the parent package next time. Feel free to file an issue for that at http://b.android.com category Component-Tools.

-- Tor

Solution 2:

With Android Studio not running, edit the file: C:\Users\MyAccount\.AndroidStudio\config\options\options.xml (replace C: with the installation drive and MyAccount with your account name).

Within the xml file look for "property name="SAVED_COMPANY_DOMAIN" value=" and change the value to what you want.

Solution 3:

Following user2232952's guidance, for new versions of Android Studio change the value of:

<propertyname="SAVED_ANDROID_PACKAGE" value = "com.example" />

Solution 4:

For anyone coming here in 2020, the file you are looking for is other.xml It can be found in your AndroidStudio library under config/options/other.xml (For mac this is probably ~/Library/Application Support/Google/AndroidStudio4.1/options)

Then you can follow the instructions by @Murillo Comino

<property name = "SAVED_ANDROID_PACKAGE" value = "com.example" />

Solution 5:

If you've already created your project, you could go to your AndroidManifest.xml file and update the attribute in the Manifest (root) tag

<manifest xmlns:android="http://schemas.android.com/apk/res/android"package="your.package.name"
    android:versionCode="1"
    android:versionName="1.0" >

Just make sure the rest of your code also reflects this change.

Post a Comment for "Change Default Package From Com.example For Eclipse Android Projects"