The strings.xml
file
You can find this file into the
res/values
folder in Android Studio. Open this file and keep reading this guide, you'll have to perform some edits in this file in order to get your template ready to run:
App Name
Replace the following name with the new one you want to give to this app in this line:
<string> string name="app_name"> CityGo </string>
AdMob Unit ID & App ID
Replace the values of these variables with your own
Interstitial Unit ID and
App ID strings.
name="ADMOB_INTERSTITIAL_UNIT_ID"> ca-app-pub-3940256099942544/1033173712< /string>
name="ADMOB_APP_ID">ca-app-pub-3940256099942544~3347511713< /string>
You have to create your
Unit ID at
apps.admob.com.
Follow the instructions on the AdMob's website in case you don't know how to generate an AdMob Unit ID.
The Configurations.java
file
Open this file from Android Studio and keep reading this guide, you'll have to perform some edits in this file in order to get your template ready to run:
Parse Server Keys
As explained in the
Quick Start section of this guide, you must replace the strings of the 2 variables below with your own
App Id and
Client Key that you will get from the back4app website after creating your own Parse App:
public static String PARSE_APP_ID = "K7SCPO9S6zywk3DMoEskABkJCOOWNkwx6Lfew2hy";
public static String PARSE_CLIENT_KEY = "kC36ZLG7UWs31cPpLUN3M8RkS6K6BK544MFYm3hD";
Custom colors
You can edit the
HEX values of the following variables as you wish. The main color of the app and some other Views will be affected by your change:
public static String MAIN_COLOR = "#539cfd";
public static String LIGHT_GREY = "#FFF8F8F8";
public static String GREY = "#bababa";
PLEASE NOTE that not all views will be affected by changing the HEX values above, you may still need to go through some XML file and adjust the colors on your own with the right-side Attributes panel.
Custom fonts
This App uses some custom fonts for Buttons, TextViews ans EditTexts. The font files are stored into the
app/src/main/assets/font
folder and are declared in this line:
public static Typeface osBold, osSemibold, osRegular, osExtraBold, osLight, osItalic, lemonMilk;
Such fonts are initialized into the
onCreate()
function as follows:
lemonMilk = Typeface.createFromAsset(getAssets(),"font/LemonMilk.otf");
osSemibold = Typeface.createFromAsset(getAssets(),"font/OpenSans-Semibold.ttf");
osRegular = Typeface.createFromAsset(getAssets(),"font/OpenSans-Regular.ttf");
osExtraBold = Typeface.createFromAsset(getAssets(),"font/OpenSans-ExtraBold.ttf");
osLight = Typeface.createFromAsset(getAssets(),"font/OpenSans-Light.ttf");
osItalic = Typeface.createFromAsset(getAssets(),"font/OpenSans-Italic.ttf");
In case you want to add a new font, you have to first drag your
.ttf
or
.otf
font file into the
app/src/main/assets/font
folder, then you have to instantiate it at the end of the
public static Typeface
line that's into the
onCreate()
function - let's pretend you have a font file called
Helvetica-Bold.ttf, you may add an instance called
hBold
(it's just an example, name it as you wish since it's a variable):
public static Typeface osBold, osSemibold, osRegular, osExtraBold, osLight, osItalic, hBold;
Lastly, import its path into the
onCreate()
function like the existing ones. Based on the font example above, your new line of code may look like this:
hBold = Typeface.createFromAsset(getAssets(),"font/helvetica-Bold.ttf");
List of Categories
The following array contains a list of categories for wallpapers:
public static String[] categoriesArray = {
/* c_0 */ "Starter Pack__This pack is a great starting point to find cool wallpapers for your device.__unsplash.com",
/* c_1 */ "Abstract__Awesome collection of abstract patterns and pictures, liquid sensations for your device.__unsplash.com",
/* c_2 */ "Mextures Collective__This pack showcases high-def wallpapers provided by the Mextures Collective community.__mexturescollective.com",
/* c_3 */ "Infinite Space__A fresh collection of pictures from outer space. Make your device stellar.__unsplash.com",
/* c_4 */ "Sky Collection__A collection of sky photos.__papers.co",
/* c_5 */ "Blurred Art__Nice variety of colored and blurred wallpapers.__papers.co",
// ADD CATEGORIES HERE (OR EDIT THE ONES ABOVE)
};
You may notice that there's a comment on the left side of each item. That indicates the name of the image relative to the category. You may also notice the syntax of each array''s item, its has a double underscore separator:
__
. That's needed for the app show data.
So, in case you want to add a Category, follow this sample steps:
-
As an example, let's pretend you want to add a new category called Awesome Art.
You need to add a new string below the last one of the categoriesArray
which must contain the name, description and website URL where you've picked the image from.
So here's an example:
"Awesome Art__A brief description of this category.__unsplash.com",
The website URL must not have any www
, https://
or http://
prefix, it must be only the domain name!
-
As a reminder, you may also add the
/* c_6 */
before the string, so it'll look like this:
/* c_6 */ "Awesome Art__A brief description of this category.__unsplash.com",
That /* c_6 */
comment is the name of the new image you must create and save into the drawable
folder of your project's folder. Check the existing ones to see how they look like.
-
Create a new .jpg image with Photoshop - or any other image editor software - with a size of
640x427px
, name it c_6.jpg, then save it into the drawable
folder:
Now, if you run the app again, it'll show your brand new Category in the Home screen.
Support email address
You must replace the following string with a valid email adress where you want people to contact you in case of questions, support or even account deletion requests - accordingly to
EU GDPR:
public static String SUPPORT_EMAIL_ADDRESS = "[email protected]";
Parse Dashboard Classes and Utility functions
This section is a list of strings that the app calls to perform queries to the Parse Server database - aka Parse Dashboard - and it contains a few useful custom global variables and functions.
Do not edit those variables and instances unless you're an experienced Android developer, otherwise the app will not work properly.