Skip to content

Mobile Development Setup

Amlan Kumar Nandy edited this page Jul 10, 2021 · 1 revision

Setting up a Firebase Project

The application needs google-services.json issued from Firebase for Google Authentication. To obtain the file,

  1. Sign in to Firebase Console
  2. Click Add Project and the necessary information about the project
  3. Agree to the terms and conditions and click Create Project
  4. After creating the project, click Add Firebase to your Android App
  5. Go to the project location and open android/app/src/main/AndroidManifest.xml. Copy the package name(org.scorelab.labellab_mobile) and paste in the package name field
  6. Get the SHA1 fingerprint by following the instructions and paste it into the SHA1 fingerprint field
  7. Click next and download the google-services.json
  8. Paste the file in the android/app/ folder

Setting up Google Maps

To use Google Maps for the object path tracking feature, the application needs a Google Maps API key. To obtain it, go through the following steps-

  1. Visit Google Maps Platform
  2. Sign in with the same Google account used to create the firebase project
  3. Open the AndroidManifest.xml file present in android/app/src/main/ location
  4. Replace API_KEY_HERE with the new key

If you haven't enabled Google Map SDK,

  1. Visit Google Developers Console
  2. Choose the same Firebase project
  3. On the navigation menu, select Google Maps and select APIs under the Google Maps menu
  4. To enable Google Maps for Android, select Maps SDK for Android, then ENABLE
  5. To enable Google Maps for iOS, select Maps SDK for iOS, then ENABLE

Starting the Application

NOTE: A device with USB debugging enabled or virtual device is required

  1. Setup and run the Flask server (If not already done)
flask run --host=0.0.0.0
  1. Fetch all dependencies listed in the pubspec.yaml file
flutter pub get
  1. Run the application
flutter run

Building the APK

For building the app for Android, run the following command -

flutter build apk

For iOS use this instead -

flutter build ios