Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to change application name in NativeScript

I'm working with NativeScript from Telerik and I made an app with a debug name ("notiApp") but now I can't change the app's name in launcher and action bar.

I already tried configuring my AndroidManifest.xml in /app/App_Resources/Android/ modifying the android:label attribute of my <application> tag.

<?xml version="1.0" encoding="utf-8"?>
<manifest>
    <application
        android:label="DESIRED NAME">
    </application>
</manifest>

Also, I tried changing my project's root directory name for the new app desired name.

There's anything else I can do or any additional information I could provide?

Thanks in advance guys!

like image 494
Gonzalo Diaz Ailan Avatar asked Oct 03 '16 13:10

Gonzalo Diaz Ailan


People also ask

How do I change the name of my NativeScript app?

To edit the Package Name and the Application Id, modify the package. json of your app and set the nativescript.id key. You may need to delete platforms/android and rebuild using the CLI command ns prepare android . Read more about "ApplicationId versus PackageName".

Can a developer build an app using NativeScript?

NativeScript is a free and open-source framework for developing mobile applications. It is used to build truly native mobile apps using JavaScript. You can easily develop a native UI and higher-performance apps for your iOS and Android platforms using Angular skills.


3 Answers

Go into app >> App_Resources >> Android >> values folder.

There should be a strings.xml file - if not create it.

The content should be

<?xml version="1.0" encoding="utf-8"?> <resources> <string name="app_name">DISPLAY APP NAME</string> <string name="title_activity_kimera">APK NAME</string> </resources>

p.s. these stackoverflow content check error messages are annoying!!!

like image 94
dashman Avatar answered Sep 20 '22 19:09

dashman


For the Angular flavor of NativeScript:

Android app name:

App_Resources/Android/src/main/res/values/strings.xml. Create it if it does not exist. Content is:

<?xml version="1.0" encoding="utf-8"?>
<resources>
  <string name="app_name">DISPLAY APP NAME</string>
  <string name="title_activity_kimera">APK NAME</string>
</resources>

iOS App Name

In /Users/ryan/projects/snaptab-mobile-app/App_Resources/iOS/Info.plist replace the <string>${PRODUCT_NAME}</string> value of CFBundleDisplayName with your app name. Ex: <string>My NS APP</string>.

like image 39
Pezhvak Avatar answered Sep 18 '22 19:09

Pezhvak


this worked for me:

For Android

create App_Resources/Android/src/main/res/values/strings.xml

    <?xml version="1.0" encoding="utf-8"?>
<resources>
    <string name="app_name">MyAppName</string>
    <string name="title_activity_kimera">MyAppName</string>
</resources>

https://docs.nativescript.org/tooling/publishing/publishing-android-apps#app-name

For IOS

The value is stored in the app/App_Resources/iOS/Info.plist file as the CFBundleDisplayName key. just changed to your custom app name https://docs.nativescript.org/tooling/publishing/publishing-ios-apps#app-name

like image 43
Reda Daddach Avatar answered Sep 20 '22 19:09

Reda Daddach