Skip to content

5. Editing the code

Rey Koxha edited this page Feb 19, 2017 · 4 revisions

1. Rename the package:

Right click on the java folder > Create Package.
Now simply drag and drop the files to the new folder and also edit package name in the AndroidManifest.xml.
Also clean/rebuild the project because of possible “R” errors.

2. Editing the URL to display:

Go to the res > values > navigation.xml, enter the desired URL(s) to display.

3. Enabling/disabling the sidebar:

In case you want multiple URLs to be displayed you can enable the sidebar this way:
Open java > package.name.something > activity > MainActivity.java.
Jump to line 176 and comment it out.

4. Icons:

To create an action icon (for the sidebar), you simply get to the drawables (res) and create a new Image Asset.
To replace the launcher icon you do the same, just select a Launcher Icon from the dropdown.

5. OneSignal:

Register and complete the setup at OneSignal, you then will receive an ID.
Open the build.gradle file in the app folder and jump to line 44. Enter your ID there and sync.

6. Themes:

In the theme.xml (res > values) you can find all the available colors, in case you want to use one of the other
presets, go to the AndroidManifest.xml (main) and change the value in line 24.

7. Analytics / AdMob:

Open java > package.name.something > WebAppConfig.java. Change the false to true.

For AdMob:
Open res > values > admob.xml and enter your IDs.
The test device ID is not required.

For Analytics:
Open res > xml > analytics_app_tracker.xml and enter your ID in line 5.

8. App name:

Open res > values > strings.xml and enter the name of your app in line 4.