Jump to content

[TOPIC: topicViewTemplate]
[GLOBAL: userSmallPhoto]
Photo

[Resolved] How To Change The Android App's Display Name Without Creating A New Project?
Started by Naomi Apr 13 2013 05:36 PM

15 replies to this topic
android display name
[TOPIC CONTROLS]
This topic has been archived. This means that you cannot reply to this topic.
[/TOPIC CONTROLS]
[modOptionsDropdown]
[/modOptionsDropdown]
[reputationFilter]
[TOPIC: post.html]
#1

Naomi

[GLOBAL: userInfoPane.html]
Naomi
  • Corona Geek

  • 2,303 posts
  • Enterprise

I'd like to know if I can change the Android App's display name without creating a new project, much the same way I can with iOS version via CFBundleDisplayName.  I specifically need this for Kindle version right now (and probably for Nook version too.)

 

I searched and I found this thread:

 

http://stackoverflow.com/questions/5443304/how-to-change-an-android-apps-name

 

But I'm not sure how it may apply to Corona SDK.  Can we set android:label in build.settings or somewhere else?  If so, how do we do this?

 

Does anyone know?

 

Naomi

 

RESOLVED:  Duh, it's simple.  Just change the Application Name at the time of generating a build.



[TOPIC: post.html]
#2

jmaher

[GLOBAL: userInfoPane.html]
jmaher
  • Enthusiast

  • 55 posts
  • Corona SDK

I'd like to see the Android manifest "name" or "label" options added to build.settings. My game's name includes several special characters (apostrophe and exclamation mark) that can cause problems if included in the apk name at build time.

 

Any chance this is an easy change we could see soon?



[TOPIC: post.html]
#3

Joshua Quick

[GLOBAL: userInfoPane.html]
Joshua Quick
  • Moderator

  • 3,397 posts
  • Corona Staff

jmaher,

 

As Naomi has noted up above, you can set the app name in the Android build dialog.  That's the top most text field in that window.  It also supports all printable characters, which includes symbols and unicode characters (ie: Chinese, Japanese, Russian, Greek, etc.).  Characters that are not supported by the "file system" will be turned into dashes and underscores, but the app name you originally gave it will be preserved and viewable on Android's apps screen.  Give it a try.  It works.



[TOPIC: post.html]
#4

jmaher

[GLOBAL: userInfoPane.html]
jmaher
  • Enthusiast

  • 55 posts
  • Corona SDK

The exclamation mark is not converted. I have found that this causes ADB copying to fail. Not sure if there are other consequences...

 

What happens if I manually rename the apk file after it is generated? It doesn't seem to affect debug testing, but in a production release, would this potentially cause the app to be rejected?



[TOPIC: post.html]
#5

Joshua Quick

[GLOBAL: userInfoPane.html]
Joshua Quick
  • Moderator

  • 3,397 posts
  • Corona Staff

Oh I see.  That's just an issue with the file system.  Go ahead and rename the APK without the symbols and install it to your Android device.  Android doesn't care what the file name of the APK is.  Android only cares about the uniqueness of the package name embedded within the APK's AndroidManifest.xml file.  The app's label will be the name you gave it in the Android build dialog.



[TOPIC: post.html]
#6

greg886

[GLOBAL: userInfoPane.html]
greg886
  • Contributor

  • 909 posts
  • Corona SDK

[TOPIC: post.html]
#7

Alan PlantPot

[GLOBAL: userInfoPane.html]
Alan PlantPot
  • Contributor

  • 878 posts
  • Corona SDK

I've noticed that if I build an apk with the Application Name "My Great Game" and then install it locally, I cannot overwrite the application on my device if I rebuild the same project with the same keystore/build.settings but a different Application Name (for example to "My Great Game Lite").  

 

Would the same apply if I was to change the app name and then upload it to Google Play? Is it impossible to change the app's name after submitting?



[TOPIC: post.html]
#8

Joshua Quick

[GLOBAL: userInfoPane.html]
Joshua Quick
  • Moderator

  • 3,397 posts
  • Corona Staff

Just change the APK file name to something the Android device will accept, because it's the Android SDK tools or the device that's being picky about the file name's characters.  The application name doesn't have to match the APK's file name.

 

