Running Abstra apps natively on Android with Cordova
In this tutorial you will generate a working Android app from an Abstra app.
Also, we will be using Cordova to convert the files. So you need to have
npmto install the Cordova cli:
npm install -g cordova
The first step is to get the bundle files for your Abstra app.
Enter the project editor and go to
Releasesand scroll down to the release you want to create an Android app and download the
Android / Cordova bundle.
Unzip the file, find the folder
wwwinside and take note of that
The first step is to create the Cordova project. Go to a terminal and navigate to where the project will be located and type:
cordova create <path> <namespace> <displayname>
After that change into the directory.
The next step is adding the android platform:
cordova platform add android
You can see now that there is a
platformsfolder with and
Now that the project is created, replace the existing
wwwfolder in the root of the project with the one you downloaded previously.
Optionally you can add an icon to your app.
For this you can create a folder called
resin the project root and place an image inside it, in our example
logo.png. After that go to the
config.xmlfile and add the following lines inside the android platform
<icon src="res/logo.png" />
The final step is to build the project. To do this open a terminal on the root of the project and type
This step built your android application on the folder
platforms/android. and also created an installable APK. From here on you have many options: send the APK to your phone install it, open the application with Android Studio or tell Cordova cli to run the app.
We will show you using Android Studio and AVD (Android Virtual Device). Open Android Studio then select the AVD tab and launch one (install if needed).
After it is running, click on the play button and it will display the app on the virtual device.
After the build is complete, Cordova exports the APK to
You can copy it and send to your devices, publish it to the Google Play Store, or modify the android project itself, if you need custom access to native resources.