Skip to content

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

Notifications You must be signed in to change notification settings

SerproLivre/cordova-android-library

Repository files navigation

CordovaAndroidLibrary

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

Dependencies

  • 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 from cordova.6.2.3-release/framework-release.aar, + cordova plugins stored in: cordovapackage/src/main/java

  • Install Java 8

Getting Started

Using Android Studio

  1. Clone this repo and open this project with Android Studio

  2. Click on View > Tool Windows > Gradle (or click Gradle window-gradle in the tool window bar) search :cordovapackage > Tasks > build and run assembleRelease task.

    See Monitor the build process documentation

    The cordovapackage-release.aar file will be generated on: build/outputs/aar folder

Using gradle from command line

  1. and gradle using command below:
sudo apt-get install gradle
  1. 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

  1. Import the cordovapackage-release.aar into your android native project from File > New Module > Import .JAR/.AAR package
  2. 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'
}
  1. The cordova-android core classes + cordova plugins will be allowed to use in your project

Extra cordova plugins

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 :)

Authors

Michel Felipe michel.ferreira@serpro.gov.br

About

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

Topics

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages