How do I build android application without JME SDK?

I have a codebase made in Intellij idea with that plugin. It has different file structure than jme sdk project and jme ide doesn’t understand gradle and its dependencies. Can I build it on android using gradle? May be someone already have a ready-to-use gradle config or some external builder? Or may be there is a way to easily convert my project into jme sdk’s one?

Just like you‘d do a non-jme android project in your favorite IDE. Then you add the jME libraries.

1 Like

This should be / is in the wiki, but this is the general idea.

I guess the gradle part is confusing at the beginning, so I’ll show you mine, for whatever help it may be. My gradle dependencies also include the required bullet physics stuff. You might also want to ammend the jmeVersion to a release build.

apply plugin: 'com.android.application'

android {
    compileSdkVersion 27

    lintOptions {
        // Fix nifty gui referencing "java.awt" package.
        disable 'InvalidPackage'
        abortOnError false
    }

    defaultConfig {
        applicationId "com.jayfella.motorunner"
        minSdkVersion 19
        targetSdkVersion 27
        versionCode 1
        versionName "1.0"
        // testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
        multiDexEnabled true
    }

    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
    }

    packagingOptions {
        exclude 'com/simsilica/lemur/style/base/glass-styles.groovy'
    }

}

project.ext {
    jmeVersion = "[3.3,)"
    lemurVersion = "1.10.1"
    lemurProtoVersion = "1.9.1"
    lemurPropsVersion = "1.0.1"
    jacksonVer = "2.9.5"
}

dependencies {
    implementation fileTree(dir: 'libs', include: ['*.jar'])

    // testImplementation 'junit:junit:4.12'
    // androidTestImplementation 'com.android.support.test:runner:1.0.1'
    // androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.1'

    // Google / Android
    implementation "com.android.support:appcompat-v7:27.1.1"
    implementation 'com.google.android.gms:play-services-auth:15.0.1'
    implementation "com.google.android.gms:play-services-ads:15.0.1"
    implementation "com.google.firebase:firebase-core:15.0.2"

    implementation "com.android.support:customtabs:27.1.1"
    implementation "com.android.support:support-media-compat:27.1.1"
    implementation "com.android.support:support-v4:27.1.1"

    // use android-native bullet on android/desktop
    implementation "org.jmonkeyengine:jme3-core:$jmeVersion",
            "org.jmonkeyengine:jme3-android-native:$jmeVersion",
            "org.jmonkeyengine:jme3-bullet-native-android:$jmeVersion"

    // lemur
    implementation "com.simsilica:lemur:$lemurVersion",
            "com.simsilica:lemur-proto:$lemurProtoVersion"
            //"com.simsilica:lemur-props:$lemurPropsVersion",

    // jackson JSON
    implementation "com.fasterxml.jackson.core:jackson-core:$jacksonVer",
            "com.fasterxml.jackson.core:jackson-annotations:$jacksonVer",
            "com.fasterxml.jackson.core:jackson-databind:$jacksonVer"

    // android permissions
    implementation 'com.intentfilter:android-permissions:0.1.7'

    // Choose one as appropriate.

    // ANDROID
    implementation "org.jmonkeyengine:jme3-android-native:$jmeVersion"

    // DESKTOP
    /*
    implementation "org.jmonkeyengine:jme3-lwjgl:$jmeVersion",
            "org.jmonkeyengine:jme3-desktop:$jmeVersion",
            "org.jmonkeyengine:jme3-jogg:$jmeVersion",
            "org.jmonkeyengine:jme3-jogl:$jmeVersion"
    */

}


// apply from: '../android.gradle'
// apply from: '../desktop.gradle'
apply plugin: 'com.google.gms.google-services'


// Top-level build file where you can add configuration options common to all sub-projects/modules.

buildscript {
    
    repositories {
        google()
        jcenter()

        maven {
            url "https://maven.google.com"
        }
    }
    dependencies {
        classpath 'com.android.tools.build:gradle:3.1.2'
        classpath 'com.google.gms:google-services:3.2.1' // google-services plugin
        // NOTE: Do not place your application dependencies here; they belong
        // in the individual module build.gradle files
    }
}

allprojects {
    repositories {
        google()
        jcenter()
        mavenLocal()
    }
}

task clean(type: Delete) {
    delete rootProject.buildDir
}

Would be great if someone create guide for expansion file with gradle example.

What does this mean exactly? What does the given tutorial not explain? I ask because I would like to include any issues. I’m currently pretty deep into Android development, so will provide any documentation I have knowledge of.

Hi, currently I am using android studio and easily hit the 100mb quota for apk in play store (even after obfuscation). There is of course a lot documentation… https://developer.android.com/google/play/expansion-files but still practical guide for jme will be cool.

Yes, it’s easy to reach 100Mb between code and assets. My project apk is also over that size right now but it’s not finished enough to be published

It would be a good idea to get all assets into the expansion file instead of the main apk but as far as I know, at least in jme ide itself, it’s not supported :frowning: