CoronaCards: Project Integration — Android

Revision Release 2024.3703
Keywords CoronaCards, Android
See also Getting Started — Android
Native/Lua Communication — Android

Overview

This guide explains how to integrate CoronaCards with a native Android project.

System Requirements

Installation

Get the desired CoronaCards framework from the download page and follow the instructions to install it.

Classes

com.ansca.corona.CoronaView is the main entry point — this is the view that should be added to your layout.

Usage/Assets

To use CoronaCards in the designer, you need to copy the .jar files into the [Project Directory]/[Application Name]/libs folder and the .so files into the [Project Directory]/[Application Name]/src/main/jniLibs/armeabi-v7a folder. A sample folder structure can be found on GitHub. Android Studio will show the CoronaView as a custom view in the designer.

Eclipse

To use CoronaCards in Eclipse, copy the .jar files into the [Project Directory]/libs folder and the .so files into the [Project Directory]/libs/armeabi-v7a folder.

Manifest

Nothing needs to be added to the manifest.

Solar2D Project

Place your Solar2D assets (i.e. main.lua) into the assets folder of your project. The CoronaView should then use this path:

CoronaView coronaView = new CoronaView(context);
coronaView.init("");
Example
CoronaView coronaView = new CoronaView(context);
// Assuming 'main.lua' and all of its assets are in a folder named 'Fishies' in the 'assets' directory:
coronaView.init("Fishies/")