Android Side

Last updated: February 29th, 2024

Open Project in Android Studio

Extract .zip you download from Codecanyon, you will see some file and folder. The project location inside Android_Side folder. When your Android Studio ready you can open it and you will see display like this:

screenshot
  1. Select Open icon
  2. Browse location of the project and press OK button
  3. Wait for few minutes until all process import has finished

Firebase Configuration

Before you do step change the package name, you must do this step for firebase project configuration. Please note: this step is mandatory to generate google-services.json file, "Server key" and "Sender ID".

How to generate google-services.json file? Click Here!

After you generate and download the google-services.json, please added it, in the directory app in the Android project.

screenshot

1. Switch to the Project view in Android Studio to see your project root directory.
2. Move (copy and replace) your downloaded google-services.json file into your module (app-level) root directory.

Note: Please write "Server key" and "Sender ID" from your Firebase console on a paper or text file. We need these keys for OneSignal configuration.

OneSignal Configuration

Required For Setup:

  1. OneSignal Account, if you do not already have one.
  2. Your OneSignal App ID, available in Keys & IDs.
  3. Google/Firebase Server API Key. ("Server key" and "Sender ID").
  4. A device or emulator that has Google Play services installed and updated on it (Device will not subscribe or receive push notifications with out this).

Config.java Setup:

Update ONESIGNAL_APP_ID value from app > java > YourPackageName > app > Config.java with your OneSignal app id.


Keys & IDs Setup:

  1. Login to your OneSignal Account and select your app
  2. Select SETTINGS > Keys & IDs to get your OneSignal APP ID and REST API KEY
  3. screenshot
  4. Login to your Admin Dashboard, replace OneSignal APP ID and OneSignal REST API KEY with yours. Open: Settings → General Settings → Third Party Apps
  5. screenshot

Change Package Name

  1. Open Gradle Scripts → build.gradle (Module: app)
  2. Change the application ID with your own id name
  3. Standard naming procedure: com.yourdomainname.yourappname
  4. Click Sync Now
  5. Change the id as unique as possible, because application id is very important used if you want to publish the application to the google play

Important

Your applicationId or package name must same with your package name that you've create on Firebase console when you generate google-services.json

screenshot

  1. Click once on your package com.example.app
  2. Click Setting icon on Android Studio
  3. Select Tree Appearance and check and uncheck the menu like bellow screenshot
  4. Right click on your package and then select Refactor > Rename. Do not change com and just change the rest
screenshot

Server Connection

When your server side already configured properly, you can connect it to your android app.
To change BASE_URL: please open app > java > YourPackageName > app > Config.java and change it to your admin dashboard installation URL.

API Key Configuration

  1. Goto Admin Dashboard → www.YourDomain.com/dashboard/home
  2. Open Users Management → Users List and then select one of Super Admin users that you want to enable API
  3. Select API Key tab
  4. Enable read, write, API key and then click on the Update button
  5. Goto Android Studio and open → app > java > YourPackageName > app > Config.java and put your API ID and API key which obtained from admin dashboard:

  6. public static final String API_ID = "xxx";

    public static final String API_KEY = "xxxxxxxxx";

Customize The Application

Change Color

  1. Open Android Studio → app → res → values → colors.xml
  2. Enter your color code inside each of strings tag

Change Name & Text

Change Application Name and Text Inside the Application:

  1. Open Android Studio → app → res → values → strings.xml
  2. Change value name in each strings tag according your needs

Change Font

If you want to change default font, first prepare a TTF format font that you like and then:

  1. Open Android Studio → app → assets → fonts
  2. Copy and overwrite your custom.ttf font

Change Images

  1. Open app → res → drawable and replace with your image or icon, all image are placed on there
  2. You also can change every image in app like via Explorer, open Explore and go to your project directory, select app\src\main\res\drawable
  3. Replace every image which you need to custom the application and highly recommended you using same resolution for each image

Default Language

  1. Open Android Studio → app → java → YourPackageName → app → Config.java
  2. Change the value of "DIRECTION" to ltr or rtl
  3. Change the value of "Language" to your langauge title like English
  4. Change the value of "Locale" to your langauge code like en for English

Generated Signed APK

To sign your app in release mode in Android Studio, follow these steps:

  1. On the menu bar, click Build → Generate Signed APK
  2. If you already have a keystore, go to step 4
  3. On the Generate Signed APK Wizard window, click Create new to create a new keystore
  4. On the New Key Store window, provide the required information, your key should be valid for at least 25 years, so you can sign app updates with the same key through the lifespan of your app
  5. On the Generate Signed APK Wizard window, select a keystore, a private key, and enter the passwords for both. Then click Next
  6. On the next window, select a destination for the signed APK and Signature Versions
  7. Click Create and the signed apk will generated

AdMob Configuration

Change Your AdMob app_id and unit_id

  1. Login to your AdMob Account, create an app and generate your application id and ad unit id
  2. Go to Android Studio and open AndroidManifest.xml and change value of com.google.android.gms.ads.APPLICATION_ID to your application id
  3. Open Admin Dashboard and go to: Advertising → AdMob Configuration and write your application id and ad unit id

Enable and Disable AdMob:
Open Admin Dashboard and go to: Advertising → AdMob Configuration


AdMob ads are not displayed on the phone?
If you were not able to see the ads after changing the application id and unit id to yours, make sure you entered AdMob API keys correctly from AndroidManifest.xml and Admin Dashboard. The ad request was successful, but no ad was returned due to lack of ad inventory. It’s because of your AdMob settings that there are no ads for your preferred language or location. Email to Google and ask about errorCode 3 to advise you to make changes to your AdMob settings.

Support Multi Languages

Apps include resources that can be specific to a particular culture. For example, an app can include culture-specific strings that are translated to the language of the current locale. It's a good practice to keep culture-specific resources separated from the rest of your app. Android resolves language- and culture-specific resources based on the system locale setting. You can provide support for different locales by using the resources directory in your Android project.

Language configuration for Server Side:
  1. Open Admin Dashboard and go to: Settings → Languages
  2. Create your custom language
  3. Open file manager or use FTP and go to: ci_files/app/Language
  4. Duplicate en folder with your custom language code (ISO 639-1 Code). For more information click here
  5. Translate the contents of all the files in the language code folder to your desired language
  6. For each language that you created, you Should edit General Settings, Home Configuration, Website Template, Logo and create Categories, Posts, Pages and...
Language configuration for Android Side:
  1. Open Android Studio and go to: app → res → values
  2. Right-click the strings, and select Open Translations Editor
  3. The Translations Editor displays the key and value pairs from the strings.xml file.

    Note

    When you have translated strings.xml files, your project has multiple corresponding values folders with suffixes that indicate the language, such as values-es for Spanish. Your default strings.xml file is always in the values (no suffix) folder.

  4. Figure 1 shows the default app text (in this case, English) in the Translations Editor for a simple app before translation work has been done. The contents of translated strings.xml files will appear to the right of the Untranslatable column with one column per language as shown in figure 2.

For more information and find how to add more languages file, Click Here!

FAQ

If there are any problems, please visit our FAQ page. Click Here!

Support Ticket

Didn't find your question on FAQ page?

Send your question to our Support Ticket System. We will reply you in the shortest time possible.