Follow these steps to use SAM's code generator for Android Studio:

  1. Download the library archive for armeabi, armeabi-v7a, x86. This is based on SAM 2017.9.5 so is out of date. You can try building an up-to-date library from the makefiles in https://github.com/NREL/ssc/tree/develop/build_android.
  2. Unzip libssc.zip (from SAM 2017.9.5 SSC 186) in the opened code generation folder.
  3. Create an Android Studio project with same name as the SAM case name and include C++ support, Minimum SDK API 13, an Empty Activity, C++ 11 standard.
  4. Copy the "build.gradle" and "CMakeLists.txt" files in the code generation folder to the Android Studio project "app" folder (replace existing files).
  5. Copy the "assets" folder in the code generation folder to the Android Studio project "app/src/main" folder.
  6. Copy the "native-lib.cpp" and "sscapi.h" files in the code generation folder to the Android Studio project "app/src/main/cpp" folder (replace existing file).
  7. Copy the "MainActivity.java" file in the code generation folder to the Android Studio project "app/src/main/java/com/example/" folder (replace existing file).
  8. Build project and run in emulator (x86) or Android device based (armeabi or armeabi-v7a).
  9. Send questions or comments to This email address is being protected from spambots. You need JavaScript enabled to view it..