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"> bCards </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 = "#f54b8f";
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;
Such fonts are initialized into the
onCreate()
function as follows:
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");
Admin email address
Once buyers will place orders in the app, both you and them will get an email with a recap of the order, so you must set a valid email address by replacing the string of the following variable with your own one:
public static String ADMIN_EMAIL_ADDRESS = "[email protected]";
URL path of the PHP files
In order for you and the buyers to get Orders recap emails, you must first upload the 2 PHP files included in the
PHP
folder into your own server - you can use
FileZilla to do that and you must own a domain with PHP 5.4 or higher enabled.
Then repalce the string of this variable with the URL of the folder where you've uploaded the
email-admin.php
and
email-buyer.php
files:
public static String PATH_TO_MAIL_PHP_FILE = "http://xscoder.com/zstore/"
PLEASE NOTE that if you uploaded those 2 PHP files into the root of your server (usually it's the public_html
directory), then the URL you must set should be something like http://yourdomain.com/
Otherwise, if you've uploaded those PHP files into a directory, your URL can be something like http://yourdomain.com/yourfoldername/
IMPORTANT: Always place the slash symbol /
at the end of your URL string!
Default Currency Code
Based on where you are located (but mostly where your PayPal account is located at), you have to set the default Currency Code by replacing the string of the following variable into your own coyntry's currency code:
public static String CURRENCY_CODE = "USD";
Just for your reference, here's a list of all ISO 4217 Codes:
https://www.xe.com/iso4217.php
Default Delivery price
Since
Z Store's' concept is about selling physical products, you will have to make shipments to deliver goods to clients. So you can set your default delivery price by changing the number of the following variable:
public static double DELIVERY_PRICE = 7.90;
Default estimated delivery days
You can change the estimated delivery days for when goods will be delivered to buyers in the following variable:
public static int DEFAULT_ESTIMATED_DELIVERY_DAYS = 2;
Based on this value, after a buyer will make a purchase, the App will show him an estimated delivery date in the
Orders screen.
Courier tracking URL
You will surely choose an international courier for shipping goods, such as DHL, UPS, etc. So you must find the page relative to the shipment's tracking on their websites and replace the string of the following variable with that URL:
public static String COURIER_TRACKING_URL = "https://www.dhl.it/en/express/tracking.html";
Please check that link on your browser in order to see what kind of page you have to look for on your Courier's website.
Merchant Name
Set your own Store or comapny name by replacing the string of thew following variable with your own name:
public static String MERCHANT_NAME = "Z Store Inc."
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.