Announcement

Collapse
No announcement yet.

How do I set the name of the application in Android?

Collapse
X
  • Filter
  • Time
  • Show
Clear All
new posts

    How do I set the name of the application in Android?

    When I created the original project, I gave it the name "DorkyTest."
    Now, when I build it for Android, the icon in the app manager is called DorkyTest.
    This is not a great name.

    I have edited all the project settings in the main page, deployment page, maps page, as well as Android pages to refer to the game as "Cool Game" instead, but that name doesn't punch through to the installed icon on the Android device.

    There are still a lot of names that reference the DorkyTest name, and it's not clear to me which of these matter versus not.
    The main project file is called DorkyTest.uproject, but there's a lot of other files and references to that name.
    For example, there's a "main module" which is called DorkyTest, and the Visual C++ project for my C++ code builds DLL files and intermediate build directories called DorkyTest.
    Also, in the DefaultEngine.ini file, there are a number of mentions of DorkyTest, including some +ActiveGameNameRedirects which I can't find a good reference for what their role is.
    For example, look at this description: https://docs.unrealengine.com/latest...cts/index.html

    The Windows packaged application is also called DorkyTest rather than Cool Game.

    How do the Android build scripts decide to name the output application, and how can I safely change that to "Cool Game?"
    And what are the other "name" fields used for in the project settings dialog?
    Last edited by jwatte; 04-18-2015, 01:35 AM.

    #2
    So, I dove in, and it appears as if the name of the uproject file sets the name of the output binary.
    So, I can rename the project file, and that renames the output binary file name.
    However, I also need to re-generate visual studio projects and a few other things. And the instructions for re-generating these only document an explorer context-menu-based option -- I can't find a convenient BAT file or DotNet tool that does this for me from the command line.

    I'm somewhat surprised that:
    1) The fields for "game name" in the project settings don't actually set the name of the game executable
    2) The behavior of the project -> executable name link is not documented anywhere (which means I don't know -- can I name a project file with spaces in the name? would something break? What are the naming rules for uproject files, anyway? What else may depend on the uproject file name?)

    The reason I'm a bit miffed about this is that, not only does the main source of information seem to be "experience, and read the code," but the feeling I get is that nobody actually knows how it's supposed to be -- everybody's just working off of assumptions and cargo cult, rather than the system being well defined and easily verifiable.
    Last edited by jwatte; 04-18-2015, 06:20 PM.

    Comment


      #3
      I would love an easy way to change the project name as well. It is actually very easy if you're using the binary released engine - in the launcher right mouse click on the project and select Clone and you can select any name you want (the allowed naming scheme is the same as the allowed naming when creating a new project in UE4).

      However when using a compiled engine source there is no clone option so this easy method cannot be used it seems My latest project is only running in the source so I'm not sure how to rename it!
      Headgear - VR/AR solutions

      Mobile VR Game: We Come In Peace... Oculus GearVR | Google Play Daydream | Pico Goblin

      Comment


        #4
        Apparently, for android, you can override the "app_name" property in your own android manifest XML file in the build directory (there's another recent thread with this info.)
        That doesn't help for Windows, but it's great for the Android case!

        Comment


          #5
          There is one easy way to change the displayed app name. Create a Build\Android\res\values folder in your project's folder and create a strings.xml file there containing this:

          Code:
          <?xml version="1.0" encoding="utf-8"?>
          <resources>
              <string name="app_name">MyAppName</string>
          </resources>
          replacing MyAppName with the name you want to use. It doesn't get written over on packaging so this will be used instead of the project name.

          I'm looking into a better way to do this from inside the editor but this should work for now.

          Comment


            #6
            Auto-creating this file based on the "Project Name" field would be good enough for me :-)

            Comment


              #7
              Hmm. Android settings don't get notified when the project name field is changed.
              Although generating this file each time you package might be safer anyway.
              Sooo much code to grope through...

              Comment


                #8
                Originally posted by Chris Babcock View Post
                There is one easy way to change the displayed app name. Create a Build\Android\res\values folder in your project's folder and create a strings.xml file there containing this:

                Code:
                <?xml version="1.0" encoding="utf-8"?>
                <resources>
                    <string name="app_name">MyAppName</string>
                </resources>
                replacing MyAppName with the name you want to use. It doesn't get written over on packaging so this will be used instead of the project name.

                I'm looking into a better way to do this from inside the editor but this should work for now.
                Confirmed working - thanks for this temporary workaround
                Headgear - VR/AR solutions

                Mobile VR Game: We Come In Peace... Oculus GearVR | Google Play Daydream | Pico Goblin

                Comment


                  #9
                  This is no longer necessary and will cause problems if you use it in 4.8 and up. The Android section in Project Settings now has an "Application Display Name" textbox. This will fill in the "app_name" in the generated strings.xml for you, or use the project name if left empty.

                  Comment

                  Working...
                  X