Mark James
Mark James

Reputation: 481

Android Studio Renaming the Project

When starting off on this project I did not think much about the name. Now I would like to call it something different, could someone point me in the right direction.

Upvotes: 0

Views: 174

Answers (2)

Zoe - Save the data dump
Zoe - Save the data dump

Reputation: 28298

As mentioned here the Android Manifest links to a variable in sstrings.xml called app_name.

You should edit the app_name variable and not replace it in the manifest as you can then use the app_name elsewhere in your app and not have to replace it everywhere.

As such, your strings.xml should look something like this(looking aside from other added variables):

<resources>
    <string name="app_name">Name here</string>
    [other values]
</resources>

Simply edit app_name to whatever you want to call your app, and reinstall the app. you will now see the new name in place.

Note: Editing app_name instead of the android:label-line in the manifest also updates every reference you may have used it on. The name in a title referenced/linked to the strings.xml file-variable app_name will also update when you edit it. Changing the line in the manifest and hard-coding it does also work, all though it is better to change the strings.xml-variable

Second note:

This will not change your package name or your project name as displayed in Android Studio. These can be changed as well, but it has no effect as to what the device displays. Even though Android Studio shows that it is editing the project "RandomProjectName", the app's name as displayed can be "NameRandomProject". They are not linked together.

Upvotes: 1

Swapnil
Swapnil

Reputation: 79

It's very easy, go to AndroidManifest.xml and change the android:label value. See below,

 <application
    android:name=".Application"
    android:allowBackup="true"
    android:icon="@mipmap/ic_launcher"
    **android:label="@string/app_name"**
    android:supportsRtl="true"
    android:theme="@style/AppTheme">

Upvotes: 0

Related Questions