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"> Askk </string>
AdMob Unit ID & App ID
Replace the values of these variables with your own
Interstitial Unit ID and
App ID strings.
<string>name="ADMOB_INTERSTITIAL_UNIT_ID">ca-app-pub-3940256099942544/1033173712</string>
<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.
Google Maps API Key
You must replace the
Google Maps API Key with your own one in the variable below - you can generate your Maps Key on this
LINK after setting up a Google Billing account (required since middle 2018):
<string name="google_maps_key"> AIzaSyDqoFdzU1hZ5AhyOwqAAjy0GVTcgBDfTFk</string>
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 = "#8344af";
public static String GRAY = "#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 popBlack, popBlackItalic, popBold, popBoldItalic,
popExtraBold, popExtraBoldItalic, popExtraLight, popExtraLightItalic, popItalic,
popLight, popLightItalic, popMedium, popMediumItalic, popRegular, popSemibold, popSemiboldItalic,
popThin, popThinItalic;
Such fonts are initialized into the
onCreate()
function as follows:
popBlack = Typeface.createFromAsset(getAssets(),"font/Poppins-Black.ttf");
popBlackItalic = Typeface.createFromAsset(getAssets(),"font/Poppins-BlackItalic.ttf");
popBold = Typeface.createFromAsset(getAssets(),"font/Poppins-Bold.ttf");
popBoldItalic = Typeface.createFromAsset(getAssets(),"font/Poppins-BoldItalic.ttf");
popExtraBold = Typeface.createFromAsset(getAssets(),"font/Poppins-ExtraBold.ttf");
popExtraBoldItalic = Typeface.createFromAsset(getAssets(),"font/Poppins-ExtraBoldItalic.ttf");
popExtraLight = Typeface.createFromAsset(getAssets(),"font/Poppins-ExtraLight.ttf");
popExtraLightItalic = Typeface.createFromAsset(getAssets(),"font/Poppins-ExtraLightItalic.ttf");
popItalic = Typeface.createFromAsset(getAssets(),"font/Poppins-Italic.ttf");
popLight = Typeface.createFromAsset(getAssets(),"font/Poppins-Light.ttf");
popLightItalic = Typeface.createFromAsset(getAssets(),"font/Poppins-LightItalic.ttf");
popMedium = Typeface.createFromAsset(getAssets(),"font/Poppins-Medium.ttf");
popMediumItalic = Typeface.createFromAsset(getAssets(),"font/Poppins-MediumItalic.ttf");
popRegular = Typeface.createFromAsset(getAssets(),"font/Poppins-Regular.ttf");
popSemibold = Typeface.createFromAsset(getAssets(),"font/Poppins-SemiBold.ttf");
popSemiboldItalic = Typeface.createFromAsset(getAssets(),"font/Poppins-SemiBoldItalic.ttf");
popThin = Typeface.createFromAsset(getAssets(),"font/Poppins-Thin.ttf");
popThinItalic = Typeface.createFromAsset(getAssets(),"font/Poppins-ThinItalic.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 popBold, popSemibold, ... 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 and Colors
The following array contains a list of
Categories which are being used in this app.
You can edit them as you wish since they are just strings, but please note that every time you'll change a name of a Category in this array, you must also change the name of its relative icon in the
drawable
folder in Android Studio accordingly:
public static String[] categoriesArray = {
// First fixed Categories (NOTE: these 3 items must alwasy be at the first index position)
"latest",
"trending",
"answer",
//--------------------
// Categories:
"photography",
"health",
"tech",
"movies",
"politics",
"music",
"psychology",
"books",
"sport",
"science",
"education",
// YOU CAN ADD NEW CATEGORIES HERE, ALL LOWERCASED...
};
As you can see by the above array, the first 3 items are separated from the other ones, this is because they are fixed categories that won't be loaded once you are about to post a Question, and those 3 categories are for the
Home screen to filter questions by
Trending (the first 100 questions that have 2 or more answers),
Latest (the 100 newest posted questions) and
Answer (those questions that don't have any answer yet).
So if you want to add a new Category, just add it below this comment:
// YOU CAN ADD NEW CATEGORIES HERE, ALL LOWERCASED...
and
DO NOT EDIT the first 3 items of the
categoriesArray
, which are:
"latest",
"trending",
"answer",
PLEASE ALSO NOTE the following array of colors:
public static String[] colorsArray = {
"#000000", // latest
"#444444", // trending
"#777777", // answer
//-------------------------------
"#8344af", // photography
"#ed5564", // health
"#fc6d52", // tech
"#d870ad", // movies
"#8cc051", // politics
"#5d9bec", // music
"#48cfae", // psycology
"#39bf68", // books
"#8344af", // sport
"#ed5564", // science
"#fc6d52", // education
// YOU CAN ADD COLORS HERE...
};
Similarly to the
categoriesArray, this array stores the HEX color values of each Category, based on their position (see the comments with category names next to each
colorsArray's item).
If you want to add a new category, let's say
Lifestye for instance, just follow these simple steps as an example:
- Add the category name in the
categoriesArray
, ALL LOWERCASE CHARACTERS, like this:
"lifestyle",
- Add its HEX color value in the
colorsArray
, right below the last item, like this:
"#ed5564",
- Lastly, create your own icon for your new category and save it in the
drawable
folder in Android Studio, and give it the LOWERCASE name of your new category (so lifestyle
)
Done. Just repeat the steps above to add new categories.
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.