If you're doing a Corona Simulator build, I'm pretty sure spaces and other special characters that Android devices don't typically accept get replaced by underscores.  At least with the Windows version of the Corona Simulator.  For native Android SDK builds (I noticed that you have an Enterprise subscription), then it's up to you to handle this yourself.



[TOPIC: post.html]
#9

Alan PlantPot

[GLOBAL: userInfoPane.html]
Alan PlantPot
  • Contributor

  • 878 posts
  • Corona SDK

This project is actually being built with the simulator, just for the record.

 

What's odd is that if I do a fresh install of the apk with the new file name, then it installs fine.  

I only have a problem if I try to overwrite an existing app which has the same package name/build.settings etc but different Application Name  that I get the "application not installed" message.

 

I'll test it out shortly, to see if changing the apk file name itself after building solves it.



[TOPIC: post.html]
#10

Joshua Quick

[GLOBAL: userInfoPane.html]
Joshua Quick
  • Moderator

  • 3,397 posts
  • Corona Staff

This doesn't sound like an APK file name issue.  If you're using Google's "adb" command line tool to install your APK, then you need to give it a command line switch "-r" telling the tool to overwrite the APK.  For example:

 

adb install -r <PathToApkFile>



[TOPIC: post.html]
#11

Alan PlantPot

[GLOBAL: userInfoPane.html]
Alan PlantPot
  • Contributor

  • 878 posts
  • Corona SDK

Didn't work I'm afraid. Just to be clear, here is what I've tested out. 

 

1. Build an apk with name: "My Great Game"

2. Attempt to install on device using "adb install filename.apk".

3. Game installs and opens correctly.

4. Rebuild apk with name: "My Great Game 2"

5. Attempt to reinstall on device using "adb install -r filename.apk".

6. Installation fails.

 

Then just to be sure build 2 didn't have any inherent problems of it's own:

7. Uninstall build1. 

8. Attempt to install build2 again on device using adb.

9. Installation successful.

 

This certainly isn't a new phenomenon, I've seen it before but didn't think much of it at the time. However I'd quite like to update an app with a slightly different app name, so it would be handy if this could be done.



[TOPIC: post.html]
#12

Joshua Quick

[GLOBAL: userInfoPane.html]
Joshua Quick
  • Moderator

  • 3,397 posts
  • Corona Staff

Wait.  You changed the APK's file name on the 2nd install, but chose the same package name?  That's going to cause problems.  If you used the same app name and package name, then overwrite, it should be fine.



[TOPIC: post.html]
#13

Alan PlantPot

[GLOBAL: userInfoPane.html]
Alan PlantPot
  • Contributor

  • 878 posts
  • Corona SDK

Ok, but if I want to update an existing app to have a slightly different name, then I would have to use the same package name.

 

I've found out how to fix the problem though. As I was just testing this out, I didn't change the version code or version name between the 2 builds. If I increase those, then I can overwrite the old app with a new apk which has a different name.



[TOPIC: post.html]
#14

Joshua Quick

[GLOBAL: userInfoPane.html]
Joshua Quick
  • Moderator

  • 3,397 posts
  • Corona Staff

Right.  It's okay to change the app's display name.  Just change the APK file name to be the same as before when overwriting it.

 

Regarding the app store, I'm not sure how they handle it, but they may actually rename the APK you upload on their end to avoid issues like this.  You'll just have to test it and find out.  But really, you're just dealing with the nuances of the Android OS and app store.  Just do what it takes to make them happy.



[TOPIC: post.html]
#15

ameera.nabila

[GLOBAL: userInfoPane.html]
ameera.nabila
  • Observer

  • 1 posts
  • Corona SDK

excuse my . can I now how to change 'game tittle' in corona ?



[TOPIC: post.html]
#16

Joshua Quick

[GLOBAL: userInfoPane.html]
Joshua Quick
  • Moderator

  • 3,397 posts
  • Corona Staff

You set the title of your application in the Corona Simulator's "Build" window via the "Application Name" field.  That sets both the title and the app bundle file's name.




[topic_controls]
[/topic_controls]