Android
The Android Coracle renderer and is a very lightweight way of getting complex animations into your Android app with minimal dependencies.
Getting Started - Library
- Create a new project in Android Studio
- Download the latest .aar library file to your project app/lib/ directory
- Follow the Add your AAR or JAR as a dependency guide.
Note: The Android Studio dialog for adding the .aar is unhelpful and doesn't have a file chooser, if you have problems add the full path to the .aar eg. /Users/orllewin/CoracleLibraryTest/app/libs/coraclelib-release_1_0_0.aar
- Add a CoracleView to your layout:
<orllewin.coraclelib.CoracleView android:id="@+id/coracle_view" android:layout_width="match_parent" android:layout_height="match_parent"/>
- Create a Drawing instance, initialise with the Android Renderer and pass the CoracleView:
class MainActivity: AppCompatActivity() {
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
setContentView(R.layout.activity_main)
DemoCoracleDrawing()
.renderer(AndroidRenderer(findViewById(R.id.coracle_view), object: AndroidRenderer.Printer{
override fun print(message: String) {
println(message)
}
}))
.start()
}
}
Getting Started - Project Development/Standalone
If you want to use the built-in demo project to distribute your drawings follow the steps below:
- Clone the repository
- Open the Android project in Android Studio
- Develop your drawing
- Change the demo project applicationId, edit: coracle/coracleandroid/app/build.gradle and change "orllewin.coracleandroid" to your own unique package identifier
- Export .apk as normal: Build > generate signed bundle / APK
Versions
1.0.0
- Initial release
- Not implemented: Interactive mode
- Not implemented: noLoop()
- Not implemented: text(string, x, y, size)
- Not implemented: loadImage(), image() methods
- Not implemented: loadPixels(), pixel(x, y)