Travel Mobile App
Pre-requisites
-
Android Studio 3.0 or above Google Developer site
-
Android device or emulator running API level 22 or above
-
Android SDK 26
-
Android Build Tools 26
-
JDK 8
Windows Users: If you are developing on Windows, we recommend that you use a Windows 10 machine. Also, note that if you choose the Manual or Docker installation mode, you should also have administrative privileges on the Windows box so you can authorize the installation and running of the required executables.
Travel Sample Mobile App
-
Clone the "master" branch of the Travel Sample app from GitHub. We are doing a shallow pull with
depth
as 1 to speed the cloning process.git clone -b master --depth 1 https://github.com/couchbaselabs/mobile-travel-sample.git
-
Open android/TravelSample/build.gradle using Android Studio.
Configure App to connect to Backend
You will have to update the URLs specified in the app to connect to the backend If you haven’t done so already, complete the steps outlined in the "Backend Installation" to install your Couchbase Server, Sync Gateway and Python web backend app.
Updating the web backend URL
Open the file DatabaseManager.java
in util folder.
You must update the mPythonWebServerEndpoint
constant which points to the Python Web Server.
Now, the URLs that you specify will vary depending on the installation option that you chose for deploying your backend
public static String mPythonWebServerEndpoint = "http://10.0.2.2:8080/api/";
public static String mPythonWebServerEndpoint = "http://10.0.2.2:8080/api/";
// Replace the hostname with the IP Address of the RightScale instance.
// The example states `54.148.83.39` but yours will be different.
public static String mPythonWebServerEndpoint = "http://54.148.83.39:8080/api/";
Updating the Sync Gateway URL
Next, you will update the Sync Gateway endpoint.
Open the file DatabaseManager.java
in util folder
You must update the mSyncGatewayEndpoint
constant.
Now, the URLs that you specify will vary depending on the installation option that you chose for deploying your backend
public static String mSyncGatewayEndpoint = "ws://10.0.2.2:4984/travel-sample";
public static String mSyncGatewayEndpoint = "ws://10.0.2.2:4984/travel-sample";
// Replace the hostname with the IP Address of the RightScale instance.
// The example states `54.148.83.39` but yours will be different.
public static String mSyncGatewayEndpoint = "ws://54.148.83.39:4984/travel-sample";