SerproLivre/cordova-android-library


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

Download


Step 1. Add the JitPack repository to your build file

Add it in your root settings.gradle at the end of repositories:

	dependencyResolutionManagement {
		repositoriesMode.set(RepositoriesMode.FAIL_ON_PROJECT_REPOS)
		repositories {
			mavenCentral()
			maven { url 'https://jitpack.io' }
		}
	}

Add it in your settings.gradle.kts at the end of repositories:

	dependencyResolutionManagement {
		repositoriesMode.set(RepositoriesMode.FAIL_ON_PROJECT_REPOS)
		repositories {
			mavenCentral()
			maven { url = uri("https://jitpack.io") }
		}
	}

Add to pom.xml

	<repositories>
		<repository>
		    <id>jitpack.io</id>
		    <url>https://jitpack.io</url>
		</repository>
	</repositories>

Add it in your build.sbt at the end of resolvers:

 
    resolvers += "jitpack" at "https://jitpack.io"
        
    

Add it in your project.clj at the end of repositories:

 
    :repositories [["jitpack" "https://jitpack.io"]]
        
    

Step 2. Add the dependency

	dependencies {
		implementation 'com.github.SerproLivre:cordova-android-library:0.0.3'
	}
	dependencies {
		implementation("com.github.SerproLivre:cordova-android-library:0.0.3")
	}
	<dependency>
	    <groupId>com.github.SerproLivre</groupId>
	    <artifactId>cordova-android-library</artifactId>
	    <version>0.0.3</version>
	</dependency>

                            
    libraryDependencies += "com.github.SerproLivre" % "cordova-android-library" % "0.0.3"
        
        

                            
    :dependencies [[com.github.SerproLivre/cordova-android-library "0.0.3"]]
        
        

Readme


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