Easiest way to set Application icon and name in Android Studio?



Easiest way to set Application icon and name in android studio



You are the Android developer or just creating the Android app. You have completed the design and development.

Now, you want to add the icon for that Android app. How will you change it programmatically?

In this tutorial, we'll see how to set an Application icon in Android Studio.


    How to set an Application icon in Android Studio?

    Before getting started, make sure that the rest of the project files like Activity_main.xml and MainActivity.java files are correct. It has no errors.

    1. Follow this path - app > src > main > res > mipmap (there are so many mipmap folders you can choose any one according to your need and the size of the icon) under your Android project

    res path for mipmap icon

    2. Put the app icon in that mentioned resource folder

    3. Now, open the AndroidManifest.xml file and add the following code snippet to the file

    android:icon="@mipmap/Whats_on_my_plate_icon"
    android:roundIcon="@mipmap/Whats_on_my_plate_icon"

    4. Replace the Whats_on_my_plate_icon with your icon file name

    5. Save the AndroidManifest.xml file and run the project 

    This is how you can change the Android App icon programmatically on Android Studio.


    How to change an app name on Android Studio?

    You can edit the app name just like the app icon. You can change the app name using the strings.xml file.

    I. For the strings.xml file method, there we'll need to provide the app name to the variable and after that, you have to use that variable in the Manifest file.

    Open the strings.xml file using the path app > src > main. Put your app name within string tags

    <string name="app_name"></string>

    Ensure that android:label="@string/app_name" this code is added in your AndroidManifest.xml file

    II. You can directly provide the app name in the AndroidManifest.xml file also

    Open the AndroidManifest.xml file

    android:label="@string/app_name"

    Now remove the @string/app_name and add your app name directly here.

    After all the editing work, save the AndroidManifest.xml file and run the project. Your Android app default name will get updated.


    Android asset studio - Android app icon generator

    One of the best open-source Android app icon generator tools is Android Asset Studio (Icon generator).

    You can use this free tool to generate an Android launcher icon, Application icons, notification icons, etc.

    1. First of all, launch the Android asset studio

    Android asset studio
    Android Asset Studio

    2. Then, choose the Image, Text, or Clipart you want on your app icon

    3. Select the trim option and adjust the padding according to your need

    4. Now choose color, shape, and effects, and provide your desired app name

    5. After that, select the download button to save your App icon

    Still not satisfied, and want more options to customize your app icon? try this tool called, IconKitchen.

    It's a much better Android and iOS app icon designer tool than Android Asset Studio.


    How to change an Android app icon without Android Studio?

    For any reason, you want to change your Android app icon, and you don't have Android Studio installed on your machine. 

    Still, you can change and edit the app icon by using your Android project files.

    Just open the Android project folder using File Explorer and search for the AndroidManifest XML file.

    Open it and make the required changes that we previously explained.


    How to change the name of the project and package in Android Studio?

    Changing the package name is quite a hard and time-consuming process than changing the application name. 

    But, we've shared all the steps to rename and update the Package's name into the entire project.

    I. Open the Project section using the Gear icon (Gears icon) and Unmark the option Compact Empty Middle Packages

    Compact Empty Middle Packages

    II. Now, you can change your Package name individually

    III. Right-click on your Application folder and select Refactor > Rename

    Select refactor > rename on android studio package

    IV. After that, select the Rename Package button from the prompt box

    Rename package

    V. Then, Put your new package name and hit Refactor

    VI. At the bottom panel, you'll see the option Do refactorSelect that

    Do refactor - android studio

    VII. Now, you've to open the Build. Gradle the file from the package folder and update the package name here

    update the package name in build.gradle

    VIII. Click on the Sync Gradle link

    IX. After all of that, select Clean Project and Rebuild Project under the Build menu

    Clean and rebuild project

    That's all! You've successfully changed the name of the Package of your Android app in Android Studio.


    How to change the app icon for an Android app in React Native?

    Changing the name of the React native Android app and the normal Android app is a similar procedure. You just need to put the app icon image on this path - <Application-project-folder>\app\src\main\res.


    FIX: App icon not changing on the Android studio!

    There could be so many reasons behind the App icon isn't changing like provided wrong app icon path or the wrong variable used in the AndroidManifest.xml file. 

    Try to do the following when adding the app icon to your Android app project in Android Studio.

    • Keep the App icon in the Mipmap folders
    • Provide the correct path of the Application Icon
    • While adding the icon name in the AndroidManifest file, don't put file type extensions there like .png, .svg, etc.


    Conclusion

    From the above article, we've concluded that we can set the Android app icon and name using the AndroidManifest.xml file as explained in the article.

    If you want to design your own app icon, you can try Android Asset Studio and IconKitchen. Both the tools are just amazing and free to use!

    If you've any questions about this tutorial, please let us know through the comment section.


    No comments:

    Powered by Blogger.