How to build and run this plugin

Quick Reference if you are building/running this plugin for the first time.

  1. Build the application signing keys which are required by the Android Operating System (OS) for security when installing software packages. At the bottom of the IDE there should be a Terminal tab you can open to launch a terminal session in the root folder of the plugin.

      # Run the following commands in your Android Studio Terminal
    # Generate Debug signing key: set "alias", "keypass", and "storepass" flag values as desired
    keytool -genkeypair -dname "CN=Android Debug,O=Android,C=US" -validity 9999 -keystore debug.keystore -alias androiddebugkey -keypass android -storepass android 
    
    # Generate Release signing key: set "alias", "keypass", and "storepass" flag values as desired
    keytool -genkeypair -dname "CN=Android Release,O=Android,C=US" -validity 9999 -keystore release.keystore -alias androidreleasekey -keypass android -storepass android 
      
  2. Edit the demo-insect-classifier/local.properties file to add the following lines. <ANDROID_SDK_PATH> and the sdk.dir should already be filled out by the IDE with the default Android SDK file path <ABSOLUTE_PLUGIN_PATH> should be a complete file path to the root plugin folder; example plugin path: C\:\\tak\\atak-civ-sdk-4.5.1.13\\atak-civ\\learnatak\\demo-insect-classifier

      # the sdk.dir should be automatically assigned to the path of your Android Studio SDK 
    sdk.dir=<ANDROID_SDK_PATH>  
    takDebugKeyFile=<ABSOLUTE_PLUGIN_PATH>\\debug.keystore
    takDebugKeyFilePassword=android
    takDebugKeyAlias=androiddebugkey
    takDebugKeyPassword=android
    
    takReleaseKeyFile=<ABSOLUTE_PLUGIN_PATH>\\release.keystore
    takReleaseKeyFilePassword=android
    takReleaseKeyAlias=androidreleasekey
    takReleaseKeyPassword=android
      
  3. Make sure your JDK (java version) is set to version 11 Errors occasionally occur when Gradle settings are imported, so here are the necessary dependencies to import to run the project if they are not present.