How to prepare and start working with the configuration file and provide access to data search.
This article describes how to prepare the White Label App configuration file for further work and how to get access to the data for flights and hotel searches.
Note! Before proceeding to the steps in this instruction, please read the Steps before creating an application with the Travelpayouts White Label App. If you do not fulfill these conditions, you will not be able to create a fully functioning app.
1. Preparing to work with the configuration file
First, you need to download the archive with the application from GitHub.
After downloading the archive, follow the steps below:
- Download Android Studio.
- Unzip the archive with the application.
- Open the project in Android Studio. Click File → Open → Select the project folder.
- Create a file with the name signing.properties in the white-label-app-android-main folder.
- You need to add the application signing certificate parameters to this file so that the application can be built. To do this, add the following code to the file:
# Debug |
- Both for the Debug and Release builds fill in the following information:
- KEYSTORE_FILE — path to the file where the key is located.
- KEYSTORE_FILE_PASSWORD — password for the file where the key is located.
- KEY_ALIAS — key name.
- KEY_PASSWORD — key password.
If you don't yet have a key, you must first create 2 keys: Debug (for debug build) and Release (for release build).
How to create keys:
- Launch Android Studio and go to Build → Generate Signed Bundle / APK.
- Select APK and click Next.
- Key creation window will open where:
- Value in the Key store path is inserted automatically after the key is created, or you need to select the path to a previously created file with the key (NOT to the white-label-app-android-main/signing.properties file).
- Specify passwords Key store password for the file with the key, and Key password — the password for the key itself.
- Create a Key alias (key name).
- Click Next.
- Check the Export encrypted key box and create a key.
- Repeat the steps to create a second key.
2. Working with the Configuration File
The configuration file app_config.json is located in the /config folder. Using this file you will be able to customize the app to your brand (change the color, adjust styles, add a logo, etc.) and set up data access so users can search for tickets and hotels.
It is recommended to use Android Studio for editing the app_config.json file since Android Studio will be needed for project compilation (in general, the file can be edited with any text editor).
Example app_config.json
{
"base_configuration": {
"identifier": {
"android": {
"id": "com.travelapp",
"versionName" : "1.0.0",
"versionCode" : 1
},
"apple": {
"id": "superpuper.travel-app",
"team_id": "LKREN1N1GZ7",
"version": "1.0.0"
"build_number": 0
}
},
"display_name": {
"base": "en",
"localized": {
"en": "Travel App EN Git",
"es": "Travel App ES Git"
}
}
},
"constants": {
"host" : "android.superpuper.travel-app",
"api_key" : "test_api_key"
"policy_url": {
"base": "en",
"localized": {
"en": "https://google.com",
"es": "https://www.google.es"
}
},
"advertising": {
"appodeal_api_key": "",
"google_admob_app_id": "",
"placements": {
"air_ticket_placement_interstitial": "",
"air_ticket_placement_banner": "",
"hotels_placement_interstitial": "",
"hotels_placement_banner": ""
}
},
"feedback_email": "test@test.com",
"google_maps_api_key": "your_tocken",
"appstore_id": "",
"marker": 233601,
"client_device_host": "iphone.apartments"
},
"style": {
"base_color": "#7648C5", // Hex value of the base color palette
"corners_type": "default", // Corner type {sharp, default, round}
"icons_type": "filled" // Style of used icons {filled, tint, line}
"palette": "lab" // The principle of generating a palette
},
"info_screen_config": {
"items_to_display": [
"favorites", // Favorites section
"about_app", // About the app section
"rate_app", // Rate this app section
"share_app" // Share the app section
],
"about_app_info": {
"description": {
"base": "en",
"localized": {
"en": "Application description",
"es": "Descripción de la aplicación"
}
},
"developer": {
"base": "en",
"localized": {
"en": "CleverPunpkin Ltd.",
"es": "OOO CleverPumpkin"
}
},
"partner_url": {
"base": "en",
"localized": {
"en": "https://www.google.com",
"es": "https://www.google.es"
}
}
}
},
"white_label_config": {
"screens_to_display": [
{
"type": "flights" // Flights tab
},
{
"type": "hotels" // Hotel tab
},
{
"type": "other", // Other tab
"parameters": {
"id": "Other1",
"icon": "ic_default_other",
"title": {
"base": "en",
"localized": {
"en": "Other",
"es": "Otros"
}
},
"url": {
"base": "en",
"localized": {
"en": "https://www.google.com",
"es": "https://www.google.es"
}
}
}
},
{
"type": "other", // Other tab 2
"parameters": {
"id": "Other2",
"icon": "ic_default_other",
"title": {
"base": "en",
"localized": {
"en": "Other 2",
"es": "Otros 2"
}
},
"url": {
"base": "en",
"localized": {
"en": "https://www.google.com",
"es": "https://www.google.es"
}
}
}
}
]
}
}
Important! After making any changes to app_config.json:
- Save the changes to the file.
- Execute the command ./gradlew parseConfigin the terminal in Android Studio.
JDK must be installed for the correct operation of this command in the Android Studio terminal. If it is not installed automatically with Android Studio, install it independently for the required operating system. - Rebuild and run ▶.
3. Adding the application ID
Add the application id to the configuration file. This step is mandatory because, without the application ID, you will not be able to publish the application to Google Play. To add the id:
- Find the following code in the app_config.json file:
… |
- Specify the id of the application in the id parameter.
- The same id must be added to the buildSrc/src/main/kotlin/configuration/Config.kt file in field val APPLICATION_ID = "com.travelapp" (instead of the default id).
- Remove the apple{} block from the identifier{} field in the app_config.json file, since it contains parameters for the iOS application.
4. Access to data
To access the functionality related to flight and/or hotel searches, it is necessary to replace some default data in the configuration file. To do this
1. Find the following part of the code in the file:
... |
2. Make changes to the following parameters:
-
api_key — insert your API token to access flight tickets and hotels data. You can find the API token in your Travelpayouts account on the White Label App page:
-
marker — insert your Travelpayouts ID. You can also find it in your Travelpayouts account on the White Label App page:
-
client_device_host — specify your host, which is written like this: “[platform].[app]”
- platform - android
- app – the id of your application that you passed to identifier.android.id
Example: "android.superpuper.travel-app"
The application can be compiled and run on an emulator in Android Studio or on a specific Android device.
Next steps
Once you add the bundle and team ID, get access to the data, and compile, your application is generally ready for publication in Google Play. However, to make it unique and increase the chances of successful reviews by the store, we recommend customizing your application. For example, you can change:
- Name
- Colors and application palette
- Icon style
- Search screen headings
- Input field labels, etc.
We have compiled information on all available settings in the article Setting up and Customizing the White Label App for Android.