Skip to content

Latest commit

 

History

History
51 lines (46 loc) · 5.5 KB

README.md

File metadata and controls

51 lines (46 loc) · 5.5 KB

Android Studio Setup

The Android Studio IDE can be downloaded here. Normally, you can either build the app using Java or Kotlin for the back-end, and using XML for the front-end.

Project Structure

The essential folders and files are:

.
├── app                                                               
│   ├── src                                                            # The main directory for the source files.
│   │   ├── main                                                       # Contains the primary code and resources.
│   │   │   ├── AndroidManifest.xml                                    # Configures the app's name, icon, and permissions.
│   │   │   ├── res                                                    # Resources folder containing layouts and other UI elements.
│   │   │   │   ├── layout                                             # Holds XML front-end files defining the user interface.
│   │   │   │   │   ├── biner_base.xml                                 # XML layouts for HSV segmentation activity.
│   │   │   │   │   ├── activity_reference_input.xml                   # XML layouts for taking input from the user.
│   │   │   │   │   ├── camera_view.xml                                # XML layouts for the main activity.
│   │   │   ├── java/.../na568Teamproject_MohammedAlanUsmanBahru/      # Java back-end source code directory.
│   │   │   │   │   │   ├── SeekBarHsvSeg.java                         # Manages the user interface for a feature involving an HSV color model.
│   │   │   │   │   │   ├── ReferenceInput.java                        # Handles user input for reference settings.
│   │   │   │   │   │   ├── MainActivity.java                          # The main activity managing the core functionality.
│   │   │   │   │   │   ├── NoiseEstimator.java                        # Manages noise estimation for sensors and updating noise parameters.
│   │   │   │   │   │   ├── KalmanFilter.java                          # Implements a Kalman filter for estimating and updating the state.
└── ...

Dependencies

For running the app via Android Studio, this application uses the following libraries:

  • OpenCV 4.1.0 (can be explored here or directly downloaded here)

Building and Developing the Project Files

  1. Download or clone the repository.
  2. Open this 'android_app_team16' project in your Android Studio IDE. Check and click "Trust Project".
  3. In the Menu Bar try:
    BuildRebuild Project.
  4. If the build is successful:
    • In your Android device, turn on the USB debugging:
      SettingsAbout phone → tap Build number x 7 times → allow for being developer → go back to SettingsSystemsDeveloper options → scroll down → turn on USB debugging.
    • Connect your Android device to your computer via USB cable.
    • In the Android Studio IDE press Run (or pressing control+R) button at the top of the window.
  5. If the build is not successful:
    • Download OpenCV for Android dependency and extract it.
    • In the Android Studio IDE:
      • Load the dependency
        FileNewImport ModuleBrowseOpenCV-android-sdk (the OpenCV dependency you have extracted) → sdk → click Open button → change module name e.g.: opencv → click Finish
      • Link the dependency
        FileProject StructureDependencies → in Modules click app folder → click + (add dependency) in Declared Dependencies → click 3 Module Dependency → checkmark opencv → click OK → if there is Modules other than app and opencv (e.g.: opencv2), please remove it by clicking - (Remove Module) and 'yes' button → click OK.
      • Configuring the app build.gradle file
        at the leftmost side menu make sure that Project tab is activated → in the dropdown arrow at the top left IDE window click Project → extend app by clicking at the arrow → click and open build.gradle in app directory → remove the line of implementation project(path: ':opencv2') but keep implementation project(path: ':opencv') → click menu bar FileSync Project with Gradle Files.
      • After sucessful, do the step in the point 4.
  6. Modify and develop the Android app, commonly by modifying code in Java and XML directories.

Thank you