This is a apache cordova-android + plugins library android project that you can use like dependency to run cordova apps from your native android app
-
This project use mfdeveloper/android-fat-aar (a fork off adwiv/android-fat-aar) that contains custom gradle tasks, to generate a
.aar
file with all cordova android core dependencies fromcordova.6.2.3-release/framework-release.aar
, + cordova plugins stored in:cordovapackage/src/main/java
-
Install Java 8
-
Clone this repo and open this project with Android Studio
-
Click on
View > Tool Windows > Gradle
(or click Gradle in the tool window bar) search:cordovapackage > Tasks > build
and runassembleRelease
task.See Monitor the build process documentation
The
cordovapackage-release.aar
file will be generated on:build/outputs/aar
folder
- and gradle using command below:
sudo apt-get install gradle
- Into this project path, run the command: (or use Android Studio)
gradle assembleRelease
PS: The file cordovapackage-release.aar will be generated in:
cordovapackage/build/outputs/aar
- Import the
cordovapackage-release.aar
into your android native project fromFile > New Module > Import .JAR/.AAR package
- Add this imported module like a dependency on
buil.gradle
like this:
compile project(':my-cordova-library')
Or use like a Jitpack dependency into your(s) build.gradle
file(s):
allprojects {
repositories {
...
maven { url 'https://jitpack.io' }
}
}
dependencies {
implementation 'com.github.SerproLivre:cordova-android-library:0.0.2'
}
- The cordova-android core classes + cordova plugins will be allowed to use in your project
For while, create a issue or submit a PR with the new cordova-plugins you wish to generate a .aar
file
with this. In future, the extra plugins can be added more dinamically :)
Michel Felipe michel.ferreira@serpro.gov.br