Issues with app generated from tns-template-hello-world-ng template
I generated a new app using the tns-template-hello-world-ng template. I'm having a difficult time changing the app name in the title bar and the name displayed on the icon. I searched through the Groceries app and found these two things are set in values/strings.xml, but my generated app doesn't have that file. Am I correct in thinking I need this file?
\platforms\android\src\main\res\values\string.xml -- app_name is the node which contain title value. so when you will add android platform you should have that folder and files created for you and your project name as your app title. It looks like for this hello-world template those advance files are not created. it's bare minimum just to get you started.
Actually shouldn't it be App_Resources/Android since platforms gets wiped out every time it builds?
I added the strings.xml file to App_Resources/Android/values/strings.xml. I have observed an issue where if I change app_name and title_activity_kimera it does not reload the app and the app name and title are not updated. I have tried multiple times and even restarted livesync. Any ideas? If I make a change to something in app.component.ts it updates the app, so it appears to only be the Android specific code from what I can tell.
For changing the text in the title bar:
<ActionBar title="NativeScript Rocks"> </ActionBar>
Regarding using the App_Resources folder for saving any updates:
This will not get wiped out everytime it builds. In fact, we can even check-in this folder as this would contain any images if used with 'res:' in your code.
Sorry, you might be referring to Platforms>Android folder which will get wiped when you run tns platform remove android. Yes, this is true and not an ideal place to save your changes.
As @lakhanpalv mentioned above, these core components are not yet built by the NativeScript team, I'm sure they will be developed and available outside the Platforms folder as configuration options (in package.json) once they are ready.
@tjvantoll can confirm this.
@jsparks19 after upadting "App_Resources/Android/values/strings.xml" for "app_name" do 'tns run android' for some reason 'tns livesync android --watch' or 'tns build android' didn't work for me even though it was updating the string.xml file in platform/res folder.
{N} changed significantly since Apr, here is how you start with angular now:
tns create MyApp --ng
Then title can be changed when you add following in app.component.html :
<ActionBar title="NativeScript Rocks"></ActionBar>
Changing can be achieved by adding app/App_Resources/Android/values/strings.xml with content like this:
<?xml version="1.0" encoding="utf-8"?>
<resources>
<string name="app_name">Examples NativeScript</string>
<string name="title_activity_kimera">Examples NativeScript</string>
</resources>
After adding this file please unisntall your app form the emulator/device.
tns run android and then tns livesync android --watch will work properly.