Skip to content
Juan Corona edited this page Jul 15, 2015 · 5 revisions

Import into Android Studio

Without doing a Gradle migration, using the original project files.

Follow these steps for *nix (OSX tested)

  1. mkdir ~/root-project-location && cd ~/root-project-location
  2. git clone --recursive https://github.com/readium/SDKLauncher-Android.git
  3. Quick Start menu > Import project (Eclipse ADT, Gradle, etc.)
  4. Select ~/root-project-location/SDKLauncher-Android and not the inner SDKLauncher-Android folder
  5. Create project from existing sources > Next > Project name, location > Next
  6. Then you select the source file directories. Uncheck the two Readium_SDK_Test_Android entries to simplify things
  7. Review the libraries found, there should be a 'libs' entry with two items > Next
  8. Review suggested modules, there should be two modules named Android and SDKLauncher-Android > Next
  9. Select project SDK. Here I select Android API 21 Platform > Next
  10. Folders are scanned.. then it shows two AndroidManifest.xml files in a list > Finish
  11. While the project is indexing in Android Studio:
  12. Open a terminal again and cd ~/root-project-location/SDKLauncher-Android/readium-sdk/
  13. sh MakeHeaders.sh Android
  14. cd Platform/Android
  15. ./ndk-compile.sh build
  16. This will compile the readium-sdk, if it is successful you will see: [armeabi-v7a] Install : libepub3.so => libs/armeabi-v7a/libepub3.so
  17. Go back to Android Studio, create a Run/Debug Configuration for Android Application, select the SDKLauncher-Android module.
  18. You should be good to go.

Notes:

  • You can't build the readium-sdk native code from Android Studio you must use the ndk-compile.sh script.
  • Debugging the readium-sdk native code is not possible yet from Android Studio
Clone this wiki locally