Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

This guide will take you through the development of a new passive app plugin with an example examples of how one would develop we developed the Faros plugin.

Initialise plugin repository

To get started, download/ clone the Template plugin repository.

The following steps describe how to set up your own device repository by refactoring the template. We give examples from the Faros plugin.

...

 For renaming the package and classes (steps 3 and 4), use the refactor functionality of Android Studio (shift-F6). This also renames all references to the packages and classes.

  1. Change directory name (radar-android-template => radar-android-faros)
  2. Open the project in Android Studio.
  3. Rename the package (org.radarbase.passive.template => org.radarbase.passive.bittium).
  4. Rename the following classes. e.g.:
    • TemplateDeviceManager => FarosDeviceManager
    • TemplateDeviceServiceProvider => FarosProvider
    • TemplateDeviceService => FarosService
    • TemplateDeviceStatus => FarosDeviceStatus
  5. Edit build.gradle and input the

    Configuration parameters, in this case: 

    configuration parameters

    Code Block
    ......
    //---------------------------------------------------------------------------//
    // Configuration                                                             //
    //---------------------------------------------------------------------------//
    
    group = 'org.radarbase'
    ext.moduleName = 'radar-android-faros'
    ext.description = 'Faros plugin for RADAR passive remote monitoring app'
    ext.githubRepoName = 'RADAR-BASE/radar-android-faros'
    version = android.defaultConfig.versionName.....


  6. Edit strings.xml to give your device a label and description (used in the DeviceServiceProvider)

    Code Block
    <resources>
        <string name="farosLabel">Faros</string>
        <string name="farosDescription">Collects data from Faros 90/180/360. The connection is made over Bluetooth using the location permission. Location
            information is not stored.
        </string>
    </resources>


  7. Check the references in the AndroidManifest.xmlEdit AndroidManifest.xml to put in the references of package and service. 

    Code Block
    <?xml version="1.0" encoding="utf-8"?>
    <manifest xmlns:android="http://schemas.android.com/apk/res/android"
        package="org.radarbase.passive.bittium" >
        <application android:allowBackup="true">
            <service android:name=".FarosService"/>
        </application>
    </manifest>
    • package refers package refers to the name given to the package (step 3)
    • service android:name refers to the DeviceService class (step 4)

...