diff --git a/.gitignore b/.gitignore index d4f4aad5ab1..c000a5911a5 100644 --- a/.gitignore +++ b/.gitignore @@ -140,6 +140,28 @@ Desktop.ini .csettings /libs/openFrameworksCompiled/project/android/paths.make +/libs/openFrameworksCompiled/project/android/**/build/ +/libs/openFrameworksCompiled/project/android/**/.cxx/ +/libs/openFrameworksCompiled/project/android/build* + +examples/android/**/build.gradle +examples/android/**/gradle.properties +examples/android/**/proguard.cfg +examples/android/**/proguard-rules.pro +examples/android/**/template.config +examples/android/**/AndroidManifest.xml +examples/android/**/OFActivity.java + +# Ignore compiled output or build dirs +examples/android/**/build/ +examples/android/**/.cxx/ + +# Ignore launcher icons or PNGs +examples/android/**/*.png + +# Ignore CMake files if autogenerated +examples/android/**/CMakeLists.txt + # Android Studio *.iml @@ -170,3 +192,5 @@ libs/openFrameworksCompiled/project/vs2019/openframeworksLib.vcxproj.user scripts/templates/vs/bin/emptyExample_debug.exe scripts/templates/vs2019/emptyExample.vcxproj.user libs/openFrameworksCompiled/project/android/build-*/ + + diff --git a/examples/android/androidAccelerometerExample/src/main.cpp b/examples/android/androidAccelerometerExample/src/main.cpp index ef340ca94b8..f98043c5a8c 100644 --- a/examples/android/androidAccelerometerExample/src/main.cpp +++ b/examples/android/androidAccelerometerExample/src/main.cpp @@ -1,26 +1,49 @@ #include "ofMain.h" #include "ofApp.h" -int main(){ - ofSetupOpenGL(1024,768, OF_WINDOW); // <-------- setup the GL context - - // this kicks off the running of my app - // can be OF_WINDOW or OF_FULLSCREEN - // pass in width and height too: - ofRunApp( new ofApp() ); - return 0; -} +#ifdef TARGET_ANDROID +#include "ofWindowSettings.h" +#include "ofGLProgrammableRenderer.h" + +shared_ptr *ofapp; +std::shared_ptr baseWindow; + +//-------------------------------------------------------------- +int main(int argc, char **argv) { + baseWindow = std::make_shared(); + ofxAndroidWindowSettings settings; + settings.glesVersion = 2; + settings.setSize(1920, 1080); + settings.windowMode = OF_WINDOW; + settings.preserveContextOnPause = true; + baseWindow = ofCreateWindow(settings); + ofapp = new shared_ptr(new ofApp()); + ofRunApp(baseWindow, *ofapp); + return 0; +} -#ifdef TARGET_ANDROID void ofAndroidApplicationInit() { - //application scope init + //application scope init } - void ofAndroidActivityInit() { - //activity scope init - main(); + //activity scope init - call main + main(0, nullptr); } + +// Callbacks from Android Layer +extern "C" JNIEXPORT void JNICALL +Java_cc_openframeworks_OFAndroid_init( JNIEnv* env, jclass clazz) +{ + ofAndroidApplicationInit(); +} + +extern "C" JNIEXPORT void JNICALL +Java_cc_openframeworks_OFAndroid_onCreate( JNIEnv* env, jclass clazz) +{ + ofAndroidActivityInit(); +} + #endif diff --git a/examples/android/androidAdvanced3DExample/src/main.cpp b/examples/android/androidAdvanced3DExample/src/main.cpp index 97fa554e6de..f98043c5a8c 100644 --- a/examples/android/androidAdvanced3DExample/src/main.cpp +++ b/examples/android/androidAdvanced3DExample/src/main.cpp @@ -1,28 +1,49 @@ #include "ofMain.h" #include "ofApp.h" +#ifdef TARGET_ANDROID +#include "ofWindowSettings.h" +#include "ofGLProgrammableRenderer.h" -int main(){ - ofSetupOpenGL(1024,768, OF_WINDOW); // <-------- setup the GL context +shared_ptr *ofapp; +std::shared_ptr baseWindow; - // this kicks off the running of my app - // can be OF_WINDOW or OF_FULLSCREEN - // pass in width and height too: - ofRunApp( new ofApp() ); - return 0; +//-------------------------------------------------------------- +int main(int argc, char **argv) { + baseWindow = std::make_shared(); + ofxAndroidWindowSettings settings; + settings.glesVersion = 2; + settings.setSize(1920, 1080); + settings.windowMode = OF_WINDOW; + settings.preserveContextOnPause = true; + baseWindow = ofCreateWindow(settings); + ofapp = new shared_ptr(new ofApp()); + ofRunApp(baseWindow, *ofapp); + return 0; } - -#ifdef TARGET_ANDROID void ofAndroidApplicationInit() { - //application scope init + //application scope init } - void ofAndroidActivityInit() { - //activity scope init - main(); + //activity scope init - call main + main(0, nullptr); } + +// Callbacks from Android Layer +extern "C" JNIEXPORT void JNICALL +Java_cc_openframeworks_OFAndroid_init( JNIEnv* env, jclass clazz) +{ + ofAndroidApplicationInit(); +} + +extern "C" JNIEXPORT void JNICALL +Java_cc_openframeworks_OFAndroid_onCreate( JNIEnv* env, jclass clazz) +{ + ofAndroidActivityInit(); +} + #endif diff --git a/examples/android/androidAssimpExample/src/main.cpp b/examples/android/androidAssimpExample/src/main.cpp index ef340ca94b8..f98043c5a8c 100644 --- a/examples/android/androidAssimpExample/src/main.cpp +++ b/examples/android/androidAssimpExample/src/main.cpp @@ -1,26 +1,49 @@ #include "ofMain.h" #include "ofApp.h" -int main(){ - ofSetupOpenGL(1024,768, OF_WINDOW); // <-------- setup the GL context - - // this kicks off the running of my app - // can be OF_WINDOW or OF_FULLSCREEN - // pass in width and height too: - ofRunApp( new ofApp() ); - return 0; -} +#ifdef TARGET_ANDROID +#include "ofWindowSettings.h" +#include "ofGLProgrammableRenderer.h" + +shared_ptr *ofapp; +std::shared_ptr baseWindow; + +//-------------------------------------------------------------- +int main(int argc, char **argv) { + baseWindow = std::make_shared(); + ofxAndroidWindowSettings settings; + settings.glesVersion = 2; + settings.setSize(1920, 1080); + settings.windowMode = OF_WINDOW; + settings.preserveContextOnPause = true; + baseWindow = ofCreateWindow(settings); + ofapp = new shared_ptr(new ofApp()); + ofRunApp(baseWindow, *ofapp); + return 0; +} -#ifdef TARGET_ANDROID void ofAndroidApplicationInit() { - //application scope init + //application scope init } - void ofAndroidActivityInit() { - //activity scope init - main(); + //activity scope init - call main + main(0, nullptr); } + +// Callbacks from Android Layer +extern "C" JNIEXPORT void JNICALL +Java_cc_openframeworks_OFAndroid_init( JNIEnv* env, jclass clazz) +{ + ofAndroidApplicationInit(); +} + +extern "C" JNIEXPORT void JNICALL +Java_cc_openframeworks_OFAndroid_onCreate( JNIEnv* env, jclass clazz) +{ + ofAndroidActivityInit(); +} + #endif diff --git a/examples/android/androidAudioExample/src/main.cpp b/examples/android/androidAudioExample/src/main.cpp index ef340ca94b8..f98043c5a8c 100644 --- a/examples/android/androidAudioExample/src/main.cpp +++ b/examples/android/androidAudioExample/src/main.cpp @@ -1,26 +1,49 @@ #include "ofMain.h" #include "ofApp.h" -int main(){ - ofSetupOpenGL(1024,768, OF_WINDOW); // <-------- setup the GL context - - // this kicks off the running of my app - // can be OF_WINDOW or OF_FULLSCREEN - // pass in width and height too: - ofRunApp( new ofApp() ); - return 0; -} +#ifdef TARGET_ANDROID +#include "ofWindowSettings.h" +#include "ofGLProgrammableRenderer.h" + +shared_ptr *ofapp; +std::shared_ptr baseWindow; + +//-------------------------------------------------------------- +int main(int argc, char **argv) { + baseWindow = std::make_shared(); + ofxAndroidWindowSettings settings; + settings.glesVersion = 2; + settings.setSize(1920, 1080); + settings.windowMode = OF_WINDOW; + settings.preserveContextOnPause = true; + baseWindow = ofCreateWindow(settings); + ofapp = new shared_ptr(new ofApp()); + ofRunApp(baseWindow, *ofapp); + return 0; +} -#ifdef TARGET_ANDROID void ofAndroidApplicationInit() { - //application scope init + //application scope init } - void ofAndroidActivityInit() { - //activity scope init - main(); + //activity scope init - call main + main(0, nullptr); } + +// Callbacks from Android Layer +extern "C" JNIEXPORT void JNICALL +Java_cc_openframeworks_OFAndroid_init( JNIEnv* env, jclass clazz) +{ + ofAndroidApplicationInit(); +} + +extern "C" JNIEXPORT void JNICALL +Java_cc_openframeworks_OFAndroid_onCreate( JNIEnv* env, jclass clazz) +{ + ofAndroidActivityInit(); +} + #endif diff --git a/examples/android/androidCameraExample/build.gradle b/examples/android/androidCameraExample/build.gradle deleted file mode 100644 index 7cbc7eb6714..00000000000 --- a/examples/android/androidCameraExample/build.gradle +++ /dev/null @@ -1,22 +0,0 @@ -ext { - //var = 'signExample.keystore' -}// Top-level build file where you can add configuration options common to all sub-projects/modules. -buildscript { - repositories { - google() - mavenCentral() - } - dependencies { - classpath 'com.android.tools.build:gradle:7.4.2' - } -} - -allprojects { - repositories { - google() - mavenCentral() - } - ext { - - } -} diff --git a/examples/android/androidCameraExample/gradle.properties b/examples/android/androidCameraExample/gradle.properties deleted file mode 100644 index 43f9ef9e1c3..00000000000 --- a/examples/android/androidCameraExample/gradle.properties +++ /dev/null @@ -1,10 +0,0 @@ -android.useAndroidX=true -android.enableJetifier=false -org.gradle.jvmargs=-Xmx2048m -Dfile.encoding=UTF-8 -kotlin.code.style=official -android.prefabVersion=1.0.+ -android.buildFeatures.prefab=true -#ndkBuild=false -# https://issuetracker.google.com/149575364 -android.enableParallelJsonGen=false -#googleplay=true \ No newline at end of file diff --git a/examples/android/androidCameraExample/gradle/wrapper/gradle-wrapper.jar b/examples/android/androidCameraExample/gradle/wrapper/gradle-wrapper.jar deleted file mode 100644 index 13372aef5e2..00000000000 Binary files a/examples/android/androidCameraExample/gradle/wrapper/gradle-wrapper.jar and /dev/null differ diff --git a/examples/android/androidCameraExample/gradle/wrapper/gradle-wrapper.properties b/examples/android/androidCameraExample/gradle/wrapper/gradle-wrapper.properties deleted file mode 100644 index 2dd5ee8c795..00000000000 --- a/examples/android/androidCameraExample/gradle/wrapper/gradle-wrapper.properties +++ /dev/null @@ -1,6 +0,0 @@ -#Mon Jun 12 01:17:57 AEST 2023 -distributionBase=GRADLE_USER_HOME -distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-7.5-bin.zip -zipStoreBase=GRADLE_USER_HOME -zipStorePath=wrapper/dists diff --git a/examples/android/androidCameraExample/gradlew b/examples/android/androidCameraExample/gradlew deleted file mode 100755 index 9d82f789151..00000000000 --- a/examples/android/androidCameraExample/gradlew +++ /dev/null @@ -1,160 +0,0 @@ -#!/usr/bin/env bash - -############################################################################## -## -## Gradle start up script for UN*X -## -############################################################################## - -# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. -DEFAULT_JVM_OPTS="" - -APP_NAME="Gradle" -APP_BASE_NAME=`basename "$0"` - -# Use the maximum available, or set MAX_FD != -1 to use that value. -MAX_FD="maximum" - -warn ( ) { - echo "$*" -} - -die ( ) { - echo - echo "$*" - echo - exit 1 -} - -# OS specific support (must be 'true' or 'false'). -cygwin=false -msys=false -darwin=false -case "`uname`" in - CYGWIN* ) - cygwin=true - ;; - Darwin* ) - darwin=true - ;; - MINGW* ) - msys=true - ;; -esac - -# Attempt to set APP_HOME -# Resolve links: $0 may be a link -PRG="$0" -# Need this for relative symlinks. -while [ -h "$PRG" ] ; do - ls=`ls -ld "$PRG"` - link=`expr "$ls" : '.*-> \(.*\)$'` - if expr "$link" : '/.*' > /dev/null; then - PRG="$link" - else - PRG=`dirname "$PRG"`"/$link" - fi -done -SAVED="`pwd`" -cd "`dirname \"$PRG\"`/" >/dev/null -APP_HOME="`pwd -P`" -cd "$SAVED" >/dev/null - -CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar - -# Determine the Java command to use to start the JVM. -if [ -n "$JAVA_HOME" ] ; then - if [ -x "$JAVA_HOME/jre/sh/java" ] ; then - # IBM's JDK on AIX uses strange locations for the executables - JAVACMD="$JAVA_HOME/jre/sh/java" - else - JAVACMD="$JAVA_HOME/bin/java" - fi - if [ ! -x "$JAVACMD" ] ; then - die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME - -Please set the JAVA_HOME variable in your environment to match the -location of your Java installation." - fi -else - JAVACMD="java" - which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. - -Please set the JAVA_HOME variable in your environment to match the -location of your Java installation." -fi - -# Increase the maximum file descriptors if we can. -if [ "$cygwin" = "false" -a "$darwin" = "false" ] ; then - MAX_FD_LIMIT=`ulimit -H -n` - if [ $? -eq 0 ] ; then - if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then - MAX_FD="$MAX_FD_LIMIT" - fi - ulimit -n $MAX_FD - if [ $? -ne 0 ] ; then - warn "Could not set maximum file descriptor limit: $MAX_FD" - fi - else - warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT" - fi -fi - -# For Darwin, add options to specify how the application appears in the dock -if $darwin; then - GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\"" -fi - -# For Cygwin, switch paths to Windows format before running java -if $cygwin ; then - APP_HOME=`cygpath --path --mixed "$APP_HOME"` - CLASSPATH=`cygpath --path --mixed "$CLASSPATH"` - JAVACMD=`cygpath --unix "$JAVACMD"` - - # We build the pattern for arguments to be converted via cygpath - ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null` - SEP="" - for dir in $ROOTDIRSRAW ; do - ROOTDIRS="$ROOTDIRS$SEP$dir" - SEP="|" - done - OURCYGPATTERN="(^($ROOTDIRS))" - # Add a user-defined pattern to the cygpath arguments - if [ "$GRADLE_CYGPATTERN" != "" ] ; then - OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)" - fi - # Now convert the arguments - kludge to limit ourselves to /bin/sh - i=0 - for arg in "$@" ; do - CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -` - CHECK2=`echo "$arg"|egrep -c "^-"` ### Determine if an option - - if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then ### Added a condition - eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"` - else - eval `echo args$i`="\"$arg\"" - fi - i=$((i+1)) - done - case $i in - (0) set -- ;; - (1) set -- "$args0" ;; - (2) set -- "$args0" "$args1" ;; - (3) set -- "$args0" "$args1" "$args2" ;; - (4) set -- "$args0" "$args1" "$args2" "$args3" ;; - (5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;; - (6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;; - (7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;; - (8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;; - (9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;; - esac -fi - -# Split up the JVM_OPTS And GRADLE_OPTS values into an array, following the shell quoting and substitution rules -function splitJvmOpts() { - JVM_OPTS=("$@") -} -eval splitJvmOpts $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS -JVM_OPTS[${#JVM_OPTS[*]}]="-Dorg.gradle.appname=$APP_BASE_NAME" - -exec "$JAVACMD" "${JVM_OPTS[@]}" -classpath "$CLASSPATH" org.gradle.wrapper.GradleWrapperMain "$@" diff --git a/examples/android/androidCameraExample/gradlew.bat b/examples/android/androidCameraExample/gradlew.bat deleted file mode 100644 index 8a0b282aa68..00000000000 --- a/examples/android/androidCameraExample/gradlew.bat +++ /dev/null @@ -1,90 +0,0 @@ -@if "%DEBUG%" == "" @echo off -@rem ########################################################################## -@rem -@rem Gradle startup script for Windows -@rem -@rem ########################################################################## - -@rem Set local scope for the variables with windows NT shell -if "%OS%"=="Windows_NT" setlocal - -@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. -set DEFAULT_JVM_OPTS= - -set DIRNAME=%~dp0 -if "%DIRNAME%" == "" set DIRNAME=. -set APP_BASE_NAME=%~n0 -set APP_HOME=%DIRNAME% - -@rem Find java.exe -if defined JAVA_HOME goto findJavaFromJavaHome - -set JAVA_EXE=java.exe -%JAVA_EXE% -version >NUL 2>&1 -if "%ERRORLEVEL%" == "0" goto init - -echo. -echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. -echo. -echo Please set the JAVA_HOME variable in your environment to match the -echo location of your Java installation. - -goto fail - -:findJavaFromJavaHome -set JAVA_HOME=%JAVA_HOME:"=% -set JAVA_EXE=%JAVA_HOME%/bin/java.exe - -if exist "%JAVA_EXE%" goto init - -echo. -echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% -echo. -echo Please set the JAVA_HOME variable in your environment to match the -echo location of your Java installation. - -goto fail - -:init -@rem Get command-line arguments, handling Windowz variants - -if not "%OS%" == "Windows_NT" goto win9xME_args -if "%@eval[2+2]" == "4" goto 4NT_args - -:win9xME_args -@rem Slurp the command line arguments. -set CMD_LINE_ARGS= -set _SKIP=2 - -:win9xME_args_slurp -if "x%~1" == "x" goto execute - -set CMD_LINE_ARGS=%* -goto execute - -:4NT_args -@rem Get arguments from the 4NT Shell from JP Software -set CMD_LINE_ARGS=%$ - -:execute -@rem Setup the command line - -set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar - -@rem Execute Gradle -"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS% - -:end -@rem End local scope for the variables with windows NT shell -if "%ERRORLEVEL%"=="0" goto mainEnd - -:fail -rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of -rem the _cmd.exe /c_ return code! -if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1 -exit /b 1 - -:mainEnd -if "%OS%"=="Windows_NT" endlocal - -:omega diff --git a/examples/android/androidCameraExample/ofApp/build.gradle b/examples/android/androidCameraExample/ofApp/build.gradle deleted file mode 100644 index 50b511c1c1f..00000000000 --- a/examples/android/androidCameraExample/ofApp/build.gradle +++ /dev/null @@ -1,182 +0,0 @@ -plugins { - id 'com.android.application' -} - -def CMAKELIST_PATH = './src/main/cpp' -def CPP_SOURCE = './src/main/cpp' -def JAVA_SOURCE = './src/main/java' - -// pointing to cmake's source code for the same project -def PRJ_SRC_ROOT = './src/main' -def ofRoot(){ return '../../../../' } -final ofSource = ofRoot() + 'libs/openFrameworks' -final ofLibs = ofRoot() + 'libs' -final addons = ofRoot() + 'addons' -final ofLibOutput = ofRoot() + 'libs/openFrameworksCompiled/lib/android' -def OFX_ANDROID = ofRoot() + 'addons/ofxAndroid' -//def OF_ADDONS_ARGUMENTS = "${OF_ADDONS}" -def enableProguardInReleaseBuilds = true -def enableProguardInDebugBuilds = false - -task wrapper(type: Wrapper) { - gradleVersion = '7.3.3' -} -tasks.register("prepareKotlinBuildScriptModel"){ -} - -evaluationDependsOn(':openFrameworksProject') - -tasks.whenTaskAdded { task -> - if (task.name == 'assemble') { - task.dependsOn(':openFrameworksProject:assemble') - } -} - - -android { - compileSdkVersion 34 - buildToolsVersion '32.0.0' - //ndkPath "/Users/x/android-ndk-r21e" // Point to your own NDK if needed - ndkVersion '24.0.8215888' // use android studio side loaded ndk - buildFeatures { - prefab true - } - signingConfigs { - debug { - } - release { - storeFile new File("${System.properties['user.home']}/.android/debug.keystore") - storePassword 'android' - storeType "jks" - keyAlias 'androiddebugkey' - keyPassword 'android' - } - } - defaultConfig { - applicationId "cc.openframeworks.androidCameraExample" // IMPORTANT : THIS DEFINES THE ID OF THE APK - minSdkVersion 21 - targetSdkVersion 34 - versionCode 12 - versionName '12.0' - ndk.abiFilters 'armeabi-v7a', 'arm64-v8a', 'x86' //, 'x86_64' - - externalNativeBuild { - if (!project.hasProperty("ndkBuild")) { - cmake { - arguments "-DANDROID_STL=c++_shared", - "-DANDROID_ARM_NEON=TRUE", - "-DANDROID_TOOLCHAIN=clang", - //"${OF_ADDONS_ARGUMENTS}", - "-DTARGET_OPENGLES=TRUE" - - version '3.22.1' - } - } - } - multiDexEnabled false - } - buildTypes { - release { - signingConfig signingConfigs.release - jniDebuggable false - debuggable false - minifyEnabled false - shrinkResources false - proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro' - signingConfig signingConfigs.release - } - debug { - jniDebuggable true - debuggable true - minifyEnabled false - shrinkResources false - signingConfig signingConfigs.debug - } - } - flavorDimensions "version" - productFlavors { - playstore { - applicationIdSuffix "" - signingConfig signingConfigs.release - } -// humble { -// applicationIdSuffix ".humble" -// } -// amazon { -// applicationIdSuffix ".amazon" -// } -// samsung { -// applicationIdSuffix ".samsung" -// } -// oppo { -// applicationIdSuffix ".oppo" -// } - } - sourceSets { - main { - manifest.srcFile "${PRJ_SRC_ROOT}/AndroidManifest.xml" - java.srcDirs = ["${PRJ_SRC_ROOT}/java", - "${OFX_ANDROID}/Java"] - res.srcDirs = ["${PRJ_SRC_ROOT}/res"] -// jniLibs.srcDirs = ["${OF_ANDROID_OUTPUT}", "lib"] // Pre Android Studio 2022.2.1 - assets { - srcDirs 'src/main/assets', 'src/main/bin/data' - } - } - } - externalNativeBuild { - if (!project.hasProperty("ndkBuild")) { - cmake { - path "${CMAKELIST_PATH}/CMakeLists.txt" - } - } else { - ndkBuild { - path "${CMAKELIST_PATH}/Android.mk" - } - } - } - compileOptions { - sourceCompatibility JavaVersion.VERSION_1_8 - targetCompatibility JavaVersion.VERSION_1_8 - } - androidResources { - noCompress '' - } - dependenciesInfo { - includeInApk false - includeInBundle false - } -// testOptions { -// devices { -// pixel2api29 (com.android.build.api.dsl.ManagedVirtualDevice) { -// // Use device profiles you typically see in -// // Android Studio -// device = "Pixel 2" -// apiLevel = 29 -// // You can also specify "aosp" if you don’t require -// // Google Play Services. -// systemImageSource = "google" -// abi = "x86" -// } -// } -// } -} - - -dependencies { - implementation fileTree(dir: 'libs', include: ['*.jar']) - implementation 'androidx.appcompat:appcompat:1.6.1' - implementation 'androidx.constraintlayout:constraintlayout:2.1.4' - implementation 'androidx.legacy:legacy-support-v4:1.0.0' - implementation "com.getkeepsafe.relinker:relinker:1.4.5" - implementation 'com.google.android.material:material:1.9.0' - if (project.hasProperty("googleplay")) { - implementation "com.google.android.gms:play-services-games:22.0.1" - implementation "com.google.android.gms:play-services-auth:20.0.1" - implementation "com.google.android.gms:play-services-base:18.0.1" - implementation "com.google.android.gms:play-services-basement:18.0.0" - implementation "com.google.android.gms:play-services-instantapps:18.0.1" - implementation "com.google.android.gms:play-services-appset:16.0.2" - } -} - diff --git a/examples/android/androidCameraExample/ofApp/proguard-rules.pro b/examples/android/androidCameraExample/ofApp/proguard-rules.pro deleted file mode 100644 index de8c62143ce..00000000000 --- a/examples/android/androidCameraExample/ofApp/proguard-rules.pro +++ /dev/null @@ -1,127 +0,0 @@ -# Add project specific ProGuard rules here. -# You can control the set of applied configuration files using the -# proguardFiles setting in build.gradle. -# -# For more details, see -# http://developer.android.com/guide/developing/tools/proguard.html - --dontoptimize --dontshrink -#-dontusemixedcaseclassnames -#-dontskipnonpubliclibraryclasses -#-dontpreverify -#-verbose -# --optimizationpasses 7 # use for final build --dontusemixedcaseclassnames -#-dontskipnonpubliclibraryclasses -#-dontpreverify --verbose - -# custom app activity proguard --keep public class cc.openframeworks.android.OFActivity { public ; } --keep public class cc.openframeworks.android.R { public ; } - - -#-dontobfuscate android classes --keep public class * extends android.app.Activity --keep public class * extends android.app.Application --keep public class * extends android.app.Service --keep public class * extends android.content.BroadcastReceiver --keep public class * extends android.content.ContentProvider --keep public class * extends android.app.backup.BackupAgentHelper --keep public class * extends android.preference.Preference - -#-dontobfuscate openFrameworks android classes --keep public class cc.openframeworks.OFAndroid { public ; } --keep public class cc.openframeworks.OFAndroidLifeCycleHelper { public ; } --keep public class cc.openframeworks.OFAndroidWindow { public ; } --keep public class cc.openframeworks.OFAndroidSoundPlayer { public ; } --keep public class cc.openframeworks.OFGLSurfaceView { public ; } --keep public class cc.openframeworks.OFAndroidLifeCycle { public ; } --keep public class cc.openframeworks.OFActivity { public ; } --keep public class cc.openframeworks.ContextFactory { public ; } --keep public class cc.openframeworks.OFEGLConfigChooser { public ; } --keep public class cc.openframeworks.OFGestureListener { public ; } --keep public class cc.openframeworks.OFAndroidController { public ; } - -#-dontobfuscate GooglePlay Games android classes if used --keep class com.google.android.gms.games.leaderboard.** { *; } --keep class com.google.android.gms.games.snapshot.** { *; } --keep class com.google.android.gms.games.achievement.** { *; } --keep class com.google.android.gms.games.event.** { *; } --keep class com.google.android.gms.games.stats.** { *; } --keep class com.google.android.gms.games.video.** { *; } --keep class com.google.android.gms.games.* { *; } --keep class com.google.android.gms.signin.** { *; } --keep class com.google.android.gms.dynamic.** { *; } --keep class com.google.android.gms.dynamite.** { *; } --keep class com.google.android.gms.tasks.** { *; } --keep class com.google.android.gms.security.** { *; } --keep class com.google.android.gms.base.** { *; } --keep class com.google.android.gms.actions.** { *; } --keep class com.google.games.bridge.** { *; } --keep class com.google.android.gms.common.api.** { *; } --keep class com.google.android.gms.games.quest.** { *; } --keep class com.google.android.gms.nearby.** { *; } - --keepclasseswithmembernames class * { - native ; -} - --keepclasseswithmembers class * { - public (android.content.Context, android.util.AttributeSet); -} - --keepclasseswithmembers class * { - public (android.content.Context, android.util.AttributeSet, int); -} - -# note that means any method --keepclasseswithmembernames,includedescriptorclasses class * { - native ; -} - --keepclassmembers class * extends android.app.Activity { - public void *(android.view.View); -} - --keepclassmembers enum * { - public static **[] values(); - public static ** valueOf(java.lang.String); -} - --keep class * implements android.os.Parcelable { - public static final android.os.Parcelable$Creator *; -} - - -# If your project uses WebView with JS, uncomment the following -# and specify the fully qualified class name to the JavaScript interface -# class: -#-keepclassmembers class fqcn.of.javascript.interface.for.webview { -# public *; -#} - -# Uncomment this to preserve the line number information for -# debugging stack traces. -#-keepattributes SourceFile,LineNumberTable - -# If you keep the line number information, uncomment this to -# hide the original source file name. -#-renamesourcefileattribute SourceFile - -# If your project uses WebView with JS, uncomment the following -# and specify the fully qualified class name to the JavaScript interface -# class: -#-keepclassmembers class fqcn.of.javascript.interface.for.webview { -# public *; -#} - -# Uncomment this to preserve the line number information for -# debugging stack traces. --keepattributes SourceFile,LineNumberTable - -# If you keep the line number information, uncomment this to -# hide the original source file name. -#-renamesourcefileattribute SourceFile \ No newline at end of file diff --git a/examples/android/androidCameraExample/ofApp/src/main/AndroidManifest.xml b/examples/android/androidCameraExample/ofApp/src/main/AndroidManifest.xml deleted file mode 100644 index d29c44958e7..00000000000 --- a/examples/android/androidCameraExample/ofApp/src/main/AndroidManifest.xml +++ /dev/null @@ -1,91 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/examples/android/androidCameraExample/ofApp/src/main/cpp/CMakeLists.txt b/examples/android/androidCameraExample/ofApp/src/main/cpp/CMakeLists.txt deleted file mode 100644 index 5b160ffa42d..00000000000 --- a/examples/android/androidCameraExample/ofApp/src/main/cpp/CMakeLists.txt +++ /dev/null @@ -1,142 +0,0 @@ -# Sets the minimum version of CMake required to build the native -# library. -cmake_minimum_required(VERSION 3.22.1) - -project(ofapp LANGUAGES CXX) -set(TARGET_ANDROID TRUE) - -set(LOCAL_PATH ${CMAKE_SOURCE_DIR}) -set(PRJ_OF_ROOT ${LOCAL_PATH}/../../../../../../../) - -set(PURE_OF_ROOT ${LOCAL_PATH}/../../../../../../../) -set(CORE_OF_ROOT ${PURE_OF_ROOT}/libs/openFrameworks) -set(LIBS_ROOT ${PURE_OF_ROOT}/libs) - -set(PRJ_ADDONS_PATH ${PURE_OF_ROOT}/addons) -set(PRJ_SOURCE_PATH ${LIBS_ROOT}/openFrameworks) -set(PRJ_LIBS_ROOT ${PURE_OF_ROOT}/libs) - -set(OF_ANDROID ${PURE_OF_ROOT}/libs/openFrameworksCompiled/project/android) -set(OF_ANDROID_OUTPUT ${PURE_OF_ROOT}/libs/openFrameworksCompiled/lib/android) - -set(PRJ_OFX_ANDROID_PATH ${PRJ_ADDONS_PATH}/ofxAndroid) -set(PRJ_OFX_ANDROID_CPP_PATH ${PRJ_OFX_ANDROID_PATH}/src) - -macro(print_all_variables) - message(STATUS "print_all_variables------------------------------------------{") - get_cmake_property(_variableNames VARIABLES) - foreach (_variableName ${_variableNames}) - message(STATUS "${_variableName}=${${_variableName}}") - endforeach() - message(STATUS "print_all_variables------------------------------------------}") -endmacro() - -# Custom function to check if the library is built -function(check_library) - if (NOT TARGET openFrameworksAndroid) - message(STATUS "openFrameworksAndroid Library not found. Building library...") - - # Invoke the build process for the library - execute_process( - COMMAND ${CMAKE_COMMAND} --build ${OF_ANDROID}/ - RESULT_VARIABLE result - ) - if (result) - message(FATAL_ERROR "Failed to build the library.") - endif () - endif () -endfunction() - -set(CMAKE_CXX_STANDARD 17) -set(CMAKE_CXX_STANDARD_REQUIRED ON) -set(CMAKE_CXX_EXTENSIONS ON) -set(TARGET_ANDROID ON) -set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -std=c17 -Oz -DNDEBUG -frtti --warn-uninitialized -fno-short-enums -Wextra -fPIE -fPIC -fuse-ld=gold -fexceptions -ffunction-sections -fdata-sections -Wall -Wextra -Wfloat-equal -Wundef -Werror -fverbose-asm -Wint-to-pointer-cast -Wshadow -Wpointer-arith -Wcast-align -Wstrict-prototypes -Wcast-qual -Wmissing-prototypes -Wstrict-overflow=5 -Wwrite-strings -Wconversion --pedantic-errors") -set(CMAKE_CPP_FLAGS "${CMAKE_C_FLAGS} -std=c++17 -Oz -DNDEBUG -stdlib=libc++ --warn-uninitialized -frtti -Wextra -fno-short-enums -fPIE -fPIC -fuse-ld=gold -fexceptions -ffunction-sections -fdata-sections -Wall -Wextra -Wfloat-equal -Wundef -Werror -fverbose-asm -Wint-to-pointer-cast -Wshadow -Wpointer-arith -Wcast-align -Wstrict-prototypes -Wcast-qual -Wmissing-prototypes -Wstrict-overflow=5 -Wwrite-strings -Wconversion --pedantic-errors") -set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -Wl,-export-dynamic") - -print_all_variables() - -# Creates the project's shared lib: libnative-lib.so. -# The lib is loaded by this project's Java code in MainActivity.java: -# System.loadLibrary("native-lib"); -# The lib name in both places must match. -add_library( ofapp #name - SHARED # type of library - # src files for project (just c/cpp) - ${CMAKE_SOURCE_DIR}/main.cpp - ${CMAKE_SOURCE_DIR}/ofApp.cpp - ) - - -# Specifies a path to native header files -include_directories( - # openFrameworks headers - ${PRJ_SOURCE_PATH}/3d - ${PRJ_SOURCE_PATH}/app - ${PRJ_SOURCE_PATH}/communication - ${PRJ_SOURCE_PATH}/events - ${PRJ_SOURCE_PATH}/gl - ${PRJ_SOURCE_PATH}/graphics - ${PRJ_SOURCE_PATH}/math - ${PRJ_SOURCE_PATH}/sound - ${PRJ_SOURCE_PATH}/types - ${PRJ_SOURCE_PATH}/utils - ${PRJ_SOURCE_PATH}/video - ${PRJ_SOURCE_PATH} - # openFrameworks addons includes - ${PURE_OF_ROOT}/addons/ofxAndroid/src - ${PURE_OF_ROOT}/addons/ofxAccelerometer/src - ${PURE_OF_ROOT}/addons/ofxXmlSettings/src - ${PURE_OF_ROOT}/addons/ofxXmlSettings/libs - # openFrameworks Libs includes - ${PRJ_LIBS_ROOT}/FreeImage/include - ${PRJ_LIBS_ROOT}/freetype/include - ${PRJ_LIBS_ROOT}/freetype/include/freetype2 - ${PRJ_LIBS_ROOT}/freetype/include/freetype2/freetype/config - ${PRJ_LIBS_ROOT}/freetype/include/freetype2/freetype/internal - ${PRJ_LIBS_ROOT}/freetype/include/freetype2/freetype/internal/services - ${PRJ_LIBS_ROOT}/glm/include - ${PRJ_LIBS_ROOT}/pugixml/include - ${PRJ_LIBS_ROOT}/json/include - ${PRJ_LIBS_ROOT}/tess2/include - ${PRJ_LIBS_ROOT}/utf8/include - ${PRJ_LIBS_ROOT}/uriparser/include - ${CMAKE_SOURCE_DIR}/ - ${CMAKE_SOURCE_DIR}/ - ${OF_ANDROID} -) - -find_library(android-lib android) -find_library(log-lib log) -find_library(GLES2-lib GLESv2) - -#find_library(GLES1-lib GLESv1_CM) -#find_library(GLES3-lib GLESv3) - - -target_link_libraries(ofapp - EGL - GLESv2 - log - c - m - z - dl -# GLESv3 - ) - -target_link_libraries( ofapp - ${android-lib} ) -target_link_libraries( ofapp - ${GLES2-lib} ) -target_link_libraries( ofapp - ${log-lib} ) -#target_link_libraries( ofApp -# ${GLES3-lib} ) -#target_link_libraries( ofApp -# ${GLES1-lib} ) - -# Finally link in openFrameworks Library for each ABI -target_link_libraries( ofapp - ${OF_ANDROID_OUTPUT}/${ANDROID_ABI}/libopenFrameworksAndroid.so) diff --git a/examples/android/androidCameraExample/ofApp/src/main/ic_launcher-playstore.png b/examples/android/androidCameraExample/ofApp/src/main/ic_launcher-playstore.png deleted file mode 100644 index 2a0df19f5e0..00000000000 Binary files a/examples/android/androidCameraExample/ofApp/src/main/ic_launcher-playstore.png and /dev/null differ diff --git a/examples/android/androidCameraExample/ofApp/src/main/java/cc/openframeworks/android/OFActivity.java b/examples/android/androidCameraExample/ofApp/src/main/java/cc/openframeworks/android/OFActivity.java deleted file mode 100644 index 598ee50bbf1..00000000000 --- a/examples/android/androidCameraExample/ofApp/src/main/java/cc/openframeworks/android/OFActivity.java +++ /dev/null @@ -1,201 +0,0 @@ -package cc.openframeworks.android; - -import android.os.Build; -import android.os.Bundle; -import android.util.Log; -import android.view.Menu; -import android.view.MenuItem; -import android.view.View; -import android.view.WindowManager; - -import androidx.core.view.ViewCompat; -import androidx.core.view.WindowCompat; -import androidx.core.view.WindowInsetsCompat; -import androidx.core.view.WindowInsetsControllerCompat; - -import cc.openframeworks.OFAndroid; -import cc.openframeworks.OFAndroidLifeCycle; - -import com.getkeepsafe.relinker.ReLinker; - - - -public class OFActivity extends cc.openframeworks.OFActivity { - - private static final String appName = "ofapp"; // modify this to target appName (ofApp etc) - private static final String LOG_TAG = appName + "::OFActivity"; - - private ReLinker.Logger logcatLogger = new ReLinker.Logger() { - @Override - public void log(String message) { - Log.d("ReLinker", message); - } - }; - private OFActivity thisActivity; - - - // Extremely important - public OFActivity() { - OFAndroidLifeCycle.coreLibraryLoaded = true; - - OFAndroid.maxSamples = 4; - OFAndroid.maximumFrameRate = 144; - - thisActivity = this; - ReLinker.log(logcatLogger) - .force() - .recursively() - .loadLibrary(this, appName, new ReLinker.LoadListener() { - @Override - public void success() { - Log.i(LOG_TAG, "loadLibrary success"); - OFAndroidLifeCycle.appLibraryLoaded = true; - Setup(); // very important - this will in turn call main - } - - @Override - public void failure(Throwable t) { - /* Boo */ - Log.i(LOG_TAG, "loadLibrary failure" + t.getMessage()); - } - }); - } - - @Override - public void onCreate(Bundle savedInstanceState) - { - Log.i(LOG_TAG, "onCreate"); - super.onCreate(savedInstanceState); - - setFullscreen(); - hideSystemBars(); - } - - @Override - public void onStart() { - super.onStart(); - - } - - @Override - public void onDetachedFromWindow() { - - } - - // Menus - // http://developer.android.com/guide/topics/ui/menus.html - @Override - public boolean onCreateOptionsMenu(Menu menu) { - // Create settings menu options from here, one by one or infalting an xml - return super.onCreateOptionsMenu(menu); - } - - @Override - public boolean onOptionsItemSelected(MenuItem item) { - // This passes the menu option string to OF - // you can add additional behavior from java modifying this method - // but keep the call to OFAndroid so OF is notified of menu events - if(OFAndroid.menuItemSelected(item.getItemId())){ - - return true; - } - return super.onOptionsItemSelected(item); - } - - - @Override - public boolean onPrepareOptionsMenu (Menu menu){ - // This method is called every time the menu is opened - // you can add or remove menu options from here - return super.onPrepareOptionsMenu(menu); - } - - public void onRestore() { - - if (!OFAndroidLifeCycle.appLibraryLoaded) return; - } - - private void hideSystemBars() { - WindowInsetsControllerCompat windowInsetsController = - ViewCompat.getWindowInsetsController(getWindow().getDecorView()); - if (windowInsetsController == null) { - return; - } - // Configure the behavior of the hidden system bars - windowInsetsController.setSystemBarsBehavior( - WindowInsetsControllerCompat.BEHAVIOR_SHOW_TRANSIENT_BARS_BY_SWIPE - ); - // Hide both the status bar and the navigation bar - windowInsetsController.hide(WindowInsetsCompat.Type.systemBars()); - } - - @Override - public void onWindowFocusChanged(boolean hasFocus) { - super.onWindowFocusChanged(hasFocus); - - if (hasFocus) { - if (Build.VERSION.SDK_INT < Build.VERSION_CODES.KITKAT) { - - setFullscreen(); - } else { - setFullscreen(); - } - } else { - - } - } - - private void handleException(Exception e, String details) { - Log.e(LOG_TAG, "Exception:", e); - - } - - public void setFullscreen() { - try { - if (Build.VERSION.SDK_INT < Build.VERSION_CODES.KITKAT) { - // No sticky immersive mode for devices pre-kitkat - getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN, - WindowManager.LayoutParams.FLAG_FULLSCREEN); - } else { - View decorView = getWindow().getDecorView(); -// int uiOptions = View.SYSTEM_UI_FLAG_FULLSCREEN; - int uiOptions = View.SYSTEM_UI_FLAG_LAYOUT_STABLE - | View.SYSTEM_UI_FLAG_LAYOUT_HIDE_NAVIGATION - | View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN - | View.SYSTEM_UI_FLAG_HIDE_NAVIGATION - | View.SYSTEM_UI_FLAG_FULLSCREEN - | View.SYSTEM_UI_FLAG_IMMERSIVE_STICKY; - decorView.setSystemUiVisibility(uiOptions); - } - - WindowCompat.setDecorFitsSystemWindows(getWindow(), false); - - } catch (Exception ex) { - handleException(ex, "setFullscreen exception"); - } - - try { - View decorView = getWindow().getDecorView(); - int[] locations = new int[2]; - decorView.getLocationInWindow(locations); - int[] locations2 = new int[2]; - decorView.getLocationOnScreen(locations2); - - } catch (Exception ex) { - handleException(ex, "setFullscreen exception"); - } - - WindowInsetsControllerCompat windowInsetsController = - ViewCompat.getWindowInsetsController(getWindow().getDecorView()); - if (windowInsetsController == null) { - return; - } - // Hide both the status bar and the navigation bar - windowInsetsController.hide(WindowInsetsCompat.Type.systemBars()); - windowInsetsController.hide(WindowInsetsCompat.Type.navigationBars()); - windowInsetsController.hide(WindowInsetsCompat.Type.statusBars()); - } - - -} - diff --git a/examples/android/androidCameraExample/ofApp/src/main/res/drawable-hdpi/icon.png b/examples/android/androidCameraExample/ofApp/src/main/res/drawable-hdpi/icon.png deleted file mode 100644 index 70b562fba01..00000000000 Binary files a/examples/android/androidCameraExample/ofApp/src/main/res/drawable-hdpi/icon.png and /dev/null differ diff --git a/examples/android/androidCameraExample/ofApp/src/main/res/drawable-mdpi/icon.png b/examples/android/androidCameraExample/ofApp/src/main/res/drawable-mdpi/icon.png deleted file mode 100644 index 70b562fba01..00000000000 Binary files a/examples/android/androidCameraExample/ofApp/src/main/res/drawable-mdpi/icon.png and /dev/null differ diff --git a/examples/android/androidCameraExample/ofApp/src/main/res/drawable-xhdpi/icon.png b/examples/android/androidCameraExample/ofApp/src/main/res/drawable-xhdpi/icon.png deleted file mode 100644 index 70b562fba01..00000000000 Binary files a/examples/android/androidCameraExample/ofApp/src/main/res/drawable-xhdpi/icon.png and /dev/null differ diff --git a/examples/android/androidCameraExample/ofApp/src/main/res/drawable/icon.png b/examples/android/androidCameraExample/ofApp/src/main/res/drawable/icon.png deleted file mode 100644 index 70b562fba01..00000000000 Binary files a/examples/android/androidCameraExample/ofApp/src/main/res/drawable/icon.png and /dev/null differ diff --git a/examples/android/androidCameraExample/ofApp/src/main/res/layout/main_layout.xml b/examples/android/androidCameraExample/ofApp/src/main/res/layout/main_layout.xml deleted file mode 100644 index d1da461f079..00000000000 --- a/examples/android/androidCameraExample/ofApp/src/main/res/layout/main_layout.xml +++ /dev/null @@ -1,24 +0,0 @@ - - - - - - diff --git a/examples/android/androidCameraExample/ofApp/src/main/res/menu/main_layout.xml b/examples/android/androidCameraExample/ofApp/src/main/res/menu/main_layout.xml deleted file mode 100644 index 7ddcfbee35e..00000000000 --- a/examples/android/androidCameraExample/ofApp/src/main/res/menu/main_layout.xml +++ /dev/null @@ -1,8 +0,0 @@ - - - - - \ No newline at end of file diff --git a/examples/android/androidCameraExample/ofApp/src/main/res/mipmap-anydpi-v26/ic_launcher.xml b/examples/android/androidCameraExample/ofApp/src/main/res/mipmap-anydpi-v26/ic_launcher.xml deleted file mode 100644 index 036d09bc5fd..00000000000 --- a/examples/android/androidCameraExample/ofApp/src/main/res/mipmap-anydpi-v26/ic_launcher.xml +++ /dev/null @@ -1,5 +0,0 @@ - - - - - \ No newline at end of file diff --git a/examples/android/androidCameraExample/ofApp/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml b/examples/android/androidCameraExample/ofApp/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml deleted file mode 100644 index 036d09bc5fd..00000000000 --- a/examples/android/androidCameraExample/ofApp/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml +++ /dev/null @@ -1,5 +0,0 @@ - - - - - \ No newline at end of file diff --git a/examples/android/androidCameraExample/ofApp/src/main/res/mipmap-hdpi/ic_launcher.png b/examples/android/androidCameraExample/ofApp/src/main/res/mipmap-hdpi/ic_launcher.png deleted file mode 100644 index 42b40d2fbec..00000000000 Binary files a/examples/android/androidCameraExample/ofApp/src/main/res/mipmap-hdpi/ic_launcher.png and /dev/null differ diff --git a/examples/android/androidCameraExample/ofApp/src/main/res/mipmap-hdpi/ic_launcher_foreground.png b/examples/android/androidCameraExample/ofApp/src/main/res/mipmap-hdpi/ic_launcher_foreground.png deleted file mode 100644 index 648779fe415..00000000000 Binary files a/examples/android/androidCameraExample/ofApp/src/main/res/mipmap-hdpi/ic_launcher_foreground.png and /dev/null differ diff --git a/examples/android/androidCameraExample/ofApp/src/main/res/mipmap-hdpi/ic_launcher_round.png b/examples/android/androidCameraExample/ofApp/src/main/res/mipmap-hdpi/ic_launcher_round.png deleted file mode 100644 index a39d8826804..00000000000 Binary files a/examples/android/androidCameraExample/ofApp/src/main/res/mipmap-hdpi/ic_launcher_round.png and /dev/null differ diff --git a/examples/android/androidCameraExample/ofApp/src/main/res/mipmap-mdpi/ic_launcher.png b/examples/android/androidCameraExample/ofApp/src/main/res/mipmap-mdpi/ic_launcher.png deleted file mode 100644 index 13e6dfef882..00000000000 Binary files a/examples/android/androidCameraExample/ofApp/src/main/res/mipmap-mdpi/ic_launcher.png and /dev/null differ diff --git a/examples/android/androidCameraExample/ofApp/src/main/res/mipmap-mdpi/ic_launcher_foreground.png b/examples/android/androidCameraExample/ofApp/src/main/res/mipmap-mdpi/ic_launcher_foreground.png deleted file mode 100644 index 67b93c29890..00000000000 Binary files a/examples/android/androidCameraExample/ofApp/src/main/res/mipmap-mdpi/ic_launcher_foreground.png and /dev/null differ diff --git a/examples/android/androidCameraExample/ofApp/src/main/res/mipmap-mdpi/ic_launcher_round.png b/examples/android/androidCameraExample/ofApp/src/main/res/mipmap-mdpi/ic_launcher_round.png deleted file mode 100644 index 93401eaf855..00000000000 Binary files a/examples/android/androidCameraExample/ofApp/src/main/res/mipmap-mdpi/ic_launcher_round.png and /dev/null differ diff --git a/examples/android/androidCameraExample/ofApp/src/main/res/mipmap-xhdpi/ic_launcher.png b/examples/android/androidCameraExample/ofApp/src/main/res/mipmap-xhdpi/ic_launcher.png deleted file mode 100644 index 018f9b90738..00000000000 Binary files a/examples/android/androidCameraExample/ofApp/src/main/res/mipmap-xhdpi/ic_launcher.png and /dev/null differ diff --git a/examples/android/androidCameraExample/ofApp/src/main/res/mipmap-xhdpi/ic_launcher_foreground.png b/examples/android/androidCameraExample/ofApp/src/main/res/mipmap-xhdpi/ic_launcher_foreground.png deleted file mode 100644 index fc64ec1c838..00000000000 Binary files a/examples/android/androidCameraExample/ofApp/src/main/res/mipmap-xhdpi/ic_launcher_foreground.png and /dev/null differ diff --git a/examples/android/androidCameraExample/ofApp/src/main/res/mipmap-xhdpi/ic_launcher_round.png b/examples/android/androidCameraExample/ofApp/src/main/res/mipmap-xhdpi/ic_launcher_round.png deleted file mode 100644 index 486c62f1f2a..00000000000 Binary files a/examples/android/androidCameraExample/ofApp/src/main/res/mipmap-xhdpi/ic_launcher_round.png and /dev/null differ diff --git a/examples/android/androidCameraExample/ofApp/src/main/res/mipmap-xxhdpi/ic_launcher.png b/examples/android/androidCameraExample/ofApp/src/main/res/mipmap-xxhdpi/ic_launcher.png deleted file mode 100644 index cf6c612f8b1..00000000000 Binary files a/examples/android/androidCameraExample/ofApp/src/main/res/mipmap-xxhdpi/ic_launcher.png and /dev/null differ diff --git a/examples/android/androidCameraExample/ofApp/src/main/res/mipmap-xxhdpi/ic_launcher_foreground.png b/examples/android/androidCameraExample/ofApp/src/main/res/mipmap-xxhdpi/ic_launcher_foreground.png deleted file mode 100644 index 07b98443e1b..00000000000 Binary files a/examples/android/androidCameraExample/ofApp/src/main/res/mipmap-xxhdpi/ic_launcher_foreground.png and /dev/null differ diff --git a/examples/android/androidCameraExample/ofApp/src/main/res/mipmap-xxhdpi/ic_launcher_round.png b/examples/android/androidCameraExample/ofApp/src/main/res/mipmap-xxhdpi/ic_launcher_round.png deleted file mode 100644 index b4024c5aa00..00000000000 Binary files a/examples/android/androidCameraExample/ofApp/src/main/res/mipmap-xxhdpi/ic_launcher_round.png and /dev/null differ diff --git a/examples/android/androidCameraExample/ofApp/src/main/res/mipmap-xxxhdpi/ic_launcher.png b/examples/android/androidCameraExample/ofApp/src/main/res/mipmap-xxxhdpi/ic_launcher.png deleted file mode 100644 index 60b1a9e8332..00000000000 Binary files a/examples/android/androidCameraExample/ofApp/src/main/res/mipmap-xxxhdpi/ic_launcher.png and /dev/null differ diff --git a/examples/android/androidCameraExample/ofApp/src/main/res/mipmap-xxxhdpi/ic_launcher_foreground.png b/examples/android/androidCameraExample/ofApp/src/main/res/mipmap-xxxhdpi/ic_launcher_foreground.png deleted file mode 100644 index 45bd0178fee..00000000000 Binary files a/examples/android/androidCameraExample/ofApp/src/main/res/mipmap-xxxhdpi/ic_launcher_foreground.png and /dev/null differ diff --git a/examples/android/androidCameraExample/ofApp/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png b/examples/android/androidCameraExample/ofApp/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png deleted file mode 100644 index 1b64c2ce02d..00000000000 Binary files a/examples/android/androidCameraExample/ofApp/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png and /dev/null differ diff --git a/examples/android/androidCameraExample/ofApp/src/main/res/values-v11/strings.xml b/examples/android/androidCameraExample/ofApp/src/main/res/values-v11/strings.xml deleted file mode 100644 index 34312396338..00000000000 --- a/examples/android/androidCameraExample/ofApp/src/main/res/values-v11/strings.xml +++ /dev/null @@ -1,5 +0,0 @@ - - - ofCameraEx - Menu - \ No newline at end of file diff --git a/examples/android/androidCameraExample/ofApp/src/main/res/values-v11/styles.xml b/examples/android/androidCameraExample/ofApp/src/main/res/values-v11/styles.xml deleted file mode 100644 index febc4d0286b..00000000000 --- a/examples/android/androidCameraExample/ofApp/src/main/res/values-v11/styles.xml +++ /dev/null @@ -1,11 +0,0 @@ - - - - - - diff --git a/examples/android/androidCameraExample/ofApp/src/main/res/values-v14/strings.xml b/examples/android/androidCameraExample/ofApp/src/main/res/values-v14/strings.xml deleted file mode 100644 index 34312396338..00000000000 --- a/examples/android/androidCameraExample/ofApp/src/main/res/values-v14/strings.xml +++ /dev/null @@ -1,5 +0,0 @@ - - - ofCameraEx - Menu - \ No newline at end of file diff --git a/examples/android/androidCameraExample/ofApp/src/main/res/values-v14/styles.xml b/examples/android/androidCameraExample/ofApp/src/main/res/values-v14/styles.xml deleted file mode 100644 index 928e0fd3d72..00000000000 --- a/examples/android/androidCameraExample/ofApp/src/main/res/values-v14/styles.xml +++ /dev/null @@ -1,12 +0,0 @@ - - - - - - diff --git a/examples/android/androidCameraExample/ofApp/src/main/res/values/ic_launcher_background.xml b/examples/android/androidCameraExample/ofApp/src/main/res/values/ic_launcher_background.xml deleted file mode 100644 index c5d5899fdf0..00000000000 --- a/examples/android/androidCameraExample/ofApp/src/main/res/values/ic_launcher_background.xml +++ /dev/null @@ -1,4 +0,0 @@ - - - #FFFFFF - \ No newline at end of file diff --git a/examples/android/androidCameraExample/ofApp/src/main/res/values/strings.xml b/examples/android/androidCameraExample/ofApp/src/main/res/values/strings.xml deleted file mode 100644 index 34312396338..00000000000 --- a/examples/android/androidCameraExample/ofApp/src/main/res/values/strings.xml +++ /dev/null @@ -1,5 +0,0 @@ - - - ofCameraEx - Menu - \ No newline at end of file diff --git a/examples/android/androidCameraExample/ofApp/src/main/res/values/styles.xml b/examples/android/androidCameraExample/ofApp/src/main/res/values/styles.xml deleted file mode 100644 index 766a2c3f143..00000000000 --- a/examples/android/androidCameraExample/ofApp/src/main/res/values/styles.xml +++ /dev/null @@ -1,20 +0,0 @@ - - - - - - - - - diff --git a/examples/android/androidCameraExample/proguard.cfg b/examples/android/androidCameraExample/proguard.cfg deleted file mode 100644 index faee26e7f2b..00000000000 --- a/examples/android/androidCameraExample/proguard.cfg +++ /dev/null @@ -1,59 +0,0 @@ --optimizationpasses 5 --dontusemixedcaseclassnames --dontskipnonpubliclibraryclasses --dontpreverify --verbose --optimizations !code/simplification/arithmetic,!field/*,!class/merging/* - --keep public class * extends android.app.Activity --keep public class * extends android.app.Application --keep public class * extends android.app.Service --keep public class * extends android.content.BroadcastReceiver --keep public class * extends android.content.ContentProvider --keep public class * extends android.app.backup.BackupAgentHelper --keep public class * extends android.preference.Preference --keep public class com.android.vending.licensing.ILicensingService - --keep class com.google.android.gms.games.leaderboard.** { *; } --keep class com.google.android.gms.games.snapshot.** { *; } --keep class com.google.android.gms.games.achievement.** { *; } --keep class com.google.android.gms.games.event.** { *; } --keep class com.google.android.gms.games.stats.** { *; } --keep class com.google.android.gms.games.video.** { *; } --keep class com.google.android.gms.games.* { *; } - --keep class com.google.android.gms.signin.** { *; } --keep class com.google.android.gms.dynamic.** { *; } --keep class com.google.android.gms.dynamite.** { *; } --keep class com.google.android.gms.tasks.** { *; } --keep class com.google.android.gms.security.** { *; } --keep class com.google.android.gms.base.** { *; } --keep class com.google.android.gms.actions.** { *; } --keep class com.google.games.bridge.** { *; } --keep class com.google.android.gms.common.api.** { *; } --keep class com.google.android.gms.games.quest.** { *; } --keep class com.google.android.gms.nearby.** { *; } --keepclasseswithmembernames class * { - native ; -} - --keepclasseswithmembers class * { - public (android.content.Context, android.util.AttributeSet); -} - --keepclasseswithmembers class * { - public (android.content.Context, android.util.AttributeSet, int); -} - --keepclassmembers class * extends android.app.Activity { - public void *(android.view.View); -} - --keepclassmembers enum * { - public static **[] values(); - public static ** valueOf(java.lang.String); -} - --keep class * implements android.os.Parcelable { - public static final android.os.Parcelable$Creator *; -} diff --git a/examples/android/androidCameraExample/settings.gradle b/examples/android/androidCameraExample/settings.gradle deleted file mode 100644 index cb352f426c0..00000000000 --- a/examples/android/androidCameraExample/settings.gradle +++ /dev/null @@ -1,11 +0,0 @@ -include ':ofApp' - -// Define the relative path to the openFrameworks project -def openFrameworksProjectPath = '../../../libs/openFrameworksCompiled/project' - -// Convert the relative path to an absolute path -def openFrameworksProjectAbsolutePath = new File(rootDir, openFrameworksProjectPath).absolutePath - -// Include the openFrameworks project -include ':openFrameworksProject' -project(':openFrameworksProject').projectDir = new File(openFrameworksProjectAbsolutePath) diff --git a/examples/android/androidCameraExample/ofApp/src/main/cpp/main.cpp b/examples/android/androidCameraExample/src/main/cpp/main.cpp similarity index 100% rename from examples/android/androidCameraExample/ofApp/src/main/cpp/main.cpp rename to examples/android/androidCameraExample/src/main/cpp/main.cpp diff --git a/examples/android/androidCameraExample/ofApp/src/main/cpp/ofApp.cpp b/examples/android/androidCameraExample/src/main/cpp/ofApp.cpp similarity index 100% rename from examples/android/androidCameraExample/ofApp/src/main/cpp/ofApp.cpp rename to examples/android/androidCameraExample/src/main/cpp/ofApp.cpp diff --git a/examples/android/androidCameraExample/ofApp/src/main/cpp/ofApp.h b/examples/android/androidCameraExample/src/main/cpp/ofApp.h similarity index 100% rename from examples/android/androidCameraExample/ofApp/src/main/cpp/ofApp.h rename to examples/android/androidCameraExample/src/main/cpp/ofApp.h diff --git a/examples/android/androidCompositeExample/build.gradle b/examples/android/androidCompositeExample/build.gradle deleted file mode 100644 index 7cbc7eb6714..00000000000 --- a/examples/android/androidCompositeExample/build.gradle +++ /dev/null @@ -1,22 +0,0 @@ -ext { - //var = 'signExample.keystore' -}// Top-level build file where you can add configuration options common to all sub-projects/modules. -buildscript { - repositories { - google() - mavenCentral() - } - dependencies { - classpath 'com.android.tools.build:gradle:7.4.2' - } -} - -allprojects { - repositories { - google() - mavenCentral() - } - ext { - - } -} diff --git a/examples/android/androidCompositeExample/gradle.properties b/examples/android/androidCompositeExample/gradle.properties deleted file mode 100644 index 43f9ef9e1c3..00000000000 --- a/examples/android/androidCompositeExample/gradle.properties +++ /dev/null @@ -1,10 +0,0 @@ -android.useAndroidX=true -android.enableJetifier=false -org.gradle.jvmargs=-Xmx2048m -Dfile.encoding=UTF-8 -kotlin.code.style=official -android.prefabVersion=1.0.+ -android.buildFeatures.prefab=true -#ndkBuild=false -# https://issuetracker.google.com/149575364 -android.enableParallelJsonGen=false -#googleplay=true \ No newline at end of file diff --git a/examples/android/androidCompositeExample/gradle/wrapper/gradle-wrapper.jar b/examples/android/androidCompositeExample/gradle/wrapper/gradle-wrapper.jar deleted file mode 100644 index 13372aef5e2..00000000000 Binary files a/examples/android/androidCompositeExample/gradle/wrapper/gradle-wrapper.jar and /dev/null differ diff --git a/examples/android/androidCompositeExample/gradle/wrapper/gradle-wrapper.properties b/examples/android/androidCompositeExample/gradle/wrapper/gradle-wrapper.properties deleted file mode 100644 index 2dd5ee8c795..00000000000 --- a/examples/android/androidCompositeExample/gradle/wrapper/gradle-wrapper.properties +++ /dev/null @@ -1,6 +0,0 @@ -#Mon Jun 12 01:17:57 AEST 2023 -distributionBase=GRADLE_USER_HOME -distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-7.5-bin.zip -zipStoreBase=GRADLE_USER_HOME -zipStorePath=wrapper/dists diff --git a/examples/android/androidCompositeExample/ofApp/build.gradle b/examples/android/androidCompositeExample/ofApp/build.gradle deleted file mode 100644 index 5bf1e3663e4..00000000000 --- a/examples/android/androidCompositeExample/ofApp/build.gradle +++ /dev/null @@ -1,182 +0,0 @@ -plugins { - id 'com.android.application' -} - -def CMAKELIST_PATH = './src/main/cpp' -def CPP_SOURCE = './src/main/cpp' -def JAVA_SOURCE = './src/main/java' - -// pointing to cmake's source code for the same project -def PRJ_SRC_ROOT = './src/main' -def ofRoot(){ return '../../../../' } -final ofSource = ofRoot() + 'libs/openFrameworks' -final ofLibs = ofRoot() + 'libs' -final addons = ofRoot() + 'addons' -final ofLibOutput = ofRoot() + 'libs/openFrameworksCompiled/lib/android' -def OFX_ANDROID = ofRoot() + 'addons/ofxAndroid' -//def OF_ADDONS_ARGUMENTS = "${OF_ADDONS}" -def enableProguardInReleaseBuilds = true -def enableProguardInDebugBuilds = false - -task wrapper(type: Wrapper) { - gradleVersion = '7.3.3' -} -tasks.register("prepareKotlinBuildScriptModel"){ -} - -evaluationDependsOn(':openFrameworksProject') - -tasks.whenTaskAdded { task -> - if (task.name == 'assemble') { - task.dependsOn(':openFrameworksProject:assemble') - } -} - - -android { - compileSdkVersion 34 - buildToolsVersion '32.0.0' - //ndkPath "/Users/x/android-ndk-r21e" // Point to your own NDK if needed - ndkVersion '24.0.8215888' // use android studio side loaded ndk - buildFeatures { - prefab true - } - signingConfigs { - debug { - } - release { - storeFile new File("${System.properties['user.home']}/.android/debug.keystore") - storePassword 'android' - storeType "jks" - keyAlias 'androiddebugkey' - keyPassword 'android' - } - } - defaultConfig { - applicationId "cc.openframeworks.ofCompositeExample" - minSdkVersion 21 - targetSdkVersion 34 - versionCode 12 - versionName '12.0' - ndk.abiFilters 'armeabi-v7a', 'arm64-v8a', 'x86' //, 'x86_64' - - externalNativeBuild { - if (!project.hasProperty("ndkBuild")) { - cmake { - arguments "-DANDROID_STL=c++_shared", - "-DANDROID_ARM_NEON=TRUE", - "-DANDROID_TOOLCHAIN=clang", - //"${OF_ADDONS_ARGUMENTS}", - "-DTARGET_OPENGLES=TRUE" - - version '3.22.1' - } - } - } - multiDexEnabled false - } - buildTypes { - release { - signingConfig signingConfigs.release - jniDebuggable false - debuggable false - minifyEnabled false - shrinkResources false - proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro' - signingConfig signingConfigs.release - } - debug { - jniDebuggable true - debuggable true - minifyEnabled false - shrinkResources false - signingConfig signingConfigs.debug - } - } - flavorDimensions "version" - productFlavors { - playstore { - applicationIdSuffix "" - signingConfig signingConfigs.release - } -// humble { -// applicationIdSuffix ".humble" -// } -// amazon { -// applicationIdSuffix ".amazon" -// } -// samsung { -// applicationIdSuffix ".samsung" -// } -// oppo { -// applicationIdSuffix ".oppo" -// } - } - sourceSets { - main { - manifest.srcFile "${PRJ_SRC_ROOT}/AndroidManifest.xml" - java.srcDirs = ["${PRJ_SRC_ROOT}/java", - "${OFX_ANDROID}/Java"] - res.srcDirs = ["${PRJ_SRC_ROOT}/res"] -// jniLibs.srcDirs = ["${OF_ANDROID_OUTPUT}", "lib"] // Pre Android Studio 2022.2.1 - assets { - srcDirs 'src/main/assets', 'src/main/bin/data' - } - } - } - externalNativeBuild { - if (!project.hasProperty("ndkBuild")) { - cmake { - path "${CMAKELIST_PATH}/CMakeLists.txt" - } - } else { - ndkBuild { - path "${CMAKELIST_PATH}/Android.mk" - } - } - } - compileOptions { - sourceCompatibility JavaVersion.VERSION_1_8 - targetCompatibility JavaVersion.VERSION_1_8 - } - androidResources { - noCompress '' - } - dependenciesInfo { - includeInApk false - includeInBundle false - } -// testOptions { -// devices { -// pixel2api29 (com.android.build.api.dsl.ManagedVirtualDevice) { -// // Use device profiles you typically see in -// // Android Studio -// device = "Pixel 2" -// apiLevel = 29 -// // You can also specify "aosp" if you don’t require -// // Google Play Services. -// systemImageSource = "google" -// abi = "x86" -// } -// } -// } -} - - -dependencies { - implementation fileTree(dir: 'libs', include: ['*.jar']) - implementation 'androidx.appcompat:appcompat:1.6.1' - implementation 'androidx.constraintlayout:constraintlayout:2.1.4' - implementation 'androidx.legacy:legacy-support-v4:1.0.0' - implementation "com.getkeepsafe.relinker:relinker:1.4.5" - implementation 'com.google.android.material:material:1.9.0' - if (project.hasProperty("googleplay")) { - implementation "com.google.android.gms:play-services-games:22.0.1" - implementation "com.google.android.gms:play-services-auth:20.0.1" - implementation "com.google.android.gms:play-services-base:18.0.1" - implementation "com.google.android.gms:play-services-basement:18.0.0" - implementation "com.google.android.gms:play-services-instantapps:18.0.1" - implementation "com.google.android.gms:play-services-appset:16.0.2" - } -} - diff --git a/examples/android/androidCompositeExample/ofApp/gradle.properties b/examples/android/androidCompositeExample/ofApp/gradle.properties deleted file mode 100644 index f96a9f246a0..00000000000 --- a/examples/android/androidCompositeExample/ofApp/gradle.properties +++ /dev/null @@ -1,11 +0,0 @@ -android.useAndroidX=true -android.enableJetifier=true -org.gradle.jvmargs=-Xmx2048m -Dfile.encoding=UTF-8 -kotlin.code.style=official -android.prefabVersion=1.0.+ -# Workaround bug in AGP where the prefab dependency is being resolved from a -# non-Gradle thread when enableParallelJsonGen is enabled. -# https://issuetracker.google.com/149575364 -android.enableParallelJsonGen=false -android.buildFeatures.prefab = true -vectorDrawables.useSupportLibrary = true \ No newline at end of file diff --git a/examples/android/androidCompositeExample/ofApp/gradle/wrapper/gradle-wrapper.jar b/examples/android/androidCompositeExample/ofApp/gradle/wrapper/gradle-wrapper.jar deleted file mode 100644 index 249e5832f09..00000000000 Binary files a/examples/android/androidCompositeExample/ofApp/gradle/wrapper/gradle-wrapper.jar and /dev/null differ diff --git a/examples/android/androidCompositeExample/ofApp/gradle/wrapper/gradle-wrapper.properties b/examples/android/androidCompositeExample/ofApp/gradle/wrapper/gradle-wrapper.properties deleted file mode 100644 index 2e6e5897b52..00000000000 --- a/examples/android/androidCompositeExample/ofApp/gradle/wrapper/gradle-wrapper.properties +++ /dev/null @@ -1,5 +0,0 @@ -distributionBase=GRADLE_USER_HOME -distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-7.3.3-bin.zip -zipStoreBase=GRADLE_USER_HOME -zipStorePath=wrapper/dists diff --git a/examples/android/androidCompositeExample/ofApp/gradlew b/examples/android/androidCompositeExample/ofApp/gradlew deleted file mode 100755 index a69d9cb6c20..00000000000 --- a/examples/android/androidCompositeExample/ofApp/gradlew +++ /dev/null @@ -1,240 +0,0 @@ -#!/bin/sh - -# -# Copyright © 2015-2021 the original authors. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# - -############################################################################## -# -# Gradle start up script for POSIX generated by Gradle. -# -# Important for running: -# -# (1) You need a POSIX-compliant shell to run this script. If your /bin/sh is -# noncompliant, but you have some other compliant shell such as ksh or -# bash, then to run this script, type that shell name before the whole -# command line, like: -# -# ksh Gradle -# -# Busybox and similar reduced shells will NOT work, because this script -# requires all of these POSIX shell features: -# * functions; -# * expansions «$var», «${var}», «${var:-default}», «${var+SET}», -# «${var#prefix}», «${var%suffix}», and «$( cmd )»; -# * compound commands having a testable exit status, especially «case»; -# * various built-in commands including «command», «set», and «ulimit». -# -# Important for patching: -# -# (2) This script targets any POSIX shell, so it avoids extensions provided -# by Bash, Ksh, etc; in particular arrays are avoided. -# -# The "traditional" practice of packing multiple parameters into a -# space-separated string is a well documented source of bugs and security -# problems, so this is (mostly) avoided, by progressively accumulating -# options in "$@", and eventually passing that to Java. -# -# Where the inherited environment variables (DEFAULT_JVM_OPTS, JAVA_OPTS, -# and GRADLE_OPTS) rely on word-splitting, this is performed explicitly; -# see the in-line comments for details. -# -# There are tweaks for specific operating systems such as AIX, CygWin, -# Darwin, MinGW, and NonStop. -# -# (3) This script is generated from the Groovy template -# https://github.com/gradle/gradle/blob/master/subprojects/plugins/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt -# within the Gradle project. -# -# You can find Gradle at https://github.com/gradle/gradle/. -# -############################################################################## - -# Attempt to set APP_HOME - -# Resolve links: $0 may be a link -app_path=$0 - -# Need this for daisy-chained symlinks. -while - APP_HOME=${app_path%"${app_path##*/}"} # leaves a trailing /; empty if no leading path - [ -h "$app_path" ] -do - ls=$( ls -ld "$app_path" ) - link=${ls#*' -> '} - case $link in #( - /*) app_path=$link ;; #( - *) app_path=$APP_HOME$link ;; - esac -done - -APP_HOME=$( cd "${APP_HOME:-./}" && pwd -P ) || exit - -APP_NAME="Gradle" -APP_BASE_NAME=${0##*/} - -# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. -DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"' - -# Use the maximum available, or set MAX_FD != -1 to use that value. -MAX_FD=maximum - -warn () { - echo "$*" -} >&2 - -die () { - echo - echo "$*" - echo - exit 1 -} >&2 - -# OS specific support (must be 'true' or 'false'). -cygwin=false -msys=false -darwin=false -nonstop=false -case "$( uname )" in #( - CYGWIN* ) cygwin=true ;; #( - Darwin* ) darwin=true ;; #( - MSYS* | MINGW* ) msys=true ;; #( - NONSTOP* ) nonstop=true ;; -esac - -CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar - - -# Determine the Java command to use to start the JVM. -if [ -n "$JAVA_HOME" ] ; then - if [ -x "$JAVA_HOME/jre/sh/java" ] ; then - # IBM's JDK on AIX uses strange locations for the executables - JAVACMD=$JAVA_HOME/jre/sh/java - else - JAVACMD=$JAVA_HOME/bin/java - fi - if [ ! -x "$JAVACMD" ] ; then - die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME - -Please set the JAVA_HOME variable in your environment to match the -location of your Java installation." - fi -else - JAVACMD=java - which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. - -Please set the JAVA_HOME variable in your environment to match the -location of your Java installation." -fi - -# Increase the maximum file descriptors if we can. -if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then - case $MAX_FD in #( - max*) - MAX_FD=$( ulimit -H -n ) || - warn "Could not query maximum file descriptor limit" - esac - case $MAX_FD in #( - '' | soft) :;; #( - *) - ulimit -n "$MAX_FD" || - warn "Could not set maximum file descriptor limit to $MAX_FD" - esac -fi - -# Collect all arguments for the java command, stacking in reverse order: -# * args from the command line -# * the main class name -# * -classpath -# * -D...appname settings -# * --module-path (only if needed) -# * DEFAULT_JVM_OPTS, JAVA_OPTS, and GRADLE_OPTS environment variables. - -# For Cygwin or MSYS, switch paths to Windows format before running java -if "$cygwin" || "$msys" ; then - APP_HOME=$( cygpath --path --mixed "$APP_HOME" ) - CLASSPATH=$( cygpath --path --mixed "$CLASSPATH" ) - - JAVACMD=$( cygpath --unix "$JAVACMD" ) - - # Now convert the arguments - kludge to limit ourselves to /bin/sh - for arg do - if - case $arg in #( - -*) false ;; # don't mess with options #( - /?*) t=${arg#/} t=/${t%%/*} # looks like a POSIX filepath - [ -e "$t" ] ;; #( - *) false ;; - esac - then - arg=$( cygpath --path --ignore --mixed "$arg" ) - fi - # Roll the args list around exactly as many times as the number of - # args, so each arg winds up back in the position where it started, but - # possibly modified. - # - # NB: a `for` loop captures its iteration list before it begins, so - # changing the positional parameters here affects neither the number of - # iterations, nor the values presented in `arg`. - shift # remove old arg - set -- "$@" "$arg" # push replacement arg - done -fi - -# Collect all arguments for the java command; -# * $DEFAULT_JVM_OPTS, $JAVA_OPTS, and $GRADLE_OPTS can contain fragments of -# shell script including quotes and variable substitutions, so put them in -# double quotes to make sure that they get re-expanded; and -# * put everything else in single quotes, so that it's not re-expanded. - -set -- \ - "-Dorg.gradle.appname=$APP_BASE_NAME" \ - -classpath "$CLASSPATH" \ - org.gradle.wrapper.GradleWrapperMain \ - "$@" - -# Stop when "xargs" is not available. -if ! command -v xargs >/dev/null 2>&1 -then - die "xargs is not available" -fi - -# Use "xargs" to parse quoted args. -# -# With -n1 it outputs one arg per line, with the quotes and backslashes removed. -# -# In Bash we could simply go: -# -# readarray ARGS < <( xargs -n1 <<<"$var" ) && -# set -- "${ARGS[@]}" "$@" -# -# but POSIX shell has neither arrays nor command substitution, so instead we -# post-process each arg (as a line of input to sed) to backslash-escape any -# character that might be a shell metacharacter, then use eval to reverse -# that process (while maintaining the separation between arguments), and wrap -# the whole thing up as a single "set" statement. -# -# This will of course break if any of these variables contains a newline or -# an unmatched quote. -# - -eval "set -- $( - printf '%s\n' "$DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS" | - xargs -n1 | - sed ' s~[^-[:alnum:]+,./:=@_]~\\&~g; ' | - tr '\n' ' ' - )" '"$@"' - -exec "$JAVACMD" "$@" diff --git a/examples/android/androidCompositeExample/ofApp/gradlew.bat b/examples/android/androidCompositeExample/ofApp/gradlew.bat deleted file mode 100644 index f127cfd49d4..00000000000 --- a/examples/android/androidCompositeExample/ofApp/gradlew.bat +++ /dev/null @@ -1,91 +0,0 @@ -@rem -@rem Copyright 2015 the original author or authors. -@rem -@rem Licensed under the Apache License, Version 2.0 (the "License"); -@rem you may not use this file except in compliance with the License. -@rem You may obtain a copy of the License at -@rem -@rem https://www.apache.org/licenses/LICENSE-2.0 -@rem -@rem Unless required by applicable law or agreed to in writing, software -@rem distributed under the License is distributed on an "AS IS" BASIS, -@rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -@rem See the License for the specific language governing permissions and -@rem limitations under the License. -@rem - -@if "%DEBUG%"=="" @echo off -@rem ########################################################################## -@rem -@rem Gradle startup script for Windows -@rem -@rem ########################################################################## - -@rem Set local scope for the variables with windows NT shell -if "%OS%"=="Windows_NT" setlocal - -set DIRNAME=%~dp0 -if "%DIRNAME%"=="" set DIRNAME=. -set APP_BASE_NAME=%~n0 -set APP_HOME=%DIRNAME% - -@rem Resolve any "." and ".." in APP_HOME to make it shorter. -for %%i in ("%APP_HOME%") do set APP_HOME=%%~fi - -@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. -set DEFAULT_JVM_OPTS="-Xmx64m" "-Xms64m" - -@rem Find java.exe -if defined JAVA_HOME goto findJavaFromJavaHome - -set JAVA_EXE=java.exe -%JAVA_EXE% -version >NUL 2>&1 -if %ERRORLEVEL% equ 0 goto execute - -echo. -echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. -echo. -echo Please set the JAVA_HOME variable in your environment to match the -echo location of your Java installation. - -goto fail - -:findJavaFromJavaHome -set JAVA_HOME=%JAVA_HOME:"=% -set JAVA_EXE=%JAVA_HOME%/bin/java.exe - -if exist "%JAVA_EXE%" goto execute - -echo. -echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% -echo. -echo Please set the JAVA_HOME variable in your environment to match the -echo location of your Java installation. - -goto fail - -:execute -@rem Setup the command line - -set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar - - -@rem Execute Gradle -"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %* - -:end -@rem End local scope for the variables with windows NT shell -if %ERRORLEVEL% equ 0 goto mainEnd - -:fail -rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of -rem the _cmd.exe /c_ return code! -set EXIT_CODE=%ERRORLEVEL% -if %EXIT_CODE% equ 0 set EXIT_CODE=1 -if not ""=="%GRADLE_EXIT_CONSOLE%" exit %EXIT_CODE% -exit /b %EXIT_CODE% - -:mainEnd -if "%OS%"=="Windows_NT" endlocal - -:omega diff --git a/examples/android/androidCompositeExample/ofApp/proguard-rules.pro b/examples/android/androidCompositeExample/ofApp/proguard-rules.pro deleted file mode 100644 index de8c62143ce..00000000000 --- a/examples/android/androidCompositeExample/ofApp/proguard-rules.pro +++ /dev/null @@ -1,127 +0,0 @@ -# Add project specific ProGuard rules here. -# You can control the set of applied configuration files using the -# proguardFiles setting in build.gradle. -# -# For more details, see -# http://developer.android.com/guide/developing/tools/proguard.html - --dontoptimize --dontshrink -#-dontusemixedcaseclassnames -#-dontskipnonpubliclibraryclasses -#-dontpreverify -#-verbose -# --optimizationpasses 7 # use for final build --dontusemixedcaseclassnames -#-dontskipnonpubliclibraryclasses -#-dontpreverify --verbose - -# custom app activity proguard --keep public class cc.openframeworks.android.OFActivity { public ; } --keep public class cc.openframeworks.android.R { public ; } - - -#-dontobfuscate android classes --keep public class * extends android.app.Activity --keep public class * extends android.app.Application --keep public class * extends android.app.Service --keep public class * extends android.content.BroadcastReceiver --keep public class * extends android.content.ContentProvider --keep public class * extends android.app.backup.BackupAgentHelper --keep public class * extends android.preference.Preference - -#-dontobfuscate openFrameworks android classes --keep public class cc.openframeworks.OFAndroid { public ; } --keep public class cc.openframeworks.OFAndroidLifeCycleHelper { public ; } --keep public class cc.openframeworks.OFAndroidWindow { public ; } --keep public class cc.openframeworks.OFAndroidSoundPlayer { public ; } --keep public class cc.openframeworks.OFGLSurfaceView { public ; } --keep public class cc.openframeworks.OFAndroidLifeCycle { public ; } --keep public class cc.openframeworks.OFActivity { public ; } --keep public class cc.openframeworks.ContextFactory { public ; } --keep public class cc.openframeworks.OFEGLConfigChooser { public ; } --keep public class cc.openframeworks.OFGestureListener { public ; } --keep public class cc.openframeworks.OFAndroidController { public ; } - -#-dontobfuscate GooglePlay Games android classes if used --keep class com.google.android.gms.games.leaderboard.** { *; } --keep class com.google.android.gms.games.snapshot.** { *; } --keep class com.google.android.gms.games.achievement.** { *; } --keep class com.google.android.gms.games.event.** { *; } --keep class com.google.android.gms.games.stats.** { *; } --keep class com.google.android.gms.games.video.** { *; } --keep class com.google.android.gms.games.* { *; } --keep class com.google.android.gms.signin.** { *; } --keep class com.google.android.gms.dynamic.** { *; } --keep class com.google.android.gms.dynamite.** { *; } --keep class com.google.android.gms.tasks.** { *; } --keep class com.google.android.gms.security.** { *; } --keep class com.google.android.gms.base.** { *; } --keep class com.google.android.gms.actions.** { *; } --keep class com.google.games.bridge.** { *; } --keep class com.google.android.gms.common.api.** { *; } --keep class com.google.android.gms.games.quest.** { *; } --keep class com.google.android.gms.nearby.** { *; } - --keepclasseswithmembernames class * { - native ; -} - --keepclasseswithmembers class * { - public (android.content.Context, android.util.AttributeSet); -} - --keepclasseswithmembers class * { - public (android.content.Context, android.util.AttributeSet, int); -} - -# note that means any method --keepclasseswithmembernames,includedescriptorclasses class * { - native ; -} - --keepclassmembers class * extends android.app.Activity { - public void *(android.view.View); -} - --keepclassmembers enum * { - public static **[] values(); - public static ** valueOf(java.lang.String); -} - --keep class * implements android.os.Parcelable { - public static final android.os.Parcelable$Creator *; -} - - -# If your project uses WebView with JS, uncomment the following -# and specify the fully qualified class name to the JavaScript interface -# class: -#-keepclassmembers class fqcn.of.javascript.interface.for.webview { -# public *; -#} - -# Uncomment this to preserve the line number information for -# debugging stack traces. -#-keepattributes SourceFile,LineNumberTable - -# If you keep the line number information, uncomment this to -# hide the original source file name. -#-renamesourcefileattribute SourceFile - -# If your project uses WebView with JS, uncomment the following -# and specify the fully qualified class name to the JavaScript interface -# class: -#-keepclassmembers class fqcn.of.javascript.interface.for.webview { -# public *; -#} - -# Uncomment this to preserve the line number information for -# debugging stack traces. --keepattributes SourceFile,LineNumberTable - -# If you keep the line number information, uncomment this to -# hide the original source file name. -#-renamesourcefileattribute SourceFile \ No newline at end of file diff --git a/examples/android/androidCompositeExample/ofApp/src/main/AndroidManifest.xml b/examples/android/androidCompositeExample/ofApp/src/main/AndroidManifest.xml deleted file mode 100644 index 613fef8d108..00000000000 --- a/examples/android/androidCompositeExample/ofApp/src/main/AndroidManifest.xml +++ /dev/null @@ -1,90 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/examples/android/androidCompositeExample/ofApp/src/main/bin/data/frabk.ttf b/examples/android/androidCompositeExample/ofApp/src/main/bin/data/frabk.ttf deleted file mode 100644 index 21c4ecfc553..00000000000 Binary files a/examples/android/androidCompositeExample/ofApp/src/main/bin/data/frabk.ttf and /dev/null differ diff --git a/examples/android/androidCompositeExample/ofApp/src/main/bin/data/shaders/noise.frag b/examples/android/androidCompositeExample/ofApp/src/main/bin/data/shaders/noise.frag deleted file mode 100644 index 53f7d315155..00000000000 --- a/examples/android/androidCompositeExample/ofApp/src/main/bin/data/shaders/noise.frag +++ /dev/null @@ -1,24 +0,0 @@ -#ifdef GL_ES -// define default precision for float, vec, mat. -precision highp float; -#endif - -uniform vec4 globalColor; - -void main(){ - //this is the fragment shader - //this is where the pixel level drawing happens - //gl_FragCoord gives us the x and y of the current pixel its drawing - - //we grab the x and y and store them in an int - float xVal = gl_FragCoord.x; - float yVal = gl_FragCoord.y; - - //we use the mod function to only draw pixels if they are every 2 in x or every 4 in y - if( mod(xVal, 2.0) == 0.5 && mod(yVal, 4.0) == 0.5 ){ - gl_FragColor = globalColor; - }else{ - discard; - } - -} diff --git a/examples/android/androidCompositeExample/ofApp/src/main/bin/data/shaders/noise.vert b/examples/android/androidCompositeExample/ofApp/src/main/bin/data/shaders/noise.vert deleted file mode 100644 index 34eb8cfc4f0..00000000000 --- a/examples/android/androidCompositeExample/ofApp/src/main/bin/data/shaders/noise.vert +++ /dev/null @@ -1,89 +0,0 @@ -#ifdef GL_ES -// define default precision for float, vec, mat. -precision highp float; -#endif - -attribute vec4 position; - -uniform mat4 modelViewProjectionMatrix; - -uniform float timeValX; -uniform float timeValY; -uniform vec2 mouse; - -//generate a random value from four points -vec4 rand(vec2 A,vec2 B,vec2 C,vec2 D){ - - vec2 s=vec2(12.9898,78.233); - vec4 tmp=vec4(dot(A,s),dot(B,s),dot(C,s),dot(D,s)); - - return fract(sin(tmp) * 43758.5453)* 2.0 - 1.0; -} - -//this is similar to a perlin noise function -float noise(vec2 coord,float d){ - - vec2 C[4]; - - float d1 = 1.0/d; - - C[0]=floor(coord*d)*d1; - - C[1]=C[0]+vec2(d1,0.0); - - C[2]=C[0]+vec2(d1,d1); - - C[3]=C[0]+vec2(0.0,d1); - - - vec2 p=fract(coord*d); - - vec2 q=1.0-p; - - vec4 w=vec4(q.x*q.y,p.x*q.y,p.x*p.y,q.x*p.y); - - return dot(vec4(rand(C[0],C[1],C[2],C[3])),w); -} - - -void main(){ - - //get our current vertex position so we can modify it - vec4 pos = modelViewProjectionMatrix * position; - - //generate some noise values based on vertex position and the time value which comes in from our OF app - float noiseAmntX = noise( vec2(-timeValX + pos.x / 1000.0, 100.0), 20.0 ); - float noiseAmntY = noise( vec2(timeValY + pos.y / 1000.0, pos.x / 2000.0), 20.0 ); - - //generate noise for our blue pixel value - float noiseB = noise( vec2(timeValY * 0.25, pos.y / 2000.0), 20.0 ); - - //lets also figure out the distance between the mouse and the vertex and apply a repelling force away from the mouse - vec2 d = vec2(pos.x, pos.y) - mouse; - float len = sqrt(d.x*d.x + d.y*d.y); - if( len < 300.0 && len > 0.0 ){ - - //lets get the distance into 0-1 ranges - float pct = len / 300.0; - - //this turns our linear 0-1 value into a curved 0-1 value - pct *= pct; - - //flip it so the closer we are the greater the repulsion - pct = 1.0 - pct; - - //normalize our repulsion vector - d /= len; - - //apply the repulsion to our position - pos.x += d.x * pct * 90.0; - pos.y += d.y * pct * 90.0; - } - - //modify our position with the smooth noise - pos.x += noiseAmntX * 20.0; - pos.y += noiseAmntY * 10.0; - - //finally set the pos to be that actual position rendered - gl_Position = pos; -} diff --git a/examples/android/androidCompositeExample/ofApp/src/main/bin/data/sounds/1085.mp3 b/examples/android/androidCompositeExample/ofApp/src/main/bin/data/sounds/1085.mp3 deleted file mode 100644 index f4389d44b13..00000000000 Binary files a/examples/android/androidCompositeExample/ofApp/src/main/bin/data/sounds/1085.mp3 and /dev/null differ diff --git a/examples/android/androidCompositeExample/ofApp/src/main/bin/data/sounds/Violet.mp3 b/examples/android/androidCompositeExample/ofApp/src/main/bin/data/sounds/Violet.mp3 deleted file mode 100644 index 8968982ac9b..00000000000 Binary files a/examples/android/androidCompositeExample/ofApp/src/main/bin/data/sounds/Violet.mp3 and /dev/null differ diff --git a/examples/android/androidCompositeExample/ofApp/src/main/bin/data/sounds/beat.wav b/examples/android/androidCompositeExample/ofApp/src/main/bin/data/sounds/beat.wav deleted file mode 100644 index 3384984d617..00000000000 Binary files a/examples/android/androidCompositeExample/ofApp/src/main/bin/data/sounds/beat.wav and /dev/null differ diff --git a/examples/android/androidCompositeExample/ofApp/src/main/bin/data/sounds/synth.wav b/examples/android/androidCompositeExample/ofApp/src/main/bin/data/sounds/synth.wav deleted file mode 100644 index 481d3d1efbd..00000000000 Binary files a/examples/android/androidCompositeExample/ofApp/src/main/bin/data/sounds/synth.wav and /dev/null differ diff --git a/examples/android/androidCompositeExample/ofApp/src/main/bin/data/verdana.ttf b/examples/android/androidCompositeExample/ofApp/src/main/bin/data/verdana.ttf deleted file mode 100644 index 8f25a642311..00000000000 Binary files a/examples/android/androidCompositeExample/ofApp/src/main/bin/data/verdana.ttf and /dev/null differ diff --git a/examples/android/androidCompositeExample/ofApp/src/main/cpp/CMakeLists.txt b/examples/android/androidCompositeExample/ofApp/src/main/cpp/CMakeLists.txt deleted file mode 100644 index 5b160ffa42d..00000000000 --- a/examples/android/androidCompositeExample/ofApp/src/main/cpp/CMakeLists.txt +++ /dev/null @@ -1,142 +0,0 @@ -# Sets the minimum version of CMake required to build the native -# library. -cmake_minimum_required(VERSION 3.22.1) - -project(ofapp LANGUAGES CXX) -set(TARGET_ANDROID TRUE) - -set(LOCAL_PATH ${CMAKE_SOURCE_DIR}) -set(PRJ_OF_ROOT ${LOCAL_PATH}/../../../../../../../) - -set(PURE_OF_ROOT ${LOCAL_PATH}/../../../../../../../) -set(CORE_OF_ROOT ${PURE_OF_ROOT}/libs/openFrameworks) -set(LIBS_ROOT ${PURE_OF_ROOT}/libs) - -set(PRJ_ADDONS_PATH ${PURE_OF_ROOT}/addons) -set(PRJ_SOURCE_PATH ${LIBS_ROOT}/openFrameworks) -set(PRJ_LIBS_ROOT ${PURE_OF_ROOT}/libs) - -set(OF_ANDROID ${PURE_OF_ROOT}/libs/openFrameworksCompiled/project/android) -set(OF_ANDROID_OUTPUT ${PURE_OF_ROOT}/libs/openFrameworksCompiled/lib/android) - -set(PRJ_OFX_ANDROID_PATH ${PRJ_ADDONS_PATH}/ofxAndroid) -set(PRJ_OFX_ANDROID_CPP_PATH ${PRJ_OFX_ANDROID_PATH}/src) - -macro(print_all_variables) - message(STATUS "print_all_variables------------------------------------------{") - get_cmake_property(_variableNames VARIABLES) - foreach (_variableName ${_variableNames}) - message(STATUS "${_variableName}=${${_variableName}}") - endforeach() - message(STATUS "print_all_variables------------------------------------------}") -endmacro() - -# Custom function to check if the library is built -function(check_library) - if (NOT TARGET openFrameworksAndroid) - message(STATUS "openFrameworksAndroid Library not found. Building library...") - - # Invoke the build process for the library - execute_process( - COMMAND ${CMAKE_COMMAND} --build ${OF_ANDROID}/ - RESULT_VARIABLE result - ) - if (result) - message(FATAL_ERROR "Failed to build the library.") - endif () - endif () -endfunction() - -set(CMAKE_CXX_STANDARD 17) -set(CMAKE_CXX_STANDARD_REQUIRED ON) -set(CMAKE_CXX_EXTENSIONS ON) -set(TARGET_ANDROID ON) -set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -std=c17 -Oz -DNDEBUG -frtti --warn-uninitialized -fno-short-enums -Wextra -fPIE -fPIC -fuse-ld=gold -fexceptions -ffunction-sections -fdata-sections -Wall -Wextra -Wfloat-equal -Wundef -Werror -fverbose-asm -Wint-to-pointer-cast -Wshadow -Wpointer-arith -Wcast-align -Wstrict-prototypes -Wcast-qual -Wmissing-prototypes -Wstrict-overflow=5 -Wwrite-strings -Wconversion --pedantic-errors") -set(CMAKE_CPP_FLAGS "${CMAKE_C_FLAGS} -std=c++17 -Oz -DNDEBUG -stdlib=libc++ --warn-uninitialized -frtti -Wextra -fno-short-enums -fPIE -fPIC -fuse-ld=gold -fexceptions -ffunction-sections -fdata-sections -Wall -Wextra -Wfloat-equal -Wundef -Werror -fverbose-asm -Wint-to-pointer-cast -Wshadow -Wpointer-arith -Wcast-align -Wstrict-prototypes -Wcast-qual -Wmissing-prototypes -Wstrict-overflow=5 -Wwrite-strings -Wconversion --pedantic-errors") -set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -Wl,-export-dynamic") - -print_all_variables() - -# Creates the project's shared lib: libnative-lib.so. -# The lib is loaded by this project's Java code in MainActivity.java: -# System.loadLibrary("native-lib"); -# The lib name in both places must match. -add_library( ofapp #name - SHARED # type of library - # src files for project (just c/cpp) - ${CMAKE_SOURCE_DIR}/main.cpp - ${CMAKE_SOURCE_DIR}/ofApp.cpp - ) - - -# Specifies a path to native header files -include_directories( - # openFrameworks headers - ${PRJ_SOURCE_PATH}/3d - ${PRJ_SOURCE_PATH}/app - ${PRJ_SOURCE_PATH}/communication - ${PRJ_SOURCE_PATH}/events - ${PRJ_SOURCE_PATH}/gl - ${PRJ_SOURCE_PATH}/graphics - ${PRJ_SOURCE_PATH}/math - ${PRJ_SOURCE_PATH}/sound - ${PRJ_SOURCE_PATH}/types - ${PRJ_SOURCE_PATH}/utils - ${PRJ_SOURCE_PATH}/video - ${PRJ_SOURCE_PATH} - # openFrameworks addons includes - ${PURE_OF_ROOT}/addons/ofxAndroid/src - ${PURE_OF_ROOT}/addons/ofxAccelerometer/src - ${PURE_OF_ROOT}/addons/ofxXmlSettings/src - ${PURE_OF_ROOT}/addons/ofxXmlSettings/libs - # openFrameworks Libs includes - ${PRJ_LIBS_ROOT}/FreeImage/include - ${PRJ_LIBS_ROOT}/freetype/include - ${PRJ_LIBS_ROOT}/freetype/include/freetype2 - ${PRJ_LIBS_ROOT}/freetype/include/freetype2/freetype/config - ${PRJ_LIBS_ROOT}/freetype/include/freetype2/freetype/internal - ${PRJ_LIBS_ROOT}/freetype/include/freetype2/freetype/internal/services - ${PRJ_LIBS_ROOT}/glm/include - ${PRJ_LIBS_ROOT}/pugixml/include - ${PRJ_LIBS_ROOT}/json/include - ${PRJ_LIBS_ROOT}/tess2/include - ${PRJ_LIBS_ROOT}/utf8/include - ${PRJ_LIBS_ROOT}/uriparser/include - ${CMAKE_SOURCE_DIR}/ - ${CMAKE_SOURCE_DIR}/ - ${OF_ANDROID} -) - -find_library(android-lib android) -find_library(log-lib log) -find_library(GLES2-lib GLESv2) - -#find_library(GLES1-lib GLESv1_CM) -#find_library(GLES3-lib GLESv3) - - -target_link_libraries(ofapp - EGL - GLESv2 - log - c - m - z - dl -# GLESv3 - ) - -target_link_libraries( ofapp - ${android-lib} ) -target_link_libraries( ofapp - ${GLES2-lib} ) -target_link_libraries( ofapp - ${log-lib} ) -#target_link_libraries( ofApp -# ${GLES3-lib} ) -#target_link_libraries( ofApp -# ${GLES1-lib} ) - -# Finally link in openFrameworks Library for each ABI -target_link_libraries( ofapp - ${OF_ANDROID_OUTPUT}/${ANDROID_ABI}/libopenFrameworksAndroid.so) diff --git a/examples/android/androidCompositeExample/ofApp/src/main/ic_launcher-playstore.png b/examples/android/androidCompositeExample/ofApp/src/main/ic_launcher-playstore.png deleted file mode 100644 index 2a0df19f5e0..00000000000 Binary files a/examples/android/androidCompositeExample/ofApp/src/main/ic_launcher-playstore.png and /dev/null differ diff --git a/examples/android/androidCompositeExample/ofApp/src/main/java/cc/openframeworks/android/OFActivity.java b/examples/android/androidCompositeExample/ofApp/src/main/java/cc/openframeworks/android/OFActivity.java deleted file mode 100644 index f0a6dc8d4e8..00000000000 --- a/examples/android/androidCompositeExample/ofApp/src/main/java/cc/openframeworks/android/OFActivity.java +++ /dev/null @@ -1,204 +0,0 @@ -package cc.openframeworks.android; - -import android.app.Activity; -import android.os.Build; -import android.os.Bundle; -import android.util.Log; -import android.view.Menu; -import android.view.MenuItem; -import android.view.View; -import android.view.WindowManager; - -import androidx.core.view.ViewCompat; -import androidx.core.view.WindowCompat; -import androidx.core.view.WindowInsetsCompat; -import androidx.core.view.WindowInsetsControllerCompat; - -import cc.openframeworks.OFAndroid; -import cc.openframeworks.OFAndroidController; -import cc.openframeworks.OFAndroidLifeCycle; -import cc.openframeworks.OFAndroidLifeCycleHelper; - -import com.getkeepsafe.relinker.ReLinker; - - - -public class OFActivity extends cc.openframeworks.OFActivity { - - private static final String appName = "ofapp"; // modify this to target appName (ofApp etc) - private static final String LOG_TAG = appName + "::OFActivity"; - - private ReLinker.Logger logcatLogger = new ReLinker.Logger() { - @Override - public void log(String message) { - Log.d("ReLinker", message); - } - }; - private OFActivity thisActivity; - - - // Extremely important - public OFActivity() { - OFAndroidLifeCycle.coreLibraryLoaded = true; - - OFAndroid.maxSamples = 4; - OFAndroid.maximumFrameRate = 144; - - thisActivity = this; - ReLinker.log(logcatLogger) - .force() - .recursively() - .loadLibrary(this, appName, new ReLinker.LoadListener() { - @Override - public void success() { - Log.i(LOG_TAG, "loadLibrary success"); - OFAndroidLifeCycle.appLibraryLoaded = true; - Setup(); // very important - this will in turn call main - } - - @Override - public void failure(Throwable t) { - /* Boo */ - Log.i(LOG_TAG, "loadLibrary failure" + t.getMessage()); - } - }); - } - - @Override - public void onCreate(Bundle savedInstanceState) - { - Log.i(LOG_TAG, "onCreate"); - super.onCreate(savedInstanceState); - - setFullscreen(); - hideSystemBars(); - } - - @Override - public void onStart() { - super.onStart(); - - } - - @Override - public void onDetachedFromWindow() { - - } - - // Menus - // http://developer.android.com/guide/topics/ui/menus.html - @Override - public boolean onCreateOptionsMenu(Menu menu) { - // Create settings menu options from here, one by one or infalting an xml - return super.onCreateOptionsMenu(menu); - } - - @Override - public boolean onOptionsItemSelected(MenuItem item) { - // This passes the menu option string to OF - // you can add additional behavior from java modifying this method - // but keep the call to OFAndroid so OF is notified of menu events - if(OFAndroid.menuItemSelected(item.getItemId())){ - - return true; - } - return super.onOptionsItemSelected(item); - } - - - @Override - public boolean onPrepareOptionsMenu (Menu menu){ - // This method is called every time the menu is opened - // you can add or remove menu options from here - return super.onPrepareOptionsMenu(menu); - } - - public void onRestore() { - - if (!OFAndroidLifeCycle.appLibraryLoaded) return; - } - - private void hideSystemBars() { - WindowInsetsControllerCompat windowInsetsController = - ViewCompat.getWindowInsetsController(getWindow().getDecorView()); - if (windowInsetsController == null) { - return; - } - // Configure the behavior of the hidden system bars - windowInsetsController.setSystemBarsBehavior( - WindowInsetsControllerCompat.BEHAVIOR_SHOW_TRANSIENT_BARS_BY_SWIPE - ); - // Hide both the status bar and the navigation bar - windowInsetsController.hide(WindowInsetsCompat.Type.systemBars()); - } - - @Override - public void onWindowFocusChanged(boolean hasFocus) { - super.onWindowFocusChanged(hasFocus); - - if (hasFocus) { - if (Build.VERSION.SDK_INT < Build.VERSION_CODES.KITKAT) { - - setFullscreen(); - } else { - setFullscreen(); - } - } else { - - } - } - - private void handleException(Exception e, String details) { - Log.e(LOG_TAG, "Exception:", e); - - } - - public void setFullscreen() { - try { - if (Build.VERSION.SDK_INT < Build.VERSION_CODES.KITKAT) { - // No sticky immersive mode for devices pre-kitkat - getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN, - WindowManager.LayoutParams.FLAG_FULLSCREEN); - } else { - View decorView = getWindow().getDecorView(); -// int uiOptions = View.SYSTEM_UI_FLAG_FULLSCREEN; - int uiOptions = View.SYSTEM_UI_FLAG_LAYOUT_STABLE - | View.SYSTEM_UI_FLAG_LAYOUT_HIDE_NAVIGATION - | View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN - | View.SYSTEM_UI_FLAG_HIDE_NAVIGATION - | View.SYSTEM_UI_FLAG_FULLSCREEN - | View.SYSTEM_UI_FLAG_IMMERSIVE_STICKY; - decorView.setSystemUiVisibility(uiOptions); - } - - WindowCompat.setDecorFitsSystemWindows(getWindow(), false); - - } catch (Exception ex) { - handleException(ex, "setFullscreen exception"); - } - - try { - View decorView = getWindow().getDecorView(); - int[] locations = new int[2]; - decorView.getLocationInWindow(locations); - int[] locations2 = new int[2]; - decorView.getLocationOnScreen(locations2); - - } catch (Exception ex) { - handleException(ex, "setFullscreen exception"); - } - - WindowInsetsControllerCompat windowInsetsController = - ViewCompat.getWindowInsetsController(getWindow().getDecorView()); - if (windowInsetsController == null) { - return; - } - // Hide both the status bar and the navigation bar - windowInsetsController.hide(WindowInsetsCompat.Type.systemBars()); - windowInsetsController.hide(WindowInsetsCompat.Type.navigationBars()); - windowInsetsController.hide(WindowInsetsCompat.Type.statusBars()); - } - - -} - diff --git a/examples/android/androidCompositeExample/ofApp/src/main/res/drawable-hdpi/icon.png b/examples/android/androidCompositeExample/ofApp/src/main/res/drawable-hdpi/icon.png deleted file mode 100644 index 70b562fba01..00000000000 Binary files a/examples/android/androidCompositeExample/ofApp/src/main/res/drawable-hdpi/icon.png and /dev/null differ diff --git a/examples/android/androidCompositeExample/ofApp/src/main/res/drawable-mdpi/icon.png b/examples/android/androidCompositeExample/ofApp/src/main/res/drawable-mdpi/icon.png deleted file mode 100644 index 70b562fba01..00000000000 Binary files a/examples/android/androidCompositeExample/ofApp/src/main/res/drawable-mdpi/icon.png and /dev/null differ diff --git a/examples/android/androidCompositeExample/ofApp/src/main/res/drawable-xhdpi/icon.png b/examples/android/androidCompositeExample/ofApp/src/main/res/drawable-xhdpi/icon.png deleted file mode 100644 index 70b562fba01..00000000000 Binary files a/examples/android/androidCompositeExample/ofApp/src/main/res/drawable-xhdpi/icon.png and /dev/null differ diff --git a/examples/android/androidCompositeExample/ofApp/src/main/res/drawable/icon.png b/examples/android/androidCompositeExample/ofApp/src/main/res/drawable/icon.png deleted file mode 100644 index 70b562fba01..00000000000 Binary files a/examples/android/androidCompositeExample/ofApp/src/main/res/drawable/icon.png and /dev/null differ diff --git a/examples/android/androidCompositeExample/ofApp/src/main/res/layout/main_layout.xml b/examples/android/androidCompositeExample/ofApp/src/main/res/layout/main_layout.xml deleted file mode 100644 index d1da461f079..00000000000 --- a/examples/android/androidCompositeExample/ofApp/src/main/res/layout/main_layout.xml +++ /dev/null @@ -1,24 +0,0 @@ - - - - - - diff --git a/examples/android/androidCompositeExample/ofApp/src/main/res/menu/main_layout.xml b/examples/android/androidCompositeExample/ofApp/src/main/res/menu/main_layout.xml deleted file mode 100644 index 7ddcfbee35e..00000000000 --- a/examples/android/androidCompositeExample/ofApp/src/main/res/menu/main_layout.xml +++ /dev/null @@ -1,8 +0,0 @@ - - - - - \ No newline at end of file diff --git a/examples/android/androidCompositeExample/ofApp/src/main/res/mipmap-anydpi-v26/ic_launcher.xml b/examples/android/androidCompositeExample/ofApp/src/main/res/mipmap-anydpi-v26/ic_launcher.xml deleted file mode 100644 index 036d09bc5fd..00000000000 --- a/examples/android/androidCompositeExample/ofApp/src/main/res/mipmap-anydpi-v26/ic_launcher.xml +++ /dev/null @@ -1,5 +0,0 @@ - - - - - \ No newline at end of file diff --git a/examples/android/androidCompositeExample/ofApp/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml b/examples/android/androidCompositeExample/ofApp/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml deleted file mode 100644 index 036d09bc5fd..00000000000 --- a/examples/android/androidCompositeExample/ofApp/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml +++ /dev/null @@ -1,5 +0,0 @@ - - - - - \ No newline at end of file diff --git a/examples/android/androidCompositeExample/ofApp/src/main/res/mipmap-hdpi/ic_launcher.png b/examples/android/androidCompositeExample/ofApp/src/main/res/mipmap-hdpi/ic_launcher.png deleted file mode 100644 index 42b40d2fbec..00000000000 Binary files a/examples/android/androidCompositeExample/ofApp/src/main/res/mipmap-hdpi/ic_launcher.png and /dev/null differ diff --git a/examples/android/androidCompositeExample/ofApp/src/main/res/mipmap-hdpi/ic_launcher_foreground.png b/examples/android/androidCompositeExample/ofApp/src/main/res/mipmap-hdpi/ic_launcher_foreground.png deleted file mode 100644 index 648779fe415..00000000000 Binary files a/examples/android/androidCompositeExample/ofApp/src/main/res/mipmap-hdpi/ic_launcher_foreground.png and /dev/null differ diff --git a/examples/android/androidCompositeExample/ofApp/src/main/res/mipmap-hdpi/ic_launcher_round.png b/examples/android/androidCompositeExample/ofApp/src/main/res/mipmap-hdpi/ic_launcher_round.png deleted file mode 100644 index a39d8826804..00000000000 Binary files a/examples/android/androidCompositeExample/ofApp/src/main/res/mipmap-hdpi/ic_launcher_round.png and /dev/null differ diff --git a/examples/android/androidCompositeExample/ofApp/src/main/res/mipmap-mdpi/ic_launcher.png b/examples/android/androidCompositeExample/ofApp/src/main/res/mipmap-mdpi/ic_launcher.png deleted file mode 100644 index 13e6dfef882..00000000000 Binary files a/examples/android/androidCompositeExample/ofApp/src/main/res/mipmap-mdpi/ic_launcher.png and /dev/null differ diff --git a/examples/android/androidCompositeExample/ofApp/src/main/res/mipmap-mdpi/ic_launcher_foreground.png b/examples/android/androidCompositeExample/ofApp/src/main/res/mipmap-mdpi/ic_launcher_foreground.png deleted file mode 100644 index 67b93c29890..00000000000 Binary files a/examples/android/androidCompositeExample/ofApp/src/main/res/mipmap-mdpi/ic_launcher_foreground.png and /dev/null differ diff --git a/examples/android/androidCompositeExample/ofApp/src/main/res/mipmap-mdpi/ic_launcher_round.png b/examples/android/androidCompositeExample/ofApp/src/main/res/mipmap-mdpi/ic_launcher_round.png deleted file mode 100644 index 93401eaf855..00000000000 Binary files a/examples/android/androidCompositeExample/ofApp/src/main/res/mipmap-mdpi/ic_launcher_round.png and /dev/null differ diff --git a/examples/android/androidCompositeExample/ofApp/src/main/res/mipmap-xhdpi/ic_launcher.png b/examples/android/androidCompositeExample/ofApp/src/main/res/mipmap-xhdpi/ic_launcher.png deleted file mode 100644 index 018f9b90738..00000000000 Binary files a/examples/android/androidCompositeExample/ofApp/src/main/res/mipmap-xhdpi/ic_launcher.png and /dev/null differ diff --git a/examples/android/androidCompositeExample/ofApp/src/main/res/mipmap-xhdpi/ic_launcher_foreground.png b/examples/android/androidCompositeExample/ofApp/src/main/res/mipmap-xhdpi/ic_launcher_foreground.png deleted file mode 100644 index fc64ec1c838..00000000000 Binary files a/examples/android/androidCompositeExample/ofApp/src/main/res/mipmap-xhdpi/ic_launcher_foreground.png and /dev/null differ diff --git a/examples/android/androidCompositeExample/ofApp/src/main/res/mipmap-xhdpi/ic_launcher_round.png b/examples/android/androidCompositeExample/ofApp/src/main/res/mipmap-xhdpi/ic_launcher_round.png deleted file mode 100644 index 486c62f1f2a..00000000000 Binary files a/examples/android/androidCompositeExample/ofApp/src/main/res/mipmap-xhdpi/ic_launcher_round.png and /dev/null differ diff --git a/examples/android/androidCompositeExample/ofApp/src/main/res/mipmap-xxhdpi/ic_launcher.png b/examples/android/androidCompositeExample/ofApp/src/main/res/mipmap-xxhdpi/ic_launcher.png deleted file mode 100644 index cf6c612f8b1..00000000000 Binary files a/examples/android/androidCompositeExample/ofApp/src/main/res/mipmap-xxhdpi/ic_launcher.png and /dev/null differ diff --git a/examples/android/androidCompositeExample/ofApp/src/main/res/mipmap-xxhdpi/ic_launcher_foreground.png b/examples/android/androidCompositeExample/ofApp/src/main/res/mipmap-xxhdpi/ic_launcher_foreground.png deleted file mode 100644 index 07b98443e1b..00000000000 Binary files a/examples/android/androidCompositeExample/ofApp/src/main/res/mipmap-xxhdpi/ic_launcher_foreground.png and /dev/null differ diff --git a/examples/android/androidCompositeExample/ofApp/src/main/res/mipmap-xxhdpi/ic_launcher_round.png b/examples/android/androidCompositeExample/ofApp/src/main/res/mipmap-xxhdpi/ic_launcher_round.png deleted file mode 100644 index b4024c5aa00..00000000000 Binary files a/examples/android/androidCompositeExample/ofApp/src/main/res/mipmap-xxhdpi/ic_launcher_round.png and /dev/null differ diff --git a/examples/android/androidCompositeExample/ofApp/src/main/res/mipmap-xxxhdpi/ic_launcher.png b/examples/android/androidCompositeExample/ofApp/src/main/res/mipmap-xxxhdpi/ic_launcher.png deleted file mode 100644 index 60b1a9e8332..00000000000 Binary files a/examples/android/androidCompositeExample/ofApp/src/main/res/mipmap-xxxhdpi/ic_launcher.png and /dev/null differ diff --git a/examples/android/androidCompositeExample/ofApp/src/main/res/mipmap-xxxhdpi/ic_launcher_foreground.png b/examples/android/androidCompositeExample/ofApp/src/main/res/mipmap-xxxhdpi/ic_launcher_foreground.png deleted file mode 100644 index 45bd0178fee..00000000000 Binary files a/examples/android/androidCompositeExample/ofApp/src/main/res/mipmap-xxxhdpi/ic_launcher_foreground.png and /dev/null differ diff --git a/examples/android/androidCompositeExample/ofApp/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png b/examples/android/androidCompositeExample/ofApp/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png deleted file mode 100644 index 1b64c2ce02d..00000000000 Binary files a/examples/android/androidCompositeExample/ofApp/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png and /dev/null differ diff --git a/examples/android/androidCompositeExample/ofApp/src/main/res/values-v11/strings.xml b/examples/android/androidCompositeExample/ofApp/src/main/res/values-v11/strings.xml deleted file mode 100644 index 29c67ba8fc4..00000000000 --- a/examples/android/androidCompositeExample/ofApp/src/main/res/values-v11/strings.xml +++ /dev/null @@ -1,5 +0,0 @@ - - - ofExample - Menu - \ No newline at end of file diff --git a/examples/android/androidCompositeExample/ofApp/src/main/res/values-v11/styles.xml b/examples/android/androidCompositeExample/ofApp/src/main/res/values-v11/styles.xml deleted file mode 100644 index febc4d0286b..00000000000 --- a/examples/android/androidCompositeExample/ofApp/src/main/res/values-v11/styles.xml +++ /dev/null @@ -1,11 +0,0 @@ - - - - - - diff --git a/examples/android/androidCompositeExample/ofApp/src/main/res/values-v14/strings.xml b/examples/android/androidCompositeExample/ofApp/src/main/res/values-v14/strings.xml deleted file mode 100644 index 29c67ba8fc4..00000000000 --- a/examples/android/androidCompositeExample/ofApp/src/main/res/values-v14/strings.xml +++ /dev/null @@ -1,5 +0,0 @@ - - - ofExample - Menu - \ No newline at end of file diff --git a/examples/android/androidCompositeExample/ofApp/src/main/res/values-v14/styles.xml b/examples/android/androidCompositeExample/ofApp/src/main/res/values-v14/styles.xml deleted file mode 100644 index 928e0fd3d72..00000000000 --- a/examples/android/androidCompositeExample/ofApp/src/main/res/values-v14/styles.xml +++ /dev/null @@ -1,12 +0,0 @@ - - - - - - diff --git a/examples/android/androidCompositeExample/ofApp/src/main/res/values/ic_launcher_background.xml b/examples/android/androidCompositeExample/ofApp/src/main/res/values/ic_launcher_background.xml deleted file mode 100644 index c5d5899fdf0..00000000000 --- a/examples/android/androidCompositeExample/ofApp/src/main/res/values/ic_launcher_background.xml +++ /dev/null @@ -1,4 +0,0 @@ - - - #FFFFFF - \ No newline at end of file diff --git a/examples/android/androidCompositeExample/ofApp/src/main/res/values/strings.xml b/examples/android/androidCompositeExample/ofApp/src/main/res/values/strings.xml deleted file mode 100644 index 29c67ba8fc4..00000000000 --- a/examples/android/androidCompositeExample/ofApp/src/main/res/values/strings.xml +++ /dev/null @@ -1,5 +0,0 @@ - - - ofExample - Menu - \ No newline at end of file diff --git a/examples/android/androidCompositeExample/ofApp/src/main/res/values/styles.xml b/examples/android/androidCompositeExample/ofApp/src/main/res/values/styles.xml deleted file mode 100644 index 766a2c3f143..00000000000 --- a/examples/android/androidCompositeExample/ofApp/src/main/res/values/styles.xml +++ /dev/null @@ -1,20 +0,0 @@ - - - - - - - - - diff --git a/examples/android/androidCompositeExample/proguard.cfg b/examples/android/androidCompositeExample/proguard.cfg deleted file mode 100644 index faee26e7f2b..00000000000 --- a/examples/android/androidCompositeExample/proguard.cfg +++ /dev/null @@ -1,59 +0,0 @@ --optimizationpasses 5 --dontusemixedcaseclassnames --dontskipnonpubliclibraryclasses --dontpreverify --verbose --optimizations !code/simplification/arithmetic,!field/*,!class/merging/* - --keep public class * extends android.app.Activity --keep public class * extends android.app.Application --keep public class * extends android.app.Service --keep public class * extends android.content.BroadcastReceiver --keep public class * extends android.content.ContentProvider --keep public class * extends android.app.backup.BackupAgentHelper --keep public class * extends android.preference.Preference --keep public class com.android.vending.licensing.ILicensingService - --keep class com.google.android.gms.games.leaderboard.** { *; } --keep class com.google.android.gms.games.snapshot.** { *; } --keep class com.google.android.gms.games.achievement.** { *; } --keep class com.google.android.gms.games.event.** { *; } --keep class com.google.android.gms.games.stats.** { *; } --keep class com.google.android.gms.games.video.** { *; } --keep class com.google.android.gms.games.* { *; } - --keep class com.google.android.gms.signin.** { *; } --keep class com.google.android.gms.dynamic.** { *; } --keep class com.google.android.gms.dynamite.** { *; } --keep class com.google.android.gms.tasks.** { *; } --keep class com.google.android.gms.security.** { *; } --keep class com.google.android.gms.base.** { *; } --keep class com.google.android.gms.actions.** { *; } --keep class com.google.games.bridge.** { *; } --keep class com.google.android.gms.common.api.** { *; } --keep class com.google.android.gms.games.quest.** { *; } --keep class com.google.android.gms.nearby.** { *; } --keepclasseswithmembernames class * { - native ; -} - --keepclasseswithmembers class * { - public (android.content.Context, android.util.AttributeSet); -} - --keepclasseswithmembers class * { - public (android.content.Context, android.util.AttributeSet, int); -} - --keepclassmembers class * extends android.app.Activity { - public void *(android.view.View); -} - --keepclassmembers enum * { - public static **[] values(); - public static ** valueOf(java.lang.String); -} - --keep class * implements android.os.Parcelable { - public static final android.os.Parcelable$Creator *; -} diff --git a/examples/android/androidCompositeExample/settings.gradle b/examples/android/androidCompositeExample/settings.gradle deleted file mode 100644 index cb352f426c0..00000000000 --- a/examples/android/androidCompositeExample/settings.gradle +++ /dev/null @@ -1,11 +0,0 @@ -include ':ofApp' - -// Define the relative path to the openFrameworks project -def openFrameworksProjectPath = '../../../libs/openFrameworksCompiled/project' - -// Convert the relative path to an absolute path -def openFrameworksProjectAbsolutePath = new File(rootDir, openFrameworksProjectPath).absolutePath - -// Include the openFrameworks project -include ':openFrameworksProject' -project(':openFrameworksProject').projectDir = new File(openFrameworksProjectAbsolutePath) diff --git a/examples/android/androidCompositeExample/ofApp/src/main/cpp/main.cpp b/examples/android/androidCompositeExample/src/main.cpp similarity index 100% rename from examples/android/androidCompositeExample/ofApp/src/main/cpp/main.cpp rename to examples/android/androidCompositeExample/src/main.cpp diff --git a/examples/android/androidCompositeExample/ofApp/src/main/cpp/ofApp.cpp b/examples/android/androidCompositeExample/src/ofApp.cpp similarity index 100% rename from examples/android/androidCompositeExample/ofApp/src/main/cpp/ofApp.cpp rename to examples/android/androidCompositeExample/src/ofApp.cpp diff --git a/examples/android/androidCompositeExample/ofApp/src/main/cpp/ofApp.h b/examples/android/androidCompositeExample/src/ofApp.h similarity index 100% rename from examples/android/androidCompositeExample/ofApp/src/main/cpp/ofApp.h rename to examples/android/androidCompositeExample/src/ofApp.h diff --git a/examples/android/androidEmptyExample/build.gradle b/examples/android/androidEmptyExample/build.gradle deleted file mode 100644 index 7cbc7eb6714..00000000000 --- a/examples/android/androidEmptyExample/build.gradle +++ /dev/null @@ -1,22 +0,0 @@ -ext { - //var = 'signExample.keystore' -}// Top-level build file where you can add configuration options common to all sub-projects/modules. -buildscript { - repositories { - google() - mavenCentral() - } - dependencies { - classpath 'com.android.tools.build:gradle:7.4.2' - } -} - -allprojects { - repositories { - google() - mavenCentral() - } - ext { - - } -} diff --git a/examples/android/androidEmptyExample/gradle.properties b/examples/android/androidEmptyExample/gradle.properties deleted file mode 100644 index 43f9ef9e1c3..00000000000 --- a/examples/android/androidEmptyExample/gradle.properties +++ /dev/null @@ -1,10 +0,0 @@ -android.useAndroidX=true -android.enableJetifier=false -org.gradle.jvmargs=-Xmx2048m -Dfile.encoding=UTF-8 -kotlin.code.style=official -android.prefabVersion=1.0.+ -android.buildFeatures.prefab=true -#ndkBuild=false -# https://issuetracker.google.com/149575364 -android.enableParallelJsonGen=false -#googleplay=true \ No newline at end of file diff --git a/examples/android/androidEmptyExample/gradle/wrapper/gradle-wrapper.jar b/examples/android/androidEmptyExample/gradle/wrapper/gradle-wrapper.jar deleted file mode 100644 index 13372aef5e2..00000000000 Binary files a/examples/android/androidEmptyExample/gradle/wrapper/gradle-wrapper.jar and /dev/null differ diff --git a/examples/android/androidEmptyExample/gradle/wrapper/gradle-wrapper.properties b/examples/android/androidEmptyExample/gradle/wrapper/gradle-wrapper.properties deleted file mode 100644 index 2dd5ee8c795..00000000000 --- a/examples/android/androidEmptyExample/gradle/wrapper/gradle-wrapper.properties +++ /dev/null @@ -1,6 +0,0 @@ -#Mon Jun 12 01:17:57 AEST 2023 -distributionBase=GRADLE_USER_HOME -distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-7.5-bin.zip -zipStoreBase=GRADLE_USER_HOME -zipStorePath=wrapper/dists diff --git a/examples/android/androidEmptyExample/gradlew b/examples/android/androidEmptyExample/gradlew deleted file mode 100755 index 9d82f789151..00000000000 --- a/examples/android/androidEmptyExample/gradlew +++ /dev/null @@ -1,160 +0,0 @@ -#!/usr/bin/env bash - -############################################################################## -## -## Gradle start up script for UN*X -## -############################################################################## - -# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. -DEFAULT_JVM_OPTS="" - -APP_NAME="Gradle" -APP_BASE_NAME=`basename "$0"` - -# Use the maximum available, or set MAX_FD != -1 to use that value. -MAX_FD="maximum" - -warn ( ) { - echo "$*" -} - -die ( ) { - echo - echo "$*" - echo - exit 1 -} - -# OS specific support (must be 'true' or 'false'). -cygwin=false -msys=false -darwin=false -case "`uname`" in - CYGWIN* ) - cygwin=true - ;; - Darwin* ) - darwin=true - ;; - MINGW* ) - msys=true - ;; -esac - -# Attempt to set APP_HOME -# Resolve links: $0 may be a link -PRG="$0" -# Need this for relative symlinks. -while [ -h "$PRG" ] ; do - ls=`ls -ld "$PRG"` - link=`expr "$ls" : '.*-> \(.*\)$'` - if expr "$link" : '/.*' > /dev/null; then - PRG="$link" - else - PRG=`dirname "$PRG"`"/$link" - fi -done -SAVED="`pwd`" -cd "`dirname \"$PRG\"`/" >/dev/null -APP_HOME="`pwd -P`" -cd "$SAVED" >/dev/null - -CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar - -# Determine the Java command to use to start the JVM. -if [ -n "$JAVA_HOME" ] ; then - if [ -x "$JAVA_HOME/jre/sh/java" ] ; then - # IBM's JDK on AIX uses strange locations for the executables - JAVACMD="$JAVA_HOME/jre/sh/java" - else - JAVACMD="$JAVA_HOME/bin/java" - fi - if [ ! -x "$JAVACMD" ] ; then - die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME - -Please set the JAVA_HOME variable in your environment to match the -location of your Java installation." - fi -else - JAVACMD="java" - which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. - -Please set the JAVA_HOME variable in your environment to match the -location of your Java installation." -fi - -# Increase the maximum file descriptors if we can. -if [ "$cygwin" = "false" -a "$darwin" = "false" ] ; then - MAX_FD_LIMIT=`ulimit -H -n` - if [ $? -eq 0 ] ; then - if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then - MAX_FD="$MAX_FD_LIMIT" - fi - ulimit -n $MAX_FD - if [ $? -ne 0 ] ; then - warn "Could not set maximum file descriptor limit: $MAX_FD" - fi - else - warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT" - fi -fi - -# For Darwin, add options to specify how the application appears in the dock -if $darwin; then - GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\"" -fi - -# For Cygwin, switch paths to Windows format before running java -if $cygwin ; then - APP_HOME=`cygpath --path --mixed "$APP_HOME"` - CLASSPATH=`cygpath --path --mixed "$CLASSPATH"` - JAVACMD=`cygpath --unix "$JAVACMD"` - - # We build the pattern for arguments to be converted via cygpath - ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null` - SEP="" - for dir in $ROOTDIRSRAW ; do - ROOTDIRS="$ROOTDIRS$SEP$dir" - SEP="|" - done - OURCYGPATTERN="(^($ROOTDIRS))" - # Add a user-defined pattern to the cygpath arguments - if [ "$GRADLE_CYGPATTERN" != "" ] ; then - OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)" - fi - # Now convert the arguments - kludge to limit ourselves to /bin/sh - i=0 - for arg in "$@" ; do - CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -` - CHECK2=`echo "$arg"|egrep -c "^-"` ### Determine if an option - - if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then ### Added a condition - eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"` - else - eval `echo args$i`="\"$arg\"" - fi - i=$((i+1)) - done - case $i in - (0) set -- ;; - (1) set -- "$args0" ;; - (2) set -- "$args0" "$args1" ;; - (3) set -- "$args0" "$args1" "$args2" ;; - (4) set -- "$args0" "$args1" "$args2" "$args3" ;; - (5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;; - (6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;; - (7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;; - (8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;; - (9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;; - esac -fi - -# Split up the JVM_OPTS And GRADLE_OPTS values into an array, following the shell quoting and substitution rules -function splitJvmOpts() { - JVM_OPTS=("$@") -} -eval splitJvmOpts $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS -JVM_OPTS[${#JVM_OPTS[*]}]="-Dorg.gradle.appname=$APP_BASE_NAME" - -exec "$JAVACMD" "${JVM_OPTS[@]}" -classpath "$CLASSPATH" org.gradle.wrapper.GradleWrapperMain "$@" diff --git a/examples/android/androidEmptyExample/gradlew.bat b/examples/android/androidEmptyExample/gradlew.bat deleted file mode 100644 index 8a0b282aa68..00000000000 --- a/examples/android/androidEmptyExample/gradlew.bat +++ /dev/null @@ -1,90 +0,0 @@ -@if "%DEBUG%" == "" @echo off -@rem ########################################################################## -@rem -@rem Gradle startup script for Windows -@rem -@rem ########################################################################## - -@rem Set local scope for the variables with windows NT shell -if "%OS%"=="Windows_NT" setlocal - -@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. -set DEFAULT_JVM_OPTS= - -set DIRNAME=%~dp0 -if "%DIRNAME%" == "" set DIRNAME=. -set APP_BASE_NAME=%~n0 -set APP_HOME=%DIRNAME% - -@rem Find java.exe -if defined JAVA_HOME goto findJavaFromJavaHome - -set JAVA_EXE=java.exe -%JAVA_EXE% -version >NUL 2>&1 -if "%ERRORLEVEL%" == "0" goto init - -echo. -echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. -echo. -echo Please set the JAVA_HOME variable in your environment to match the -echo location of your Java installation. - -goto fail - -:findJavaFromJavaHome -set JAVA_HOME=%JAVA_HOME:"=% -set JAVA_EXE=%JAVA_HOME%/bin/java.exe - -if exist "%JAVA_EXE%" goto init - -echo. -echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% -echo. -echo Please set the JAVA_HOME variable in your environment to match the -echo location of your Java installation. - -goto fail - -:init -@rem Get command-line arguments, handling Windowz variants - -if not "%OS%" == "Windows_NT" goto win9xME_args -if "%@eval[2+2]" == "4" goto 4NT_args - -:win9xME_args -@rem Slurp the command line arguments. -set CMD_LINE_ARGS= -set _SKIP=2 - -:win9xME_args_slurp -if "x%~1" == "x" goto execute - -set CMD_LINE_ARGS=%* -goto execute - -:4NT_args -@rem Get arguments from the 4NT Shell from JP Software -set CMD_LINE_ARGS=%$ - -:execute -@rem Setup the command line - -set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar - -@rem Execute Gradle -"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS% - -:end -@rem End local scope for the variables with windows NT shell -if "%ERRORLEVEL%"=="0" goto mainEnd - -:fail -rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of -rem the _cmd.exe /c_ return code! -if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1 -exit /b 1 - -:mainEnd -if "%OS%"=="Windows_NT" endlocal - -:omega diff --git a/examples/android/androidEmptyExample/local.properties b/examples/android/androidEmptyExample/local.properties deleted file mode 100644 index 5ba01764b38..00000000000 --- a/examples/android/androidEmptyExample/local.properties +++ /dev/null @@ -1,8 +0,0 @@ -## This file must *NOT* be checked into Version Control Systems, -# as it contains information specific to your local configuration. -# -# Location of the SDK. This is only used by Gradle. -# For customization when using a Version Control System, please read the -# header note. -#Wed May 08 13:54:16 CEST 2024 -sdk.dir=/Users/thierry/Library/Android/sdk diff --git a/examples/android/androidEmptyExample/ofApp/build.gradle b/examples/android/androidEmptyExample/ofApp/build.gradle deleted file mode 100644 index 4ac7015c9c9..00000000000 --- a/examples/android/androidEmptyExample/ofApp/build.gradle +++ /dev/null @@ -1,182 +0,0 @@ -plugins { - id 'com.android.application' -} - -def CMAKELIST_PATH = './src/main/cpp' -def CPP_SOURCE = './src/main/cpp' -def JAVA_SOURCE = './src/main/java' - -// pointing to cmake's source code for the same project -def PRJ_SRC_ROOT = './src/main' -def ofRoot(){ return '../../../../' } -final ofSource = ofRoot() + 'libs/openFrameworks' -final ofLibs = ofRoot() + 'libs' -final addons = ofRoot() + 'addons' -final ofLibOutput = ofRoot() + 'libs/openFrameworksCompiled/lib/android' -def OFX_ANDROID = ofRoot() + 'addons/ofxAndroid' -//def OF_ADDONS_ARGUMENTS = "${OF_ADDONS}" -def enableProguardInReleaseBuilds = true -def enableProguardInDebugBuilds = false - -task wrapper(type: Wrapper) { - gradleVersion = '7.3.3' -} -tasks.register("prepareKotlinBuildScriptModel"){ -} - -evaluationDependsOn(':openFrameworksProject') - -tasks.whenTaskAdded { task -> - if (task.name == 'assemble') { - task.dependsOn(':openFrameworksProject:assemble') - } -} - - -android { - compileSdkVersion 34 - buildToolsVersion '32.0.0' - //ndkPath "/Users/x/android-ndk-r21e" // Point to your own NDK if needed - ndkVersion '24.0.8215888' // use android studio side loaded ndk - buildFeatures { - prefab true - } - signingConfigs { - debug { - } - release { - storeFile new File("${System.properties['user.home']}/.android/debug.keystore") - storePassword 'android' - storeType "jks" - keyAlias 'androiddebugkey' - keyPassword 'android' - } - } - defaultConfig { - applicationId "cc.openframeworks.androidEmptyExample" // IMPORTANT : THIS DEFINES THE ID OF THE APK - minSdkVersion 21 - targetSdkVersion 34 - versionCode 12 - versionName '12.0' - ndk.abiFilters 'armeabi-v7a', 'arm64-v8a', 'x86' //, 'x86_64' - - externalNativeBuild { - if (!project.hasProperty("ndkBuild")) { - cmake { - arguments "-DANDROID_STL=c++_shared", - "-DANDROID_ARM_NEON=TRUE", - "-DANDROID_TOOLCHAIN=clang", - //"${OF_ADDONS_ARGUMENTS}", - "-DTARGET_OPENGLES=TRUE" - - version '3.22.1' - } - } - } - multiDexEnabled false - } - buildTypes { - release { - signingConfig signingConfigs.release - jniDebuggable false - debuggable false - minifyEnabled false - shrinkResources false - proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro' - signingConfig signingConfigs.release - } - debug { - jniDebuggable true - debuggable true - minifyEnabled false - shrinkResources false - signingConfig signingConfigs.debug - } - } - flavorDimensions "version" - productFlavors { - playstore { - applicationIdSuffix "" - signingConfig signingConfigs.release - } -// humble { -// applicationIdSuffix ".humble" -// } -// amazon { -// applicationIdSuffix ".amazon" -// } -// samsung { -// applicationIdSuffix ".samsung" -// } -// oppo { -// applicationIdSuffix ".oppo" -// } - } - sourceSets { - main { - manifest.srcFile "${PRJ_SRC_ROOT}/AndroidManifest.xml" - java.srcDirs = ["${PRJ_SRC_ROOT}/java", - "${OFX_ANDROID}/Java"] - res.srcDirs = ["${PRJ_SRC_ROOT}/res"] -// jniLibs.srcDirs = ["${OF_ANDROID_OUTPUT}", "lib"] // Pre Android Studio 2022.2.1 - assets { - srcDirs 'src/main/assets', 'src/main/bin/data' - } - } - } - externalNativeBuild { - if (!project.hasProperty("ndkBuild")) { - cmake { - path "${CMAKELIST_PATH}/CMakeLists.txt" - } - } else { - ndkBuild { - path "${CMAKELIST_PATH}/Android.mk" - } - } - } - compileOptions { - sourceCompatibility JavaVersion.VERSION_1_8 - targetCompatibility JavaVersion.VERSION_1_8 - } - androidResources { - noCompress '' - } - dependenciesInfo { - includeInApk false - includeInBundle false - } -// testOptions { -// devices { -// pixel2api29 (com.android.build.api.dsl.ManagedVirtualDevice) { -// // Use device profiles you typically see in -// // Android Studio -// device = "Pixel 2" -// apiLevel = 29 -// // You can also specify "aosp" if you don’t require -// // Google Play Services. -// systemImageSource = "google" -// abi = "x86" -// } -// } -// } -} - - -dependencies { - implementation fileTree(dir: 'libs', include: ['*.jar']) - implementation 'androidx.appcompat:appcompat:1.6.1' - implementation 'androidx.constraintlayout:constraintlayout:2.1.4' - implementation 'androidx.legacy:legacy-support-v4:1.0.0' - implementation "com.getkeepsafe.relinker:relinker:1.4.5" - implementation 'com.google.android.material:material:1.9.0' - if (project.hasProperty("googleplay")) { - implementation "com.google.android.gms:play-services-games:22.0.1" - implementation "com.google.android.gms:play-services-auth:20.0.1" - implementation "com.google.android.gms:play-services-base:18.0.1" - implementation "com.google.android.gms:play-services-basement:18.0.0" - implementation "com.google.android.gms:play-services-instantapps:18.0.1" - implementation "com.google.android.gms:play-services-appset:16.0.2" - } -} - diff --git a/examples/android/androidEmptyExample/ofApp/gradle.properties b/examples/android/androidEmptyExample/ofApp/gradle.properties deleted file mode 100644 index f96a9f246a0..00000000000 --- a/examples/android/androidEmptyExample/ofApp/gradle.properties +++ /dev/null @@ -1,11 +0,0 @@ -android.useAndroidX=true -android.enableJetifier=true -org.gradle.jvmargs=-Xmx2048m -Dfile.encoding=UTF-8 -kotlin.code.style=official -android.prefabVersion=1.0.+ -# Workaround bug in AGP where the prefab dependency is being resolved from a -# non-Gradle thread when enableParallelJsonGen is enabled. -# https://issuetracker.google.com/149575364 -android.enableParallelJsonGen=false -android.buildFeatures.prefab = true -vectorDrawables.useSupportLibrary = true \ No newline at end of file diff --git a/examples/android/androidEmptyExample/ofApp/gradle/wrapper/gradle-wrapper.jar b/examples/android/androidEmptyExample/ofApp/gradle/wrapper/gradle-wrapper.jar deleted file mode 100644 index 249e5832f09..00000000000 Binary files a/examples/android/androidEmptyExample/ofApp/gradle/wrapper/gradle-wrapper.jar and /dev/null differ diff --git a/examples/android/androidEmptyExample/ofApp/gradle/wrapper/gradle-wrapper.properties b/examples/android/androidEmptyExample/ofApp/gradle/wrapper/gradle-wrapper.properties deleted file mode 100644 index 2e6e5897b52..00000000000 --- a/examples/android/androidEmptyExample/ofApp/gradle/wrapper/gradle-wrapper.properties +++ /dev/null @@ -1,5 +0,0 @@ -distributionBase=GRADLE_USER_HOME -distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-7.3.3-bin.zip -zipStoreBase=GRADLE_USER_HOME -zipStorePath=wrapper/dists diff --git a/examples/android/androidEmptyExample/ofApp/proguard-rules.pro b/examples/android/androidEmptyExample/ofApp/proguard-rules.pro deleted file mode 100644 index de8c62143ce..00000000000 --- a/examples/android/androidEmptyExample/ofApp/proguard-rules.pro +++ /dev/null @@ -1,127 +0,0 @@ -# Add project specific ProGuard rules here. -# You can control the set of applied configuration files using the -# proguardFiles setting in build.gradle. -# -# For more details, see -# http://developer.android.com/guide/developing/tools/proguard.html - --dontoptimize --dontshrink -#-dontusemixedcaseclassnames -#-dontskipnonpubliclibraryclasses -#-dontpreverify -#-verbose -# --optimizationpasses 7 # use for final build --dontusemixedcaseclassnames -#-dontskipnonpubliclibraryclasses -#-dontpreverify --verbose - -# custom app activity proguard --keep public class cc.openframeworks.android.OFActivity { public ; } --keep public class cc.openframeworks.android.R { public ; } - - -#-dontobfuscate android classes --keep public class * extends android.app.Activity --keep public class * extends android.app.Application --keep public class * extends android.app.Service --keep public class * extends android.content.BroadcastReceiver --keep public class * extends android.content.ContentProvider --keep public class * extends android.app.backup.BackupAgentHelper --keep public class * extends android.preference.Preference - -#-dontobfuscate openFrameworks android classes --keep public class cc.openframeworks.OFAndroid { public ; } --keep public class cc.openframeworks.OFAndroidLifeCycleHelper { public ; } --keep public class cc.openframeworks.OFAndroidWindow { public ; } --keep public class cc.openframeworks.OFAndroidSoundPlayer { public ; } --keep public class cc.openframeworks.OFGLSurfaceView { public ; } --keep public class cc.openframeworks.OFAndroidLifeCycle { public ; } --keep public class cc.openframeworks.OFActivity { public ; } --keep public class cc.openframeworks.ContextFactory { public ; } --keep public class cc.openframeworks.OFEGLConfigChooser { public ; } --keep public class cc.openframeworks.OFGestureListener { public ; } --keep public class cc.openframeworks.OFAndroidController { public ; } - -#-dontobfuscate GooglePlay Games android classes if used --keep class com.google.android.gms.games.leaderboard.** { *; } --keep class com.google.android.gms.games.snapshot.** { *; } --keep class com.google.android.gms.games.achievement.** { *; } --keep class com.google.android.gms.games.event.** { *; } --keep class com.google.android.gms.games.stats.** { *; } --keep class com.google.android.gms.games.video.** { *; } --keep class com.google.android.gms.games.* { *; } --keep class com.google.android.gms.signin.** { *; } --keep class com.google.android.gms.dynamic.** { *; } --keep class com.google.android.gms.dynamite.** { *; } --keep class com.google.android.gms.tasks.** { *; } --keep class com.google.android.gms.security.** { *; } --keep class com.google.android.gms.base.** { *; } --keep class com.google.android.gms.actions.** { *; } --keep class com.google.games.bridge.** { *; } --keep class com.google.android.gms.common.api.** { *; } --keep class com.google.android.gms.games.quest.** { *; } --keep class com.google.android.gms.nearby.** { *; } - --keepclasseswithmembernames class * { - native ; -} - --keepclasseswithmembers class * { - public (android.content.Context, android.util.AttributeSet); -} - --keepclasseswithmembers class * { - public (android.content.Context, android.util.AttributeSet, int); -} - -# note that means any method --keepclasseswithmembernames,includedescriptorclasses class * { - native ; -} - --keepclassmembers class * extends android.app.Activity { - public void *(android.view.View); -} - --keepclassmembers enum * { - public static **[] values(); - public static ** valueOf(java.lang.String); -} - --keep class * implements android.os.Parcelable { - public static final android.os.Parcelable$Creator *; -} - - -# If your project uses WebView with JS, uncomment the following -# and specify the fully qualified class name to the JavaScript interface -# class: -#-keepclassmembers class fqcn.of.javascript.interface.for.webview { -# public *; -#} - -# Uncomment this to preserve the line number information for -# debugging stack traces. -#-keepattributes SourceFile,LineNumberTable - -# If you keep the line number information, uncomment this to -# hide the original source file name. -#-renamesourcefileattribute SourceFile - -# If your project uses WebView with JS, uncomment the following -# and specify the fully qualified class name to the JavaScript interface -# class: -#-keepclassmembers class fqcn.of.javascript.interface.for.webview { -# public *; -#} - -# Uncomment this to preserve the line number information for -# debugging stack traces. --keepattributes SourceFile,LineNumberTable - -# If you keep the line number information, uncomment this to -# hide the original source file name. -#-renamesourcefileattribute SourceFile \ No newline at end of file diff --git a/examples/android/androidEmptyExample/ofApp/src/main/AndroidManifest.xml b/examples/android/androidEmptyExample/ofApp/src/main/AndroidManifest.xml deleted file mode 100644 index aae67ceba1b..00000000000 --- a/examples/android/androidEmptyExample/ofApp/src/main/AndroidManifest.xml +++ /dev/null @@ -1,89 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/examples/android/androidEmptyExample/ofApp/src/main/cpp/CMakeLists.txt b/examples/android/androidEmptyExample/ofApp/src/main/cpp/CMakeLists.txt deleted file mode 100644 index 5b160ffa42d..00000000000 --- a/examples/android/androidEmptyExample/ofApp/src/main/cpp/CMakeLists.txt +++ /dev/null @@ -1,142 +0,0 @@ -# Sets the minimum version of CMake required to build the native -# library. -cmake_minimum_required(VERSION 3.22.1) - -project(ofapp LANGUAGES CXX) -set(TARGET_ANDROID TRUE) - -set(LOCAL_PATH ${CMAKE_SOURCE_DIR}) -set(PRJ_OF_ROOT ${LOCAL_PATH}/../../../../../../../) - -set(PURE_OF_ROOT ${LOCAL_PATH}/../../../../../../../) -set(CORE_OF_ROOT ${PURE_OF_ROOT}/libs/openFrameworks) -set(LIBS_ROOT ${PURE_OF_ROOT}/libs) - -set(PRJ_ADDONS_PATH ${PURE_OF_ROOT}/addons) -set(PRJ_SOURCE_PATH ${LIBS_ROOT}/openFrameworks) -set(PRJ_LIBS_ROOT ${PURE_OF_ROOT}/libs) - -set(OF_ANDROID ${PURE_OF_ROOT}/libs/openFrameworksCompiled/project/android) -set(OF_ANDROID_OUTPUT ${PURE_OF_ROOT}/libs/openFrameworksCompiled/lib/android) - -set(PRJ_OFX_ANDROID_PATH ${PRJ_ADDONS_PATH}/ofxAndroid) -set(PRJ_OFX_ANDROID_CPP_PATH ${PRJ_OFX_ANDROID_PATH}/src) - -macro(print_all_variables) - message(STATUS "print_all_variables------------------------------------------{") - get_cmake_property(_variableNames VARIABLES) - foreach (_variableName ${_variableNames}) - message(STATUS "${_variableName}=${${_variableName}}") - endforeach() - message(STATUS "print_all_variables------------------------------------------}") -endmacro() - -# Custom function to check if the library is built -function(check_library) - if (NOT TARGET openFrameworksAndroid) - message(STATUS "openFrameworksAndroid Library not found. Building library...") - - # Invoke the build process for the library - execute_process( - COMMAND ${CMAKE_COMMAND} --build ${OF_ANDROID}/ - RESULT_VARIABLE result - ) - if (result) - message(FATAL_ERROR "Failed to build the library.") - endif () - endif () -endfunction() - -set(CMAKE_CXX_STANDARD 17) -set(CMAKE_CXX_STANDARD_REQUIRED ON) -set(CMAKE_CXX_EXTENSIONS ON) -set(TARGET_ANDROID ON) -set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -std=c17 -Oz -DNDEBUG -frtti --warn-uninitialized -fno-short-enums -Wextra -fPIE -fPIC -fuse-ld=gold -fexceptions -ffunction-sections -fdata-sections -Wall -Wextra -Wfloat-equal -Wundef -Werror -fverbose-asm -Wint-to-pointer-cast -Wshadow -Wpointer-arith -Wcast-align -Wstrict-prototypes -Wcast-qual -Wmissing-prototypes -Wstrict-overflow=5 -Wwrite-strings -Wconversion --pedantic-errors") -set(CMAKE_CPP_FLAGS "${CMAKE_C_FLAGS} -std=c++17 -Oz -DNDEBUG -stdlib=libc++ --warn-uninitialized -frtti -Wextra -fno-short-enums -fPIE -fPIC -fuse-ld=gold -fexceptions -ffunction-sections -fdata-sections -Wall -Wextra -Wfloat-equal -Wundef -Werror -fverbose-asm -Wint-to-pointer-cast -Wshadow -Wpointer-arith -Wcast-align -Wstrict-prototypes -Wcast-qual -Wmissing-prototypes -Wstrict-overflow=5 -Wwrite-strings -Wconversion --pedantic-errors") -set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -Wl,-export-dynamic") - -print_all_variables() - -# Creates the project's shared lib: libnative-lib.so. -# The lib is loaded by this project's Java code in MainActivity.java: -# System.loadLibrary("native-lib"); -# The lib name in both places must match. -add_library( ofapp #name - SHARED # type of library - # src files for project (just c/cpp) - ${CMAKE_SOURCE_DIR}/main.cpp - ${CMAKE_SOURCE_DIR}/ofApp.cpp - ) - - -# Specifies a path to native header files -include_directories( - # openFrameworks headers - ${PRJ_SOURCE_PATH}/3d - ${PRJ_SOURCE_PATH}/app - ${PRJ_SOURCE_PATH}/communication - ${PRJ_SOURCE_PATH}/events - ${PRJ_SOURCE_PATH}/gl - ${PRJ_SOURCE_PATH}/graphics - ${PRJ_SOURCE_PATH}/math - ${PRJ_SOURCE_PATH}/sound - ${PRJ_SOURCE_PATH}/types - ${PRJ_SOURCE_PATH}/utils - ${PRJ_SOURCE_PATH}/video - ${PRJ_SOURCE_PATH} - # openFrameworks addons includes - ${PURE_OF_ROOT}/addons/ofxAndroid/src - ${PURE_OF_ROOT}/addons/ofxAccelerometer/src - ${PURE_OF_ROOT}/addons/ofxXmlSettings/src - ${PURE_OF_ROOT}/addons/ofxXmlSettings/libs - # openFrameworks Libs includes - ${PRJ_LIBS_ROOT}/FreeImage/include - ${PRJ_LIBS_ROOT}/freetype/include - ${PRJ_LIBS_ROOT}/freetype/include/freetype2 - ${PRJ_LIBS_ROOT}/freetype/include/freetype2/freetype/config - ${PRJ_LIBS_ROOT}/freetype/include/freetype2/freetype/internal - ${PRJ_LIBS_ROOT}/freetype/include/freetype2/freetype/internal/services - ${PRJ_LIBS_ROOT}/glm/include - ${PRJ_LIBS_ROOT}/pugixml/include - ${PRJ_LIBS_ROOT}/json/include - ${PRJ_LIBS_ROOT}/tess2/include - ${PRJ_LIBS_ROOT}/utf8/include - ${PRJ_LIBS_ROOT}/uriparser/include - ${CMAKE_SOURCE_DIR}/ - ${CMAKE_SOURCE_DIR}/ - ${OF_ANDROID} -) - -find_library(android-lib android) -find_library(log-lib log) -find_library(GLES2-lib GLESv2) - -#find_library(GLES1-lib GLESv1_CM) -#find_library(GLES3-lib GLESv3) - - -target_link_libraries(ofapp - EGL - GLESv2 - log - c - m - z - dl -# GLESv3 - ) - -target_link_libraries( ofapp - ${android-lib} ) -target_link_libraries( ofapp - ${GLES2-lib} ) -target_link_libraries( ofapp - ${log-lib} ) -#target_link_libraries( ofApp -# ${GLES3-lib} ) -#target_link_libraries( ofApp -# ${GLES1-lib} ) - -# Finally link in openFrameworks Library for each ABI -target_link_libraries( ofapp - ${OF_ANDROID_OUTPUT}/${ANDROID_ABI}/libopenFrameworksAndroid.so) diff --git a/examples/android/androidEmptyExample/ofApp/src/main/ic_launcher-playstore.png b/examples/android/androidEmptyExample/ofApp/src/main/ic_launcher-playstore.png deleted file mode 100644 index 2a0df19f5e0..00000000000 Binary files a/examples/android/androidEmptyExample/ofApp/src/main/ic_launcher-playstore.png and /dev/null differ diff --git a/examples/android/androidEmptyExample/ofApp/src/main/java/cc/openframeworks/android/OFActivity.java b/examples/android/androidEmptyExample/ofApp/src/main/java/cc/openframeworks/android/OFActivity.java deleted file mode 100644 index 598ee50bbf1..00000000000 --- a/examples/android/androidEmptyExample/ofApp/src/main/java/cc/openframeworks/android/OFActivity.java +++ /dev/null @@ -1,201 +0,0 @@ -package cc.openframeworks.android; - -import android.os.Build; -import android.os.Bundle; -import android.util.Log; -import android.view.Menu; -import android.view.MenuItem; -import android.view.View; -import android.view.WindowManager; - -import androidx.core.view.ViewCompat; -import androidx.core.view.WindowCompat; -import androidx.core.view.WindowInsetsCompat; -import androidx.core.view.WindowInsetsControllerCompat; - -import cc.openframeworks.OFAndroid; -import cc.openframeworks.OFAndroidLifeCycle; - -import com.getkeepsafe.relinker.ReLinker; - - - -public class OFActivity extends cc.openframeworks.OFActivity { - - private static final String appName = "ofapp"; // modify this to target appName (ofApp etc) - private static final String LOG_TAG = appName + "::OFActivity"; - - private ReLinker.Logger logcatLogger = new ReLinker.Logger() { - @Override - public void log(String message) { - Log.d("ReLinker", message); - } - }; - private OFActivity thisActivity; - - - // Extremely important - public OFActivity() { - OFAndroidLifeCycle.coreLibraryLoaded = true; - - OFAndroid.maxSamples = 4; - OFAndroid.maximumFrameRate = 144; - - thisActivity = this; - ReLinker.log(logcatLogger) - .force() - .recursively() - .loadLibrary(this, appName, new ReLinker.LoadListener() { - @Override - public void success() { - Log.i(LOG_TAG, "loadLibrary success"); - OFAndroidLifeCycle.appLibraryLoaded = true; - Setup(); // very important - this will in turn call main - } - - @Override - public void failure(Throwable t) { - /* Boo */ - Log.i(LOG_TAG, "loadLibrary failure" + t.getMessage()); - } - }); - } - - @Override - public void onCreate(Bundle savedInstanceState) - { - Log.i(LOG_TAG, "onCreate"); - super.onCreate(savedInstanceState); - - setFullscreen(); - hideSystemBars(); - } - - @Override - public void onStart() { - super.onStart(); - - } - - @Override - public void onDetachedFromWindow() { - - } - - // Menus - // http://developer.android.com/guide/topics/ui/menus.html - @Override - public boolean onCreateOptionsMenu(Menu menu) { - // Create settings menu options from here, one by one or infalting an xml - return super.onCreateOptionsMenu(menu); - } - - @Override - public boolean onOptionsItemSelected(MenuItem item) { - // This passes the menu option string to OF - // you can add additional behavior from java modifying this method - // but keep the call to OFAndroid so OF is notified of menu events - if(OFAndroid.menuItemSelected(item.getItemId())){ - - return true; - } - return super.onOptionsItemSelected(item); - } - - - @Override - public boolean onPrepareOptionsMenu (Menu menu){ - // This method is called every time the menu is opened - // you can add or remove menu options from here - return super.onPrepareOptionsMenu(menu); - } - - public void onRestore() { - - if (!OFAndroidLifeCycle.appLibraryLoaded) return; - } - - private void hideSystemBars() { - WindowInsetsControllerCompat windowInsetsController = - ViewCompat.getWindowInsetsController(getWindow().getDecorView()); - if (windowInsetsController == null) { - return; - } - // Configure the behavior of the hidden system bars - windowInsetsController.setSystemBarsBehavior( - WindowInsetsControllerCompat.BEHAVIOR_SHOW_TRANSIENT_BARS_BY_SWIPE - ); - // Hide both the status bar and the navigation bar - windowInsetsController.hide(WindowInsetsCompat.Type.systemBars()); - } - - @Override - public void onWindowFocusChanged(boolean hasFocus) { - super.onWindowFocusChanged(hasFocus); - - if (hasFocus) { - if (Build.VERSION.SDK_INT < Build.VERSION_CODES.KITKAT) { - - setFullscreen(); - } else { - setFullscreen(); - } - } else { - - } - } - - private void handleException(Exception e, String details) { - Log.e(LOG_TAG, "Exception:", e); - - } - - public void setFullscreen() { - try { - if (Build.VERSION.SDK_INT < Build.VERSION_CODES.KITKAT) { - // No sticky immersive mode for devices pre-kitkat - getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN, - WindowManager.LayoutParams.FLAG_FULLSCREEN); - } else { - View decorView = getWindow().getDecorView(); -// int uiOptions = View.SYSTEM_UI_FLAG_FULLSCREEN; - int uiOptions = View.SYSTEM_UI_FLAG_LAYOUT_STABLE - | View.SYSTEM_UI_FLAG_LAYOUT_HIDE_NAVIGATION - | View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN - | View.SYSTEM_UI_FLAG_HIDE_NAVIGATION - | View.SYSTEM_UI_FLAG_FULLSCREEN - | View.SYSTEM_UI_FLAG_IMMERSIVE_STICKY; - decorView.setSystemUiVisibility(uiOptions); - } - - WindowCompat.setDecorFitsSystemWindows(getWindow(), false); - - } catch (Exception ex) { - handleException(ex, "setFullscreen exception"); - } - - try { - View decorView = getWindow().getDecorView(); - int[] locations = new int[2]; - decorView.getLocationInWindow(locations); - int[] locations2 = new int[2]; - decorView.getLocationOnScreen(locations2); - - } catch (Exception ex) { - handleException(ex, "setFullscreen exception"); - } - - WindowInsetsControllerCompat windowInsetsController = - ViewCompat.getWindowInsetsController(getWindow().getDecorView()); - if (windowInsetsController == null) { - return; - } - // Hide both the status bar and the navigation bar - windowInsetsController.hide(WindowInsetsCompat.Type.systemBars()); - windowInsetsController.hide(WindowInsetsCompat.Type.navigationBars()); - windowInsetsController.hide(WindowInsetsCompat.Type.statusBars()); - } - - -} - diff --git a/examples/android/androidEmptyExample/ofApp/src/main/res/drawable-hdpi/icon.png b/examples/android/androidEmptyExample/ofApp/src/main/res/drawable-hdpi/icon.png deleted file mode 100644 index 70b562fba01..00000000000 Binary files a/examples/android/androidEmptyExample/ofApp/src/main/res/drawable-hdpi/icon.png and /dev/null differ diff --git a/examples/android/androidEmptyExample/ofApp/src/main/res/drawable-mdpi/icon.png b/examples/android/androidEmptyExample/ofApp/src/main/res/drawable-mdpi/icon.png deleted file mode 100644 index 70b562fba01..00000000000 Binary files a/examples/android/androidEmptyExample/ofApp/src/main/res/drawable-mdpi/icon.png and /dev/null differ diff --git a/examples/android/androidEmptyExample/ofApp/src/main/res/drawable-xhdpi/icon.png b/examples/android/androidEmptyExample/ofApp/src/main/res/drawable-xhdpi/icon.png deleted file mode 100644 index 70b562fba01..00000000000 Binary files a/examples/android/androidEmptyExample/ofApp/src/main/res/drawable-xhdpi/icon.png and /dev/null differ diff --git a/examples/android/androidEmptyExample/ofApp/src/main/res/drawable/icon.png b/examples/android/androidEmptyExample/ofApp/src/main/res/drawable/icon.png deleted file mode 100644 index 70b562fba01..00000000000 Binary files a/examples/android/androidEmptyExample/ofApp/src/main/res/drawable/icon.png and /dev/null differ diff --git a/examples/android/androidEmptyExample/ofApp/src/main/res/layout/main_layout.xml b/examples/android/androidEmptyExample/ofApp/src/main/res/layout/main_layout.xml deleted file mode 100644 index d1da461f079..00000000000 --- a/examples/android/androidEmptyExample/ofApp/src/main/res/layout/main_layout.xml +++ /dev/null @@ -1,24 +0,0 @@ - - - - - - diff --git a/examples/android/androidEmptyExample/ofApp/src/main/res/menu/main_layout.xml b/examples/android/androidEmptyExample/ofApp/src/main/res/menu/main_layout.xml deleted file mode 100644 index 7ddcfbee35e..00000000000 --- a/examples/android/androidEmptyExample/ofApp/src/main/res/menu/main_layout.xml +++ /dev/null @@ -1,8 +0,0 @@ - - - - - \ No newline at end of file diff --git a/examples/android/androidEmptyExample/ofApp/src/main/res/mipmap-anydpi-v26/ic_launcher.xml b/examples/android/androidEmptyExample/ofApp/src/main/res/mipmap-anydpi-v26/ic_launcher.xml deleted file mode 100644 index 036d09bc5fd..00000000000 --- a/examples/android/androidEmptyExample/ofApp/src/main/res/mipmap-anydpi-v26/ic_launcher.xml +++ /dev/null @@ -1,5 +0,0 @@ - - - - - \ No newline at end of file diff --git a/examples/android/androidEmptyExample/ofApp/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml b/examples/android/androidEmptyExample/ofApp/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml deleted file mode 100644 index 036d09bc5fd..00000000000 --- a/examples/android/androidEmptyExample/ofApp/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml +++ /dev/null @@ -1,5 +0,0 @@ - - - - - \ No newline at end of file diff --git a/examples/android/androidEmptyExample/ofApp/src/main/res/mipmap-hdpi/ic_launcher.png b/examples/android/androidEmptyExample/ofApp/src/main/res/mipmap-hdpi/ic_launcher.png deleted file mode 100644 index 42b40d2fbec..00000000000 Binary files a/examples/android/androidEmptyExample/ofApp/src/main/res/mipmap-hdpi/ic_launcher.png and /dev/null differ diff --git a/examples/android/androidEmptyExample/ofApp/src/main/res/mipmap-hdpi/ic_launcher_foreground.png b/examples/android/androidEmptyExample/ofApp/src/main/res/mipmap-hdpi/ic_launcher_foreground.png deleted file mode 100644 index 648779fe415..00000000000 Binary files a/examples/android/androidEmptyExample/ofApp/src/main/res/mipmap-hdpi/ic_launcher_foreground.png and /dev/null differ diff --git a/examples/android/androidEmptyExample/ofApp/src/main/res/mipmap-hdpi/ic_launcher_round.png b/examples/android/androidEmptyExample/ofApp/src/main/res/mipmap-hdpi/ic_launcher_round.png deleted file mode 100644 index a39d8826804..00000000000 Binary files a/examples/android/androidEmptyExample/ofApp/src/main/res/mipmap-hdpi/ic_launcher_round.png and /dev/null differ diff --git a/examples/android/androidEmptyExample/ofApp/src/main/res/mipmap-mdpi/ic_launcher.png b/examples/android/androidEmptyExample/ofApp/src/main/res/mipmap-mdpi/ic_launcher.png deleted file mode 100644 index 13e6dfef882..00000000000 Binary files a/examples/android/androidEmptyExample/ofApp/src/main/res/mipmap-mdpi/ic_launcher.png and /dev/null differ diff --git a/examples/android/androidEmptyExample/ofApp/src/main/res/mipmap-mdpi/ic_launcher_foreground.png b/examples/android/androidEmptyExample/ofApp/src/main/res/mipmap-mdpi/ic_launcher_foreground.png deleted file mode 100644 index 67b93c29890..00000000000 Binary files a/examples/android/androidEmptyExample/ofApp/src/main/res/mipmap-mdpi/ic_launcher_foreground.png and /dev/null differ diff --git a/examples/android/androidEmptyExample/ofApp/src/main/res/mipmap-mdpi/ic_launcher_round.png b/examples/android/androidEmptyExample/ofApp/src/main/res/mipmap-mdpi/ic_launcher_round.png deleted file mode 100644 index 93401eaf855..00000000000 Binary files a/examples/android/androidEmptyExample/ofApp/src/main/res/mipmap-mdpi/ic_launcher_round.png and /dev/null differ diff --git a/examples/android/androidEmptyExample/ofApp/src/main/res/mipmap-xhdpi/ic_launcher.png b/examples/android/androidEmptyExample/ofApp/src/main/res/mipmap-xhdpi/ic_launcher.png deleted file mode 100644 index 018f9b90738..00000000000 Binary files a/examples/android/androidEmptyExample/ofApp/src/main/res/mipmap-xhdpi/ic_launcher.png and /dev/null differ diff --git a/examples/android/androidEmptyExample/ofApp/src/main/res/mipmap-xhdpi/ic_launcher_foreground.png b/examples/android/androidEmptyExample/ofApp/src/main/res/mipmap-xhdpi/ic_launcher_foreground.png deleted file mode 100644 index fc64ec1c838..00000000000 Binary files a/examples/android/androidEmptyExample/ofApp/src/main/res/mipmap-xhdpi/ic_launcher_foreground.png and /dev/null differ diff --git a/examples/android/androidEmptyExample/ofApp/src/main/res/mipmap-xhdpi/ic_launcher_round.png b/examples/android/androidEmptyExample/ofApp/src/main/res/mipmap-xhdpi/ic_launcher_round.png deleted file mode 100644 index 486c62f1f2a..00000000000 Binary files a/examples/android/androidEmptyExample/ofApp/src/main/res/mipmap-xhdpi/ic_launcher_round.png and /dev/null differ diff --git a/examples/android/androidEmptyExample/ofApp/src/main/res/mipmap-xxhdpi/ic_launcher.png b/examples/android/androidEmptyExample/ofApp/src/main/res/mipmap-xxhdpi/ic_launcher.png deleted file mode 100644 index cf6c612f8b1..00000000000 Binary files a/examples/android/androidEmptyExample/ofApp/src/main/res/mipmap-xxhdpi/ic_launcher.png and /dev/null differ diff --git a/examples/android/androidEmptyExample/ofApp/src/main/res/mipmap-xxhdpi/ic_launcher_foreground.png b/examples/android/androidEmptyExample/ofApp/src/main/res/mipmap-xxhdpi/ic_launcher_foreground.png deleted file mode 100644 index 07b98443e1b..00000000000 Binary files a/examples/android/androidEmptyExample/ofApp/src/main/res/mipmap-xxhdpi/ic_launcher_foreground.png and /dev/null differ diff --git a/examples/android/androidEmptyExample/ofApp/src/main/res/mipmap-xxhdpi/ic_launcher_round.png b/examples/android/androidEmptyExample/ofApp/src/main/res/mipmap-xxhdpi/ic_launcher_round.png deleted file mode 100644 index b4024c5aa00..00000000000 Binary files a/examples/android/androidEmptyExample/ofApp/src/main/res/mipmap-xxhdpi/ic_launcher_round.png and /dev/null differ diff --git a/examples/android/androidEmptyExample/ofApp/src/main/res/mipmap-xxxhdpi/ic_launcher.png b/examples/android/androidEmptyExample/ofApp/src/main/res/mipmap-xxxhdpi/ic_launcher.png deleted file mode 100644 index 60b1a9e8332..00000000000 Binary files a/examples/android/androidEmptyExample/ofApp/src/main/res/mipmap-xxxhdpi/ic_launcher.png and /dev/null differ diff --git a/examples/android/androidEmptyExample/ofApp/src/main/res/mipmap-xxxhdpi/ic_launcher_foreground.png b/examples/android/androidEmptyExample/ofApp/src/main/res/mipmap-xxxhdpi/ic_launcher_foreground.png deleted file mode 100644 index 45bd0178fee..00000000000 Binary files a/examples/android/androidEmptyExample/ofApp/src/main/res/mipmap-xxxhdpi/ic_launcher_foreground.png and /dev/null differ diff --git a/examples/android/androidEmptyExample/ofApp/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png b/examples/android/androidEmptyExample/ofApp/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png deleted file mode 100644 index 1b64c2ce02d..00000000000 Binary files a/examples/android/androidEmptyExample/ofApp/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png and /dev/null differ diff --git a/examples/android/androidEmptyExample/ofApp/src/main/res/values-v11/strings.xml b/examples/android/androidEmptyExample/ofApp/src/main/res/values-v11/strings.xml deleted file mode 100644 index 5822f1306d1..00000000000 --- a/examples/android/androidEmptyExample/ofApp/src/main/res/values-v11/strings.xml +++ /dev/null @@ -1,5 +0,0 @@ - - - ofEmptyEx - Menu - \ No newline at end of file diff --git a/examples/android/androidEmptyExample/ofApp/src/main/res/values-v11/styles.xml b/examples/android/androidEmptyExample/ofApp/src/main/res/values-v11/styles.xml deleted file mode 100644 index febc4d0286b..00000000000 --- a/examples/android/androidEmptyExample/ofApp/src/main/res/values-v11/styles.xml +++ /dev/null @@ -1,11 +0,0 @@ - - - - - - diff --git a/examples/android/androidEmptyExample/ofApp/src/main/res/values-v14/strings.xml b/examples/android/androidEmptyExample/ofApp/src/main/res/values-v14/strings.xml deleted file mode 100644 index 5822f1306d1..00000000000 --- a/examples/android/androidEmptyExample/ofApp/src/main/res/values-v14/strings.xml +++ /dev/null @@ -1,5 +0,0 @@ - - - ofEmptyEx - Menu - \ No newline at end of file diff --git a/examples/android/androidEmptyExample/ofApp/src/main/res/values-v14/styles.xml b/examples/android/androidEmptyExample/ofApp/src/main/res/values-v14/styles.xml deleted file mode 100644 index 928e0fd3d72..00000000000 --- a/examples/android/androidEmptyExample/ofApp/src/main/res/values-v14/styles.xml +++ /dev/null @@ -1,12 +0,0 @@ - - - - - - diff --git a/examples/android/androidEmptyExample/ofApp/src/main/res/values/ic_launcher_background.xml b/examples/android/androidEmptyExample/ofApp/src/main/res/values/ic_launcher_background.xml deleted file mode 100644 index c5d5899fdf0..00000000000 --- a/examples/android/androidEmptyExample/ofApp/src/main/res/values/ic_launcher_background.xml +++ /dev/null @@ -1,4 +0,0 @@ - - - #FFFFFF - \ No newline at end of file diff --git a/examples/android/androidEmptyExample/ofApp/src/main/res/values/strings.xml b/examples/android/androidEmptyExample/ofApp/src/main/res/values/strings.xml deleted file mode 100644 index 5822f1306d1..00000000000 --- a/examples/android/androidEmptyExample/ofApp/src/main/res/values/strings.xml +++ /dev/null @@ -1,5 +0,0 @@ - - - ofEmptyEx - Menu - \ No newline at end of file diff --git a/examples/android/androidEmptyExample/ofApp/src/main/res/values/styles.xml b/examples/android/androidEmptyExample/ofApp/src/main/res/values/styles.xml deleted file mode 100644 index 766a2c3f143..00000000000 --- a/examples/android/androidEmptyExample/ofApp/src/main/res/values/styles.xml +++ /dev/null @@ -1,20 +0,0 @@ - - - - - - - - - diff --git a/examples/android/androidEmptyExample/proguard.cfg b/examples/android/androidEmptyExample/proguard.cfg deleted file mode 100644 index faee26e7f2b..00000000000 --- a/examples/android/androidEmptyExample/proguard.cfg +++ /dev/null @@ -1,59 +0,0 @@ --optimizationpasses 5 --dontusemixedcaseclassnames --dontskipnonpubliclibraryclasses --dontpreverify --verbose --optimizations !code/simplification/arithmetic,!field/*,!class/merging/* - --keep public class * extends android.app.Activity --keep public class * extends android.app.Application --keep public class * extends android.app.Service --keep public class * extends android.content.BroadcastReceiver --keep public class * extends android.content.ContentProvider --keep public class * extends android.app.backup.BackupAgentHelper --keep public class * extends android.preference.Preference --keep public class com.android.vending.licensing.ILicensingService - --keep class com.google.android.gms.games.leaderboard.** { *; } --keep class com.google.android.gms.games.snapshot.** { *; } --keep class com.google.android.gms.games.achievement.** { *; } --keep class com.google.android.gms.games.event.** { *; } --keep class com.google.android.gms.games.stats.** { *; } --keep class com.google.android.gms.games.video.** { *; } --keep class com.google.android.gms.games.* { *; } - --keep class com.google.android.gms.signin.** { *; } --keep class com.google.android.gms.dynamic.** { *; } --keep class com.google.android.gms.dynamite.** { *; } --keep class com.google.android.gms.tasks.** { *; } --keep class com.google.android.gms.security.** { *; } --keep class com.google.android.gms.base.** { *; } --keep class com.google.android.gms.actions.** { *; } --keep class com.google.games.bridge.** { *; } --keep class com.google.android.gms.common.api.** { *; } --keep class com.google.android.gms.games.quest.** { *; } --keep class com.google.android.gms.nearby.** { *; } --keepclasseswithmembernames class * { - native ; -} - --keepclasseswithmembers class * { - public (android.content.Context, android.util.AttributeSet); -} - --keepclasseswithmembers class * { - public (android.content.Context, android.util.AttributeSet, int); -} - --keepclassmembers class * extends android.app.Activity { - public void *(android.view.View); -} - --keepclassmembers enum * { - public static **[] values(); - public static ** valueOf(java.lang.String); -} - --keep class * implements android.os.Parcelable { - public static final android.os.Parcelable$Creator *; -} diff --git a/examples/android/androidEmptyExample/settings.gradle b/examples/android/androidEmptyExample/settings.gradle deleted file mode 100644 index cb352f426c0..00000000000 --- a/examples/android/androidEmptyExample/settings.gradle +++ /dev/null @@ -1,11 +0,0 @@ -include ':ofApp' - -// Define the relative path to the openFrameworks project -def openFrameworksProjectPath = '../../../libs/openFrameworksCompiled/project' - -// Convert the relative path to an absolute path -def openFrameworksProjectAbsolutePath = new File(rootDir, openFrameworksProjectPath).absolutePath - -// Include the openFrameworks project -include ':openFrameworksProject' -project(':openFrameworksProject').projectDir = new File(openFrameworksProjectAbsolutePath) diff --git a/examples/android/androidEmptyExample/ofApp/src/main/cpp/main.cpp b/examples/android/androidEmptyExample/src/main.cpp similarity index 100% rename from examples/android/androidEmptyExample/ofApp/src/main/cpp/main.cpp rename to examples/android/androidEmptyExample/src/main.cpp diff --git a/examples/android/androidEmptyExample/ofApp/src/main/cpp/ofApp.cpp b/examples/android/androidEmptyExample/src/ofApp.cpp similarity index 100% rename from examples/android/androidEmptyExample/ofApp/src/main/cpp/ofApp.cpp rename to examples/android/androidEmptyExample/src/ofApp.cpp diff --git a/examples/android/androidEmptyExample/ofApp/src/main/cpp/ofApp.h b/examples/android/androidEmptyExample/src/ofApp.h similarity index 100% rename from examples/android/androidEmptyExample/ofApp/src/main/cpp/ofApp.h rename to examples/android/androidEmptyExample/src/ofApp.h diff --git a/examples/android/androidFontExample/src/main.cpp b/examples/android/androidFontExample/src/main.cpp index 596b934783a..f98043c5a8c 100644 --- a/examples/android/androidFontExample/src/main.cpp +++ b/examples/android/androidFontExample/src/main.cpp @@ -1,28 +1,49 @@ #include "ofMain.h" #include "ofApp.h" -int main(){ - ofSetupOpenGL(1024,768, OF_WINDOW); // <-------- setup the GL context - - // this kicks off the running of my app - // can be OF_WINDOW or OF_FULLSCREEN - // pass in width and height too: - ofRunApp( new ofApp() ); - return 0; -} +#ifdef TARGET_ANDROID +#include "ofWindowSettings.h" +#include "ofGLProgrammableRenderer.h" + +shared_ptr *ofapp; +std::shared_ptr baseWindow; + +//-------------------------------------------------------------- +int main(int argc, char **argv) { + baseWindow = std::make_shared(); + ofxAndroidWindowSettings settings; + settings.glesVersion = 2; + settings.setSize(1920, 1080); + settings.windowMode = OF_WINDOW; + settings.preserveContextOnPause = true; + baseWindow = ofCreateWindow(settings); + ofapp = new shared_ptr(new ofApp()); + ofRunApp(baseWindow, *ofapp); + return 0; +} -#ifdef TARGET_ANDROID void ofAndroidApplicationInit() { - //application scope init + //application scope init } - void ofAndroidActivityInit() { - //activity scope init - main(); + //activity scope init - call main + main(0, nullptr); } -#endif +// Callbacks from Android Layer +extern "C" JNIEXPORT void JNICALL +Java_cc_openframeworks_OFAndroid_init( JNIEnv* env, jclass clazz) +{ + ofAndroidApplicationInit(); +} +extern "C" JNIEXPORT void JNICALL +Java_cc_openframeworks_OFAndroid_onCreate( JNIEnv* env, jclass clazz) +{ + ofAndroidActivityInit(); +} + +#endif diff --git a/examples/android/androidGuiExample/src/main.cpp b/examples/android/androidGuiExample/src/main.cpp index ef340ca94b8..f98043c5a8c 100644 --- a/examples/android/androidGuiExample/src/main.cpp +++ b/examples/android/androidGuiExample/src/main.cpp @@ -1,26 +1,49 @@ #include "ofMain.h" #include "ofApp.h" -int main(){ - ofSetupOpenGL(1024,768, OF_WINDOW); // <-------- setup the GL context - - // this kicks off the running of my app - // can be OF_WINDOW or OF_FULLSCREEN - // pass in width and height too: - ofRunApp( new ofApp() ); - return 0; -} +#ifdef TARGET_ANDROID +#include "ofWindowSettings.h" +#include "ofGLProgrammableRenderer.h" + +shared_ptr *ofapp; +std::shared_ptr baseWindow; + +//-------------------------------------------------------------- +int main(int argc, char **argv) { + baseWindow = std::make_shared(); + ofxAndroidWindowSettings settings; + settings.glesVersion = 2; + settings.setSize(1920, 1080); + settings.windowMode = OF_WINDOW; + settings.preserveContextOnPause = true; + baseWindow = ofCreateWindow(settings); + ofapp = new shared_ptr(new ofApp()); + ofRunApp(baseWindow, *ofapp); + return 0; +} -#ifdef TARGET_ANDROID void ofAndroidApplicationInit() { - //application scope init + //application scope init } - void ofAndroidActivityInit() { - //activity scope init - main(); + //activity scope init - call main + main(0, nullptr); } + +// Callbacks from Android Layer +extern "C" JNIEXPORT void JNICALL +Java_cc_openframeworks_OFAndroid_init( JNIEnv* env, jclass clazz) +{ + ofAndroidApplicationInit(); +} + +extern "C" JNIEXPORT void JNICALL +Java_cc_openframeworks_OFAndroid_onCreate( JNIEnv* env, jclass clazz) +{ + ofAndroidActivityInit(); +} + #endif diff --git a/examples/android/androidImageExample/src/main.cpp b/examples/android/androidImageExample/src/main.cpp index ef340ca94b8..f98043c5a8c 100644 --- a/examples/android/androidImageExample/src/main.cpp +++ b/examples/android/androidImageExample/src/main.cpp @@ -1,26 +1,49 @@ #include "ofMain.h" #include "ofApp.h" -int main(){ - ofSetupOpenGL(1024,768, OF_WINDOW); // <-------- setup the GL context - - // this kicks off the running of my app - // can be OF_WINDOW or OF_FULLSCREEN - // pass in width and height too: - ofRunApp( new ofApp() ); - return 0; -} +#ifdef TARGET_ANDROID +#include "ofWindowSettings.h" +#include "ofGLProgrammableRenderer.h" + +shared_ptr *ofapp; +std::shared_ptr baseWindow; + +//-------------------------------------------------------------- +int main(int argc, char **argv) { + baseWindow = std::make_shared(); + ofxAndroidWindowSettings settings; + settings.glesVersion = 2; + settings.setSize(1920, 1080); + settings.windowMode = OF_WINDOW; + settings.preserveContextOnPause = true; + baseWindow = ofCreateWindow(settings); + ofapp = new shared_ptr(new ofApp()); + ofRunApp(baseWindow, *ofapp); + return 0; +} -#ifdef TARGET_ANDROID void ofAndroidApplicationInit() { - //application scope init + //application scope init } - void ofAndroidActivityInit() { - //activity scope init - main(); + //activity scope init - call main + main(0, nullptr); } + +// Callbacks from Android Layer +extern "C" JNIEXPORT void JNICALL +Java_cc_openframeworks_OFAndroid_init( JNIEnv* env, jclass clazz) +{ + ofAndroidApplicationInit(); +} + +extern "C" JNIEXPORT void JNICALL +Java_cc_openframeworks_OFAndroid_onCreate( JNIEnv* env, jclass clazz) +{ + ofAndroidActivityInit(); +} + #endif diff --git a/examples/android/androidImageExample/src/ofApp.cpp b/examples/android/androidImageExample/src/ofApp.cpp index 4fadb67f7c0..bf44d44f0a9 100644 --- a/examples/android/androidImageExample/src/ofApp.cpp +++ b/examples/android/androidImageExample/src/ofApp.cpp @@ -2,9 +2,6 @@ //-------------------------------------------------------------- void ofApp::setup(){ - image.load("images/bikers.jpg"); - ofBackground(255,255,255); - ofSetColor(255,255,255); } //-------------------------------------------------------------- @@ -13,72 +10,59 @@ void ofApp::update(){ //-------------------------------------------------------------- void ofApp::draw(){ - image.draw(20,20); } //-------------------------------------------------------------- -void ofApp::keyPressed (int key){ - +void ofApp::keyPressed(int key){ + } //-------------------------------------------------------------- void ofApp::keyReleased(int key){ - } //-------------------------------------------------------------- void ofApp::windowResized(int w, int h){ - } //-------------------------------------------------------------- void ofApp::touchDown(int x, int y, int id){ - } //-------------------------------------------------------------- void ofApp::touchMoved(int x, int y, int id){ - } //-------------------------------------------------------------- void ofApp::touchUp(int x, int y, int id){ - } //-------------------------------------------------------------- void ofApp::touchDoubleTap(int x, int y, int id){ - } //-------------------------------------------------------------- void ofApp::touchCancelled(int x, int y, int id){ - } //-------------------------------------------------------------- void ofApp::swipe(ofxAndroidSwipeDir swipeDir, int id){ - } //-------------------------------------------------------------- void ofApp::pause(){ - } //-------------------------------------------------------------- void ofApp::stop(){ - } //-------------------------------------------------------------- void ofApp::resume(){ - } //-------------------------------------------------------------- void ofApp::reloadTextures(){ - } //-------------------------------------------------------------- @@ -88,10 +72,30 @@ bool ofApp::backPressed(){ //-------------------------------------------------------------- void ofApp::okPressed(){ - } //-------------------------------------------------------------- void ofApp::cancelPressed(){ +} +//-------------------------------------------------------------- +void ofApp::deviceRefreshRateChanged(int refreshRate) { } + +//-------------------------------------------------------------- +void ofApp::deviceHighestRefreshRateChanged(int refreshRate) { +} + +//-------------------------------------------------------------- +void ofApp::deviceRefreshRateChangedEvent(int &refreshRate) { +} + +//-------------------------------------------------------------- +void ofApp::deviceHighestRefreshRateChangedEvent(int &refreshRate) { +} + +//-------------------------------------------------------------- +void ofApp::exit(){ + +} + diff --git a/examples/android/androidImageExample/src/ofApp.h b/examples/android/androidImageExample/src/ofApp.h index 40fa3cf93e2..fab21d73585 100644 --- a/examples/android/androidImageExample/src/ofApp.h +++ b/examples/android/androidImageExample/src/ofApp.h @@ -8,9 +8,10 @@ class ofApp : public ofxAndroidApp{ public: void setup(); + void exit(); void update(); void draw(); - + void keyPressed(int key); void keyReleased(int key); void windowResized(int w, int h); @@ -31,5 +32,8 @@ class ofApp : public ofxAndroidApp{ void okPressed(); void cancelPressed(); - ofImage image; + void deviceRefreshRateChanged(int refreshRate); + void deviceHighestRefreshRateChanged(int refreshRate); + void deviceRefreshRateChangedEvent(int &refreshRate); + void deviceHighestRefreshRateChangedEvent(int & refreshRate); }; diff --git a/examples/android/androidJavaOnlyActivityExample/srcJava/cc/openframeworks/androidNativeActivityExample/FirstActivity.java b/examples/android/androidJavaOnlyActivityExample/ofApp/src/java/cc/openframeworks/androidNativeActivityExample/FirstActivity.java similarity index 100% rename from examples/android/androidJavaOnlyActivityExample/srcJava/cc/openframeworks/androidNativeActivityExample/FirstActivity.java rename to examples/android/androidJavaOnlyActivityExample/ofApp/src/java/cc/openframeworks/androidNativeActivityExample/FirstActivity.java diff --git a/examples/android/androidOpenCVExample/src/main.cpp b/examples/android/androidOpenCVExample/src/main.cpp index ef340ca94b8..f98043c5a8c 100644 --- a/examples/android/androidOpenCVExample/src/main.cpp +++ b/examples/android/androidOpenCVExample/src/main.cpp @@ -1,26 +1,49 @@ #include "ofMain.h" #include "ofApp.h" -int main(){ - ofSetupOpenGL(1024,768, OF_WINDOW); // <-------- setup the GL context - - // this kicks off the running of my app - // can be OF_WINDOW or OF_FULLSCREEN - // pass in width and height too: - ofRunApp( new ofApp() ); - return 0; -} +#ifdef TARGET_ANDROID +#include "ofWindowSettings.h" +#include "ofGLProgrammableRenderer.h" + +shared_ptr *ofapp; +std::shared_ptr baseWindow; + +//-------------------------------------------------------------- +int main(int argc, char **argv) { + baseWindow = std::make_shared(); + ofxAndroidWindowSettings settings; + settings.glesVersion = 2; + settings.setSize(1920, 1080); + settings.windowMode = OF_WINDOW; + settings.preserveContextOnPause = true; + baseWindow = ofCreateWindow(settings); + ofapp = new shared_ptr(new ofApp()); + ofRunApp(baseWindow, *ofapp); + return 0; +} -#ifdef TARGET_ANDROID void ofAndroidApplicationInit() { - //application scope init + //application scope init } - void ofAndroidActivityInit() { - //activity scope init - main(); + //activity scope init - call main + main(0, nullptr); } + +// Callbacks from Android Layer +extern "C" JNIEXPORT void JNICALL +Java_cc_openframeworks_OFAndroid_init( JNIEnv* env, jclass clazz) +{ + ofAndroidApplicationInit(); +} + +extern "C" JNIEXPORT void JNICALL +Java_cc_openframeworks_OFAndroid_onCreate( JNIEnv* env, jclass clazz) +{ + ofAndroidActivityInit(); +} + #endif diff --git a/examples/android/androidOpenCVFaceExample/src/main.cpp b/examples/android/androidOpenCVFaceExample/src/main.cpp index ef340ca94b8..f98043c5a8c 100644 --- a/examples/android/androidOpenCVFaceExample/src/main.cpp +++ b/examples/android/androidOpenCVFaceExample/src/main.cpp @@ -1,26 +1,49 @@ #include "ofMain.h" #include "ofApp.h" -int main(){ - ofSetupOpenGL(1024,768, OF_WINDOW); // <-------- setup the GL context - - // this kicks off the running of my app - // can be OF_WINDOW or OF_FULLSCREEN - // pass in width and height too: - ofRunApp( new ofApp() ); - return 0; -} +#ifdef TARGET_ANDROID +#include "ofWindowSettings.h" +#include "ofGLProgrammableRenderer.h" + +shared_ptr *ofapp; +std::shared_ptr baseWindow; + +//-------------------------------------------------------------- +int main(int argc, char **argv) { + baseWindow = std::make_shared(); + ofxAndroidWindowSettings settings; + settings.glesVersion = 2; + settings.setSize(1920, 1080); + settings.windowMode = OF_WINDOW; + settings.preserveContextOnPause = true; + baseWindow = ofCreateWindow(settings); + ofapp = new shared_ptr(new ofApp()); + ofRunApp(baseWindow, *ofapp); + return 0; +} -#ifdef TARGET_ANDROID void ofAndroidApplicationInit() { - //application scope init + //application scope init } - void ofAndroidActivityInit() { - //activity scope init - main(); + //activity scope init - call main + main(0, nullptr); } + +// Callbacks from Android Layer +extern "C" JNIEXPORT void JNICALL +Java_cc_openframeworks_OFAndroid_init( JNIEnv* env, jclass clazz) +{ + ofAndroidApplicationInit(); +} + +extern "C" JNIEXPORT void JNICALL +Java_cc_openframeworks_OFAndroid_onCreate( JNIEnv* env, jclass clazz) +{ + ofAndroidActivityInit(); +} + #endif diff --git a/examples/android/androidPolygonExample/src/main.cpp b/examples/android/androidPolygonExample/src/main.cpp index ef340ca94b8..f98043c5a8c 100644 --- a/examples/android/androidPolygonExample/src/main.cpp +++ b/examples/android/androidPolygonExample/src/main.cpp @@ -1,26 +1,49 @@ #include "ofMain.h" #include "ofApp.h" -int main(){ - ofSetupOpenGL(1024,768, OF_WINDOW); // <-------- setup the GL context - - // this kicks off the running of my app - // can be OF_WINDOW or OF_FULLSCREEN - // pass in width and height too: - ofRunApp( new ofApp() ); - return 0; -} +#ifdef TARGET_ANDROID +#include "ofWindowSettings.h" +#include "ofGLProgrammableRenderer.h" + +shared_ptr *ofapp; +std::shared_ptr baseWindow; + +//-------------------------------------------------------------- +int main(int argc, char **argv) { + baseWindow = std::make_shared(); + ofxAndroidWindowSettings settings; + settings.glesVersion = 2; + settings.setSize(1920, 1080); + settings.windowMode = OF_WINDOW; + settings.preserveContextOnPause = true; + baseWindow = ofCreateWindow(settings); + ofapp = new shared_ptr(new ofApp()); + ofRunApp(baseWindow, *ofapp); + return 0; +} -#ifdef TARGET_ANDROID void ofAndroidApplicationInit() { - //application scope init + //application scope init } - void ofAndroidActivityInit() { - //activity scope init - main(); + //activity scope init - call main + main(0, nullptr); } + +// Callbacks from Android Layer +extern "C" JNIEXPORT void JNICALL +Java_cc_openframeworks_OFAndroid_init( JNIEnv* env, jclass clazz) +{ + ofAndroidApplicationInit(); +} + +extern "C" JNIEXPORT void JNICALL +Java_cc_openframeworks_OFAndroid_onCreate( JNIEnv* env, jclass clazz) +{ + ofAndroidActivityInit(); +} + #endif diff --git a/examples/android/androidPolygonExample/src/ofApp.cpp b/examples/android/androidPolygonExample/src/ofApp.cpp index c2880aba625..535d21279a6 100644 --- a/examples/android/androidPolygonExample/src/ofApp.cpp +++ b/examples/android/androidPolygonExample/src/ofApp.cpp @@ -3,15 +3,15 @@ //-------------------------------------------------------------- void ofApp::setup(){ //ofSetOrientation(OF_ORIENTATION_90_RIGHT); - + //this is to scale down the example for the iphone screen appIphoneScale = 0.5; - ofBackground(255,255,255); + ofBackground(255,255,255); ofSetFrameRate(60); - + nCurveVertices = 7; - + curveVertices[0].x = 326; curveVertices[0].y = 209; curveVertices[1].x = 306; @@ -26,7 +26,7 @@ void ofApp::setup(){ curveVertices[5].y = 309; curveVertices[6].x = 345; curveVertices[6].y = 279; - + for (int i = 0; i < nCurveVertices; i++){ curveVertices[i].bOver = false; curveVertices[i].bBeingDragged = false; @@ -51,14 +51,14 @@ void ofApp::draw(){ ofSetHexColor(0xe0be21); //------(a)-------------------------------------- - // + // // draw a star // // use poly winding odd, the default rule // // info about the winding rules is here: // http://glprogramming.com/red/images/Image128.gif - // + // ofSetPolyMode(OF_POLY_WINDING_ODD); // this is the normal mode ofBeginShape(); ofVertex(200,135); @@ -67,17 +67,17 @@ void ofApp::draw(){ ofVertex(105,200); ofVertex(50,25); ofEndShape(); - - + + //------(b)-------------------------------------- - // + // // draw a star // // use poly winding nonzero // // info about the winding rules is here: // http://glprogramming.com/red/images/Image128.gif - // + // ofSetHexColor(0xb5de10); ofSetPolyMode(OF_POLY_WINDING_NONZERO); ofBeginShape(); @@ -88,11 +88,11 @@ void ofApp::draw(){ ofVertex(250,25); ofEndShape(); //------------------------------------- - - - + + + //------(c)-------------------------------------- - // + // // draw a star dynamically // // use the mouse position as a pct @@ -108,7 +108,7 @@ void ofApp::draw(){ float origx = 525; float origy = 100; float angle = 0; - + ofSetHexColor(0xa16bca); ofBeginShape(); for (int i = 0; i < nStarPts; i++){ @@ -127,14 +127,14 @@ void ofApp::draw(){ } ofEndShape(); //------------------------------------- - + //------(d)-------------------------------------- - // + // // poylgon of random points // // lots of self intersection, 500 pts is a good stress test - // - // + // + // ofSetHexColor(0x0cb0b6); ofSetPolyMode(OF_POLY_WINDING_ODD); ofBeginShape(); @@ -143,10 +143,10 @@ void ofApp::draw(){ } ofEndShape(); //------------------------------------- - - + + //------(e)-------------------------------------- - // + // // use sin cos and time to make some spirally shape // ofPushMatrix(); @@ -155,42 +155,42 @@ void ofApp::draw(){ ofFill(); ofSetPolyMode(OF_POLY_WINDING_ODD); ofBeginShape(); - float angleStep = glm::two_pi()/(100.0f + std::sin(ofGetElapsedTimef()/5.0f) * 60); + float angleStep = glm::two_pi()/(100.0f + std::sin(ofGetElapsedTimef()/5.0f) * 60); float radiusAdder = 0.5f; float radius = 0; for (int i = 0; i < 200; i++){ float anglef = (i) * angleStep; float x = radius * std::cos(anglef); - float y = radius * std::sin(anglef); + float y = radius * std::sin(anglef); ofVertex(x,y); - radius += radiusAdder; + radius += radiusAdder; } ofEndShape(OF_CLOSE); ofPopMatrix(); //------------------------------------- - + //------(f)-------------------------------------- - // + // // ofCurveVertex - // - // because it uses catmul rom splines, we need to repeat the first and last + // + // because it uses catmul rom splines, we need to repeat the first and last // items so the curve actually goes through those points // ofSetHexColor(0x2bdbe6); ofBeginShape(); - + for (int i = 0; i < nCurveVertices; i++){ - - + + // sorry about all the if/states here, but to do catmull rom curves - // we need to duplicate the start and end points so the curve acutally + // we need to duplicate the start and end points so the curve acutally // goes through them. - + // for i == 0, we just call the vertex twice // for i == nCurveVertices-1 (last point) we call vertex 0 twice // otherwise just normal ofCurveVertex call - + if (i == 0){ ofCurveVertex(curveVertices[0].x, curveVertices[0].y); // we need to duplicate 0 for the curve to start at point 0 ofCurveVertex(curveVertices[0].x, curveVertices[0].y); // we need to duplicate 0 for the curve to start at point 0 @@ -202,10 +202,10 @@ void ofApp::draw(){ ofCurveVertex(curveVertices[i].x, curveVertices[i].y); } } - + ofEndShape(); - - + + // show a faint the non-curve version of the same polygon: ofEnableAlphaBlending(); ofNoFill(); @@ -215,8 +215,8 @@ void ofApp::draw(){ ofVertex(curveVertices[i].x, curveVertices[i].y); } ofEndShape(true); - - + + ofSetColor(0,0,0,80); for (int i = 0; i < nCurveVertices; i++){ if (curveVertices[i].bOver == true) ofFill(); @@ -225,17 +225,17 @@ void ofApp::draw(){ } ofDisableAlphaBlending(); //------------------------------------- - - + + //------(g)-------------------------------------- - // + // // ofBezierVertex - // + // // with ofBezierVertex we can draw a curve from the current vertex // through the the next three vertices we pass in. // (two control points and the final bezier point) - // - + // + float x0 = 500; float y0 = 300; float x1 = 550+50*cos(ofGetElapsedTimef()*1.0f); @@ -244,17 +244,17 @@ void ofApp::draw(){ float y2 = 300+100*sin(ofGetElapsedTimef()); float x3 = 650; float y3 = 300; - - - + + + ofFill(); ofSetHexColor(0xFF9933); ofBeginShape(); ofVertex(x0,y0); ofBezierVertex(x1,y1,x2,y2,x3,y3); ofEndShape(); - - + + ofEnableAlphaBlending(); ofFill(); ofSetColor(0,0,0,40); @@ -263,99 +263,99 @@ void ofApp::draw(){ ofCircle(x2,y2,4); ofCircle(x3,y3,4); ofDisableAlphaBlending(); - - - + + + //------(h)-------------------------------------- - // + // // holes / ofNextContour - // + // // with ofNextContour we can create multi-contour shapes - // this allows us to draw holes, for example... + // this allows us to draw holes, for example... // ofFill(); ofSetHexColor(0xd3ffd3); ofDrawRectangle(80,480,140,70); ofSetHexColor(0xff00ff); - + ofBeginShape(); - + ofVertex(100,500); ofVertex(180,550); ofVertex(100,600); - + ofNextContour(true); - + ofVertex(120,520); ofVertex(160,550); ofVertex(120,580); - + ofEndShape(true); //------------------------------------- - - + + //------(i)-------------------------------------- - // + // // CSG / ofNextContour - // - // with different winding rules, you can even use ofNextContour to - // perform constructive solid geometry - // + // + // with different winding rules, you can even use ofNextContour to + // perform constructive solid geometry + // // be careful, the clockwiseness or counter clockwisenss of your multiple // contours matters with these winding rules. // // for csg ideas, see : http://glprogramming.com/red/chapter11.html - // + // // info about the winding rules is here: // http://glprogramming.com/red/images/Image128.gif - // + // ofNoFill(); - - + + ofPushMatrix(); - + ofSetPolyMode(OF_POLY_WINDING_ODD); - + ofBeginShape(); - + ofVertex(300,500); ofVertex(380,550); ofVertex(300,600); - + ofNextContour(true); - + for (int i = 0; i < 20; i++){ float anglef = ((float)i / 19.0f) * glm::two_pi(); float x = 340 + 30 * std::cos(anglef); - float y = 550 + 30 * std::sin(anglef); + float y = 550 + 30 * std::sin(anglef); ofVertex(x,y); - radius += radiusAdder; + radius += radiusAdder; } - + ofEndShape(true); - + ofTranslate(100,0,0); - - ofSetPolyMode(OF_POLY_WINDING_NONZERO); + + ofSetPolyMode(OF_POLY_WINDING_NONZERO); ofBeginShape(); - + ofVertex(300,500); ofVertex(380,550); ofVertex(300,600); - + ofNextContour(true); - + for (int i = 0; i < 20; i++){ float anglef = ((float)i / 19.0f) * glm::two_pi(); float x = 340 + 30 * std::cos(anglef); - float y = 550 + 30 * std::sin(anglef); + float y = 550 + 30 * std::sin(anglef); ofVertex(x,y); - radius += radiusAdder; + radius += radiusAdder; } - + ofEndShape(true); - + ofTranslate(100,0,0); ofSetPolyMode(OF_POLY_WINDING_ABS_GEQ_TWO); ofBeginShape(); @@ -363,50 +363,50 @@ void ofApp::draw(){ ofVertex(380,550); ofVertex(300,600); ofNextContour(true); - + for (int i = 0; i < 20; i++){ float anglef = ((float)i / 19.0f) * glm::two_pi(); float x = 340 + 30 * cos(anglef); - float y = 550 + 30 * sin(anglef); + float y = 550 + 30 * sin(anglef); ofVertex(x,y); - radius += radiusAdder; + radius += radiusAdder; } - - + + ofEndShape(true); - + ofPopMatrix(); //------------------------------------- - - + + ofSetHexColor(0x000000); ofDrawBitmapString("(a) star\nwinding rule odd", 20,210); - + ofSetHexColor(0x000000); ofDrawBitmapString("(b) star\nwinding rule nonzero", 220,210); - + ofSetHexColor(0x000000); ofDrawBitmapString("(c) dynamically\ncreated shape", 420,210); - + ofSetHexColor(0x000000); ofDrawBitmapString("(d) random points\npoly", 670,210); - + ofSetHexColor(0x000000); ofDrawBitmapString("(e) fun with sin/cos", 20,410); - + ofSetHexColor(0x000000); ofDrawBitmapString("(f) ofCurveVertex\nuses catmull rom\nto make curved shapes", 220,410); - + ofSetHexColor(0x000000); ofDrawBitmapString("(g) ofBezierVertex\nuses bezier to draw curves", 460,410); - - + + ofSetHexColor(0x000000); ofDrawBitmapString("(h) ofNextContour\nallows for holes", 20,610); - + ofSetHexColor(0x000000); ofDrawBitmapString("(i) ofNextContour\ncan even be used for CSG operations\nsuch as union and intersection", 260,620); - + } //-------------------------------------------------------------- @@ -510,3 +510,25 @@ void ofApp::okPressed(){ void ofApp::cancelPressed(){ } + +//-------------------------------------------------------------- +void ofApp::deviceRefreshRateChanged(int refreshRate) { +} + +//-------------------------------------------------------------- +void ofApp::deviceHighestRefreshRateChanged(int refreshRate) { +} + +//-------------------------------------------------------------- +void ofApp::deviceRefreshRateChangedEvent(int &refreshRate) { +} + +//-------------------------------------------------------------- +void ofApp::deviceHighestRefreshRateChangedEvent(int &refreshRate) { +} + +//-------------------------------------------------------------- +void ofApp::exit(){ + +} + diff --git a/examples/android/androidPolygonExample/src/ofApp.h b/examples/android/androidPolygonExample/src/ofApp.h index 1476d7dcc5d..bb1b6465388 100644 --- a/examples/android/androidPolygonExample/src/ofApp.h +++ b/examples/android/androidPolygonExample/src/ofApp.h @@ -10,17 +10,17 @@ typedef struct { bool bBeingDragged; bool bOver; float radius; - + } draggableVertex; class ofApp : public ofxAndroidApp { - + public: void setup(); void update(); void draw(); - + void exit(); void keyPressed(int key); void keyReleased(int key); void windowResized(int w, int h); @@ -41,7 +41,13 @@ class ofApp : public ofxAndroidApp { void okPressed(); void cancelPressed(); - int nCurveVertices; + void deviceRefreshRateChanged(int refreshRate); + void deviceHighestRefreshRateChanged(int refreshRate); + void deviceRefreshRateChangedEvent(int &refreshRate); + void deviceHighestRefreshRateChangedEvent(int & refreshRate); + + + int nCurveVertices; draggableVertex curveVertices[7]; draggableVertex bezierVertices[4]; diff --git a/examples/android/androidShaderExample/src/main.cpp b/examples/android/androidShaderExample/src/main.cpp index 949d8e9b991..f98043c5a8c 100644 --- a/examples/android/androidShaderExample/src/main.cpp +++ b/examples/android/androidShaderExample/src/main.cpp @@ -1,28 +1,49 @@ #include "ofMain.h" #include "ofApp.h" + +#ifdef TARGET_ANDROID + +#include "ofWindowSettings.h" #include "ofGLProgrammableRenderer.h" -int main(){ - ofGLESWindowSettings settings; - settings.setGLESVersion(2); - ofCreateWindow(settings); // <-------- setup the GL context +shared_ptr *ofapp; +std::shared_ptr baseWindow; - // this kicks off the running of my app - // can be OF_WINDOW or OF_FULLSCREEN - // pass in width and height too: - return ofRunApp( new ofApp() ); +//-------------------------------------------------------------- +int main(int argc, char **argv) { + baseWindow = std::make_shared(); + ofxAndroidWindowSettings settings; + settings.glesVersion = 2; + settings.setSize(1920, 1080); + settings.windowMode = OF_WINDOW; + settings.preserveContextOnPause = true; + baseWindow = ofCreateWindow(settings); + ofapp = new shared_ptr(new ofApp()); + ofRunApp(baseWindow, *ofapp); + return 0; } - -#ifdef TARGET_ANDROID void ofAndroidApplicationInit() { - //application scope init + //application scope init } - void ofAndroidActivityInit() { - //activity scope init - main(); + //activity scope init - call main + main(0, nullptr); } + +// Callbacks from Android Layer +extern "C" JNIEXPORT void JNICALL +Java_cc_openframeworks_OFAndroid_init( JNIEnv* env, jclass clazz) +{ + ofAndroidApplicationInit(); +} + +extern "C" JNIEXPORT void JNICALL +Java_cc_openframeworks_OFAndroid_onCreate( JNIEnv* env, jclass clazz) +{ + ofAndroidActivityInit(); +} + #endif diff --git a/examples/android/androidSoundPlayerExample/src/main.cpp b/examples/android/androidSoundPlayerExample/src/main.cpp index ef340ca94b8..f98043c5a8c 100644 --- a/examples/android/androidSoundPlayerExample/src/main.cpp +++ b/examples/android/androidSoundPlayerExample/src/main.cpp @@ -1,26 +1,49 @@ #include "ofMain.h" #include "ofApp.h" -int main(){ - ofSetupOpenGL(1024,768, OF_WINDOW); // <-------- setup the GL context - - // this kicks off the running of my app - // can be OF_WINDOW or OF_FULLSCREEN - // pass in width and height too: - ofRunApp( new ofApp() ); - return 0; -} +#ifdef TARGET_ANDROID +#include "ofWindowSettings.h" +#include "ofGLProgrammableRenderer.h" + +shared_ptr *ofapp; +std::shared_ptr baseWindow; + +//-------------------------------------------------------------- +int main(int argc, char **argv) { + baseWindow = std::make_shared(); + ofxAndroidWindowSettings settings; + settings.glesVersion = 2; + settings.setSize(1920, 1080); + settings.windowMode = OF_WINDOW; + settings.preserveContextOnPause = true; + baseWindow = ofCreateWindow(settings); + ofapp = new shared_ptr(new ofApp()); + ofRunApp(baseWindow, *ofapp); + return 0; +} -#ifdef TARGET_ANDROID void ofAndroidApplicationInit() { - //application scope init + //application scope init } - void ofAndroidActivityInit() { - //activity scope init - main(); + //activity scope init - call main + main(0, nullptr); } + +// Callbacks from Android Layer +extern "C" JNIEXPORT void JNICALL +Java_cc_openframeworks_OFAndroid_init( JNIEnv* env, jclass clazz) +{ + ofAndroidApplicationInit(); +} + +extern "C" JNIEXPORT void JNICALL +Java_cc_openframeworks_OFAndroid_onCreate( JNIEnv* env, jclass clazz) +{ + ofAndroidActivityInit(); +} + #endif diff --git a/examples/android/androidSwipeExample/src/main.cpp b/examples/android/androidSwipeExample/src/main.cpp index ef340ca94b8..f98043c5a8c 100644 --- a/examples/android/androidSwipeExample/src/main.cpp +++ b/examples/android/androidSwipeExample/src/main.cpp @@ -1,26 +1,49 @@ #include "ofMain.h" #include "ofApp.h" -int main(){ - ofSetupOpenGL(1024,768, OF_WINDOW); // <-------- setup the GL context - - // this kicks off the running of my app - // can be OF_WINDOW or OF_FULLSCREEN - // pass in width and height too: - ofRunApp( new ofApp() ); - return 0; -} +#ifdef TARGET_ANDROID +#include "ofWindowSettings.h" +#include "ofGLProgrammableRenderer.h" + +shared_ptr *ofapp; +std::shared_ptr baseWindow; + +//-------------------------------------------------------------- +int main(int argc, char **argv) { + baseWindow = std::make_shared(); + ofxAndroidWindowSettings settings; + settings.glesVersion = 2; + settings.setSize(1920, 1080); + settings.windowMode = OF_WINDOW; + settings.preserveContextOnPause = true; + baseWindow = ofCreateWindow(settings); + ofapp = new shared_ptr(new ofApp()); + ofRunApp(baseWindow, *ofapp); + return 0; +} -#ifdef TARGET_ANDROID void ofAndroidApplicationInit() { - //application scope init + //application scope init } - void ofAndroidActivityInit() { - //activity scope init - main(); + //activity scope init - call main + main(0, nullptr); } + +// Callbacks from Android Layer +extern "C" JNIEXPORT void JNICALL +Java_cc_openframeworks_OFAndroid_init( JNIEnv* env, jclass clazz) +{ + ofAndroidApplicationInit(); +} + +extern "C" JNIEXPORT void JNICALL +Java_cc_openframeworks_OFAndroid_onCreate( JNIEnv* env, jclass clazz) +{ + ofAndroidActivityInit(); +} + #endif diff --git a/examples/android/androidTouchExample/src/main.cpp b/examples/android/androidTouchExample/src/main.cpp index ef340ca94b8..f98043c5a8c 100644 --- a/examples/android/androidTouchExample/src/main.cpp +++ b/examples/android/androidTouchExample/src/main.cpp @@ -1,26 +1,49 @@ #include "ofMain.h" #include "ofApp.h" -int main(){ - ofSetupOpenGL(1024,768, OF_WINDOW); // <-------- setup the GL context - - // this kicks off the running of my app - // can be OF_WINDOW or OF_FULLSCREEN - // pass in width and height too: - ofRunApp( new ofApp() ); - return 0; -} +#ifdef TARGET_ANDROID +#include "ofWindowSettings.h" +#include "ofGLProgrammableRenderer.h" + +shared_ptr *ofapp; +std::shared_ptr baseWindow; + +//-------------------------------------------------------------- +int main(int argc, char **argv) { + baseWindow = std::make_shared(); + ofxAndroidWindowSettings settings; + settings.glesVersion = 2; + settings.setSize(1920, 1080); + settings.windowMode = OF_WINDOW; + settings.preserveContextOnPause = true; + baseWindow = ofCreateWindow(settings); + ofapp = new shared_ptr(new ofApp()); + ofRunApp(baseWindow, *ofapp); + return 0; +} -#ifdef TARGET_ANDROID void ofAndroidApplicationInit() { - //application scope init + //application scope init } - void ofAndroidActivityInit() { - //activity scope init - main(); + //activity scope init - call main + main(0, nullptr); } + +// Callbacks from Android Layer +extern "C" JNIEXPORT void JNICALL +Java_cc_openframeworks_OFAndroid_init( JNIEnv* env, jclass clazz) +{ + ofAndroidApplicationInit(); +} + +extern "C" JNIEXPORT void JNICALL +Java_cc_openframeworks_OFAndroid_onCreate( JNIEnv* env, jclass clazz) +{ + ofAndroidActivityInit(); +} + #endif diff --git a/examples/android/androidVBOExample/src/main.cpp b/examples/android/androidVBOExample/src/main.cpp index ef340ca94b8..f98043c5a8c 100644 --- a/examples/android/androidVBOExample/src/main.cpp +++ b/examples/android/androidVBOExample/src/main.cpp @@ -1,26 +1,49 @@ #include "ofMain.h" #include "ofApp.h" -int main(){ - ofSetupOpenGL(1024,768, OF_WINDOW); // <-------- setup the GL context - - // this kicks off the running of my app - // can be OF_WINDOW or OF_FULLSCREEN - // pass in width and height too: - ofRunApp( new ofApp() ); - return 0; -} +#ifdef TARGET_ANDROID +#include "ofWindowSettings.h" +#include "ofGLProgrammableRenderer.h" + +shared_ptr *ofapp; +std::shared_ptr baseWindow; + +//-------------------------------------------------------------- +int main(int argc, char **argv) { + baseWindow = std::make_shared(); + ofxAndroidWindowSettings settings; + settings.glesVersion = 2; + settings.setSize(1920, 1080); + settings.windowMode = OF_WINDOW; + settings.preserveContextOnPause = true; + baseWindow = ofCreateWindow(settings); + ofapp = new shared_ptr(new ofApp()); + ofRunApp(baseWindow, *ofapp); + return 0; +} -#ifdef TARGET_ANDROID void ofAndroidApplicationInit() { - //application scope init + //application scope init } - void ofAndroidActivityInit() { - //activity scope init - main(); + //activity scope init - call main + main(0, nullptr); } + +// Callbacks from Android Layer +extern "C" JNIEXPORT void JNICALL +Java_cc_openframeworks_OFAndroid_init( JNIEnv* env, jclass clazz) +{ + ofAndroidApplicationInit(); +} + +extern "C" JNIEXPORT void JNICALL +Java_cc_openframeworks_OFAndroid_onCreate( JNIEnv* env, jclass clazz) +{ + ofAndroidActivityInit(); +} + #endif diff --git a/examples/android/androidVibratorExample/src/main.cpp b/examples/android/androidVibratorExample/src/main.cpp index ef340ca94b8..f98043c5a8c 100644 --- a/examples/android/androidVibratorExample/src/main.cpp +++ b/examples/android/androidVibratorExample/src/main.cpp @@ -1,26 +1,49 @@ #include "ofMain.h" #include "ofApp.h" -int main(){ - ofSetupOpenGL(1024,768, OF_WINDOW); // <-------- setup the GL context - - // this kicks off the running of my app - // can be OF_WINDOW or OF_FULLSCREEN - // pass in width and height too: - ofRunApp( new ofApp() ); - return 0; -} +#ifdef TARGET_ANDROID +#include "ofWindowSettings.h" +#include "ofGLProgrammableRenderer.h" + +shared_ptr *ofapp; +std::shared_ptr baseWindow; + +//-------------------------------------------------------------- +int main(int argc, char **argv) { + baseWindow = std::make_shared(); + ofxAndroidWindowSettings settings; + settings.glesVersion = 2; + settings.setSize(1920, 1080); + settings.windowMode = OF_WINDOW; + settings.preserveContextOnPause = true; + baseWindow = ofCreateWindow(settings); + ofapp = new shared_ptr(new ofApp()); + ofRunApp(baseWindow, *ofapp); + return 0; +} -#ifdef TARGET_ANDROID void ofAndroidApplicationInit() { - //application scope init + //application scope init } - void ofAndroidActivityInit() { - //activity scope init - main(); + //activity scope init - call main + main(0, nullptr); } + +// Callbacks from Android Layer +extern "C" JNIEXPORT void JNICALL +Java_cc_openframeworks_OFAndroid_init( JNIEnv* env, jclass clazz) +{ + ofAndroidApplicationInit(); +} + +extern "C" JNIEXPORT void JNICALL +Java_cc_openframeworks_OFAndroid_onCreate( JNIEnv* env, jclass clazz) +{ + ofAndroidActivityInit(); +} + #endif diff --git a/examples/android/androidVideoExample/src/main.cpp b/examples/android/androidVideoExample/src/main.cpp index ef340ca94b8..f98043c5a8c 100644 --- a/examples/android/androidVideoExample/src/main.cpp +++ b/examples/android/androidVideoExample/src/main.cpp @@ -1,26 +1,49 @@ #include "ofMain.h" #include "ofApp.h" -int main(){ - ofSetupOpenGL(1024,768, OF_WINDOW); // <-------- setup the GL context - - // this kicks off the running of my app - // can be OF_WINDOW or OF_FULLSCREEN - // pass in width and height too: - ofRunApp( new ofApp() ); - return 0; -} +#ifdef TARGET_ANDROID +#include "ofWindowSettings.h" +#include "ofGLProgrammableRenderer.h" + +shared_ptr *ofapp; +std::shared_ptr baseWindow; + +//-------------------------------------------------------------- +int main(int argc, char **argv) { + baseWindow = std::make_shared(); + ofxAndroidWindowSettings settings; + settings.glesVersion = 2; + settings.setSize(1920, 1080); + settings.windowMode = OF_WINDOW; + settings.preserveContextOnPause = true; + baseWindow = ofCreateWindow(settings); + ofapp = new shared_ptr(new ofApp()); + ofRunApp(baseWindow, *ofapp); + return 0; +} -#ifdef TARGET_ANDROID void ofAndroidApplicationInit() { - //application scope init + //application scope init } - void ofAndroidActivityInit() { - //activity scope init - main(); + //activity scope init - call main + main(0, nullptr); } + +// Callbacks from Android Layer +extern "C" JNIEXPORT void JNICALL +Java_cc_openframeworks_OFAndroid_init( JNIEnv* env, jclass clazz) +{ + ofAndroidApplicationInit(); +} + +extern "C" JNIEXPORT void JNICALL +Java_cc_openframeworks_OFAndroid_onCreate( JNIEnv* env, jclass clazz) +{ + ofAndroidActivityInit(); +} + #endif diff --git a/examples/android/androidVideoExample/src/ofApp.h b/examples/android/androidVideoExample/src/ofApp.h index 3927bdb480a..fab21d73585 100644 --- a/examples/android/androidVideoExample/src/ofApp.h +++ b/examples/android/androidVideoExample/src/ofApp.h @@ -3,17 +3,12 @@ #include "ofMain.h" #include "ofxAndroid.h" -// This example and in general ofVideoPlayer on -// android will only work with ice cream sandwich -// or later versions since the calls required to get -// an openGL texture from the video frames are only -// available from that version - class ofApp : public ofxAndroidApp{ public: void setup(); + void exit(); void update(); void draw(); @@ -37,6 +32,8 @@ class ofApp : public ofxAndroidApp{ void okPressed(); void cancelPressed(); - ofVideoPlayer player; - + void deviceRefreshRateChanged(int refreshRate); + void deviceHighestRefreshRateChanged(int refreshRate); + void deviceRefreshRateChangedEvent(int &refreshRate); + void deviceHighestRefreshRateChangedEvent(int & refreshRate); }; diff --git a/scripts/templates/android/build.gradle b/scripts/templates/android/build.gradle index 4b345aba2d9..3673c12d4f6 100644 --- a/scripts/templates/android/build.gradle +++ b/scripts/templates/android/build.gradle @@ -7,7 +7,7 @@ buildscript { mavenCentral() } dependencies { - classpath 'com.android.tools.build:gradle:8.9.0' + classpath 'com.android.tools.build:gradle:8.9.1' } } diff --git a/scripts/templates/android/gradle/wrapper/gradle-wrapper.jar b/scripts/templates/android/gradle/wrapper/gradle-wrapper.jar deleted file mode 100644 index a4b76b9530d..00000000000 Binary files a/scripts/templates/android/gradle/wrapper/gradle-wrapper.jar and /dev/null differ diff --git a/scripts/templates/android/gradle/wrapper/gradle-wrapper.properties b/scripts/templates/android/gradle/wrapper/gradle-wrapper.properties deleted file mode 100644 index e2847c82004..00000000000 --- a/scripts/templates/android/gradle/wrapper/gradle-wrapper.properties +++ /dev/null @@ -1,7 +0,0 @@ -distributionBase=GRADLE_USER_HOME -distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-8.11.1-bin.zip -networkTimeout=10000 -validateDistributionUrl=true -zipStoreBase=GRADLE_USER_HOME -zipStorePath=wrapper/dists diff --git a/scripts/templates/android/gradlew b/scripts/templates/android/gradlew deleted file mode 100755 index f5feea6d6b1..00000000000 --- a/scripts/templates/android/gradlew +++ /dev/null @@ -1,252 +0,0 @@ -#!/bin/sh - -# -# Copyright © 2015-2021 the original authors. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# -# SPDX-License-Identifier: Apache-2.0 -# - -############################################################################## -# -# Gradle start up script for POSIX generated by Gradle. -# -# Important for running: -# -# (1) You need a POSIX-compliant shell to run this script. If your /bin/sh is -# noncompliant, but you have some other compliant shell such as ksh or -# bash, then to run this script, type that shell name before the whole -# command line, like: -# -# ksh Gradle -# -# Busybox and similar reduced shells will NOT work, because this script -# requires all of these POSIX shell features: -# * functions; -# * expansions «$var», «${var}», «${var:-default}», «${var+SET}», -# «${var#prefix}», «${var%suffix}», and «$( cmd )»; -# * compound commands having a testable exit status, especially «case»; -# * various built-in commands including «command», «set», and «ulimit». -# -# Important for patching: -# -# (2) This script targets any POSIX shell, so it avoids extensions provided -# by Bash, Ksh, etc; in particular arrays are avoided. -# -# The "traditional" practice of packing multiple parameters into a -# space-separated string is a well documented source of bugs and security -# problems, so this is (mostly) avoided, by progressively accumulating -# options in "$@", and eventually passing that to Java. -# -# Where the inherited environment variables (DEFAULT_JVM_OPTS, JAVA_OPTS, -# and GRADLE_OPTS) rely on word-splitting, this is performed explicitly; -# see the in-line comments for details. -# -# There are tweaks for specific operating systems such as AIX, CygWin, -# Darwin, MinGW, and NonStop. -# -# (3) This script is generated from the Groovy template -# https://github.com/gradle/gradle/blob/HEAD/platforms/jvm/plugins-application/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt -# within the Gradle project. -# -# You can find Gradle at https://github.com/gradle/gradle/. -# -############################################################################## - -# Attempt to set APP_HOME - -# Resolve links: $0 may be a link -app_path=$0 - -# Need this for daisy-chained symlinks. -while - APP_HOME=${app_path%"${app_path##*/}"} # leaves a trailing /; empty if no leading path - [ -h "$app_path" ] -do - ls=$( ls -ld "$app_path" ) - link=${ls#*' -> '} - case $link in #( - /*) app_path=$link ;; #( - *) app_path=$APP_HOME$link ;; - esac -done - -# This is normally unused -# shellcheck disable=SC2034 -APP_BASE_NAME=${0##*/} -# Discard cd standard output in case $CDPATH is set (https://github.com/gradle/gradle/issues/25036) -APP_HOME=$( cd -P "${APP_HOME:-./}" > /dev/null && printf '%s -' "$PWD" ) || exit - -# Use the maximum available, or set MAX_FD != -1 to use that value. -MAX_FD=maximum - -warn () { - echo "$*" -} >&2 - -die () { - echo - echo "$*" - echo - exit 1 -} >&2 - -# OS specific support (must be 'true' or 'false'). -cygwin=false -msys=false -darwin=false -nonstop=false -case "$( uname )" in #( - CYGWIN* ) cygwin=true ;; #( - Darwin* ) darwin=true ;; #( - MSYS* | MINGW* ) msys=true ;; #( - NONSTOP* ) nonstop=true ;; -esac - -CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar - - -# Determine the Java command to use to start the JVM. -if [ -n "$JAVA_HOME" ] ; then - if [ -x "$JAVA_HOME/jre/sh/java" ] ; then - # IBM's JDK on AIX uses strange locations for the executables - JAVACMD=$JAVA_HOME/jre/sh/java - else - JAVACMD=$JAVA_HOME/bin/java - fi - if [ ! -x "$JAVACMD" ] ; then - die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME - -Please set the JAVA_HOME variable in your environment to match the -location of your Java installation." - fi -else - JAVACMD=java - if ! command -v java >/dev/null 2>&1 - then - die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. - -Please set the JAVA_HOME variable in your environment to match the -location of your Java installation." - fi -fi - -# Increase the maximum file descriptors if we can. -if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then - case $MAX_FD in #( - max*) - # In POSIX sh, ulimit -H is undefined. That's why the result is checked to see if it worked. - # shellcheck disable=SC2039,SC3045 - MAX_FD=$( ulimit -H -n ) || - warn "Could not query maximum file descriptor limit" - esac - case $MAX_FD in #( - '' | soft) :;; #( - *) - # In POSIX sh, ulimit -n is undefined. That's why the result is checked to see if it worked. - # shellcheck disable=SC2039,SC3045 - ulimit -n "$MAX_FD" || - warn "Could not set maximum file descriptor limit to $MAX_FD" - esac -fi - -# Collect all arguments for the java command, stacking in reverse order: -# * args from the command line -# * the main class name -# * -classpath -# * -D...appname settings -# * --module-path (only if needed) -# * DEFAULT_JVM_OPTS, JAVA_OPTS, and GRADLE_OPTS environment variables. - -# For Cygwin or MSYS, switch paths to Windows format before running java -if "$cygwin" || "$msys" ; then - APP_HOME=$( cygpath --path --mixed "$APP_HOME" ) - CLASSPATH=$( cygpath --path --mixed "$CLASSPATH" ) - - JAVACMD=$( cygpath --unix "$JAVACMD" ) - - # Now convert the arguments - kludge to limit ourselves to /bin/sh - for arg do - if - case $arg in #( - -*) false ;; # don't mess with options #( - /?*) t=${arg#/} t=/${t%%/*} # looks like a POSIX filepath - [ -e "$t" ] ;; #( - *) false ;; - esac - then - arg=$( cygpath --path --ignore --mixed "$arg" ) - fi - # Roll the args list around exactly as many times as the number of - # args, so each arg winds up back in the position where it started, but - # possibly modified. - # - # NB: a `for` loop captures its iteration list before it begins, so - # changing the positional parameters here affects neither the number of - # iterations, nor the values presented in `arg`. - shift # remove old arg - set -- "$@" "$arg" # push replacement arg - done -fi - - -# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. -DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"' - -# Collect all arguments for the java command: -# * DEFAULT_JVM_OPTS, JAVA_OPTS, JAVA_OPTS, and optsEnvironmentVar are not allowed to contain shell fragments, -# and any embedded shellness will be escaped. -# * For example: A user cannot expect ${Hostname} to be expanded, as it is an environment variable and will be -# treated as '${Hostname}' itself on the command line. - -set -- \ - "-Dorg.gradle.appname=$APP_BASE_NAME" \ - -classpath "$CLASSPATH" \ - org.gradle.wrapper.GradleWrapperMain \ - "$@" - -# Stop when "xargs" is not available. -if ! command -v xargs >/dev/null 2>&1 -then - die "xargs is not available" -fi - -# Use "xargs" to parse quoted args. -# -# With -n1 it outputs one arg per line, with the quotes and backslashes removed. -# -# In Bash we could simply go: -# -# readarray ARGS < <( xargs -n1 <<<"$var" ) && -# set -- "${ARGS[@]}" "$@" -# -# but POSIX shell has neither arrays nor command substitution, so instead we -# post-process each arg (as a line of input to sed) to backslash-escape any -# character that might be a shell metacharacter, then use eval to reverse -# that process (while maintaining the separation between arguments), and wrap -# the whole thing up as a single "set" statement. -# -# This will of course break if any of these variables contains a newline or -# an unmatched quote. -# - -eval "set -- $( - printf '%s\n' "$DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS" | - xargs -n1 | - sed ' s~[^-[:alnum:]+,./:=@_]~\\&~g; ' | - tr '\n' ' ' - )" '"$@"' - -exec "$JAVACMD" "$@" diff --git a/scripts/templates/android/gradlew.bat b/scripts/templates/android/gradlew.bat deleted file mode 100644 index 9d21a21834d..00000000000 --- a/scripts/templates/android/gradlew.bat +++ /dev/null @@ -1,94 +0,0 @@ -@rem -@rem Copyright 2015 the original author or authors. -@rem -@rem Licensed under the Apache License, Version 2.0 (the "License"); -@rem you may not use this file except in compliance with the License. -@rem You may obtain a copy of the License at -@rem -@rem https://www.apache.org/licenses/LICENSE-2.0 -@rem -@rem Unless required by applicable law or agreed to in writing, software -@rem distributed under the License is distributed on an "AS IS" BASIS, -@rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -@rem See the License for the specific language governing permissions and -@rem limitations under the License. -@rem -@rem SPDX-License-Identifier: Apache-2.0 -@rem - -@if "%DEBUG%"=="" @echo off -@rem ########################################################################## -@rem -@rem Gradle startup script for Windows -@rem -@rem ########################################################################## - -@rem Set local scope for the variables with windows NT shell -if "%OS%"=="Windows_NT" setlocal - -set DIRNAME=%~dp0 -if "%DIRNAME%"=="" set DIRNAME=. -@rem This is normally unused -set APP_BASE_NAME=%~n0 -set APP_HOME=%DIRNAME% - -@rem Resolve any "." and ".." in APP_HOME to make it shorter. -for %%i in ("%APP_HOME%") do set APP_HOME=%%~fi - -@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. -set DEFAULT_JVM_OPTS="-Xmx64m" "-Xms64m" - -@rem Find java.exe -if defined JAVA_HOME goto findJavaFromJavaHome - -set JAVA_EXE=java.exe -%JAVA_EXE% -version >NUL 2>&1 -if %ERRORLEVEL% equ 0 goto execute - -echo. 1>&2 -echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 1>&2 -echo. 1>&2 -echo Please set the JAVA_HOME variable in your environment to match the 1>&2 -echo location of your Java installation. 1>&2 - -goto fail - -:findJavaFromJavaHome -set JAVA_HOME=%JAVA_HOME:"=% -set JAVA_EXE=%JAVA_HOME%/bin/java.exe - -if exist "%JAVA_EXE%" goto execute - -echo. 1>&2 -echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% 1>&2 -echo. 1>&2 -echo Please set the JAVA_HOME variable in your environment to match the 1>&2 -echo location of your Java installation. 1>&2 - -goto fail - -:execute -@rem Setup the command line - -set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar - - -@rem Execute Gradle -"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %* - -:end -@rem End local scope for the variables with windows NT shell -if %ERRORLEVEL% equ 0 goto mainEnd - -:fail -rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of -rem the _cmd.exe /c_ return code! -set EXIT_CODE=%ERRORLEVEL% -if %EXIT_CODE% equ 0 set EXIT_CODE=1 -if not ""=="%GRADLE_EXIT_CONSOLE%" exit %EXIT_CODE% -exit /b %EXIT_CODE% - -:mainEnd -if "%OS%"=="Windows_NT" endlocal - -:omega