Recents

Creating an Extension Library for AndroidOfficial Content

To create an extension library for Android to be used as an extensibility point you need to do some modifications to the standard Android project. Follow these steps

Variables declaration

Make sure to set the following environment variables:

  • GENEXUS_HOME to your Genexus installation directory.
  • ANDROID_HOME to your Android SDK directory.

Project creation

Create a new Android project with no activities using Android Studio.

Set it as a Library Project

Locate the file build.gradle file and change the following tag

apply plugin: 'com.android.application'

to

apply plugin: 'com.android.library'

Remove applicationId

You'll also need to remove applicationId in the defaultConfig section:

applicationId "com.example.applicationname"

minSdkVersion

Modify the minSdkVersion to 16 to match GeneXus #15 requirements

defaultConfig {
    minSdkVersion 16
    ...
}

Repositories

Add the following section to declare GeneXus repositories; needed for compilation and deployment:

repositories {
    maven { url "file:///${System.env.GENEXUS_HOME}/Android/MavenRepositories/genexusRepository" }
    maven { url "file:///${System.env.GENEXUS_HOME}/Android/MavenRepositories/thirdpartiesRepository" }
}

Project attributes

Add the following attributes, you need to match this information with the .library file.

project.group = 'com.example.libraryname'
project.version = '1.0'

Use gradle-mvn-push.gradle

Add the following section to apply the Gradle Maven plugin (gradle-mvn-push):

apply from: rootProject.file('gradle-mvn-push.gradle')

Copy the gradle-mvn-push.gradle file from the Sample project to your Android library location. You need to update the following properties according to your project:

project.version = '1.0'
project.group = 'com.example.libraryname'

AndroidManifest.xml

Locate the AndroidManifest.xml and remove the following tag

<application>
    ...
</application>

Start coding

After changing the previous default Android configuration you can start coding your extensibility points in Android.

Every time you need to push your modifications to the GeneXus environment, execute the following from the Android Library location:

gradlew uploadArchives

See Also

Extension Library concept for Extending GeneXus for Smart Devices

Was this page helpful?
What Is This?
Your feedback about this content is important. Let us know what you think.