summaryrefslogtreecommitdiff
path: root/ide
diff options
context:
space:
mode:
authorMatthias Melcher <fltk@matthiasm.com>2018-03-05 23:17:51 +0000
committerMatthias Melcher <fltk@matthiasm.com>2018-03-05 23:17:51 +0000
commit3ed5e71da71e50849eb9e2c3244e843bc5e38a05 (patch)
tree245443359440a9b9927660e5a48b388bce0ce820 /ide
parentb47db80af359e5ab3b2188573cbf42ee439a2be7 (diff)
Android: moved to IDE directory.
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.4@12711 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
Diffstat (limited to 'ide')
-rw-r--r--ide/AndroidStudio3/AndroidStudio3.iml19
-rw-r--r--ide/AndroidStudio3/HelloAndroid.iml19
-rw-r--r--ide/AndroidStudio3/README.md30
-rw-r--r--ide/AndroidStudio3/app/app.iml141
-rw-r--r--ide/AndroidStudio3/app/build.gradle23
-rw-r--r--ide/AndroidStudio3/app/src/main/AndroidManifest.xml22
-rw-r--r--ide/AndroidStudio3/app/src/main/cpp/CMakeLists.txt45
-rw-r--r--ide/AndroidStudio3/app/src/main/cpp/HelloAndroid.cxx182
-rw-r--r--ide/AndroidStudio3/app/src/main/res/mipmap-hdpi/ic_launcher.pngbin0 -> 3418 bytes
-rw-r--r--ide/AndroidStudio3/app/src/main/res/mipmap-mdpi/ic_launcher.pngbin0 -> 2206 bytes
-rw-r--r--ide/AndroidStudio3/app/src/main/res/mipmap-xhdpi/ic_launcher.pngbin0 -> 4842 bytes
-rw-r--r--ide/AndroidStudio3/app/src/main/res/mipmap-xxhdpi/ic_launcher.pngbin0 -> 7718 bytes
-rw-r--r--ide/AndroidStudio3/app/src/main/res/values/strings.xml4
-rw-r--r--ide/AndroidStudio3/build.gradle17
-rw-r--r--ide/AndroidStudio3/gradle/wrapper/gradle-wrapper.jarbin0 -> 49896 bytes
-rw-r--r--ide/AndroidStudio3/gradle/wrapper/gradle-wrapper.properties6
-rwxr-xr-xide/AndroidStudio3/gradlew164
-rw-r--r--ide/AndroidStudio3/gradlew.zipbin0 -> 1127 bytes
-rw-r--r--ide/AndroidStudio3/settings.gradle1
19 files changed, 673 insertions, 0 deletions
diff --git a/ide/AndroidStudio3/AndroidStudio3.iml b/ide/AndroidStudio3/AndroidStudio3.iml
new file mode 100644
index 000000000..e1f575209
--- /dev/null
+++ b/ide/AndroidStudio3/AndroidStudio3.iml
@@ -0,0 +1,19 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<module external.linked.project.id="AndroidStudio3" external.linked.project.path="$MODULE_DIR$" external.root.project.path="$MODULE_DIR$" external.system.id="GRADLE" type="JAVA_MODULE" version="4">
+ <component name="FacetManager">
+ <facet type="java-gradle" name="Java-Gradle">
+ <configuration>
+ <option name="BUILD_FOLDER_PATH" value="$MODULE_DIR$/build" />
+ <option name="BUILDABLE" value="false" />
+ </configuration>
+ </facet>
+ </component>
+ <component name="NewModuleRootManager" LANGUAGE_LEVEL="JDK_1_7" inherit-compiler-output="true">
+ <exclude-output />
+ <content url="file://$MODULE_DIR$">
+ <excludeFolder url="file://$MODULE_DIR$/.gradle" />
+ </content>
+ <orderEntry type="inheritedJdk" />
+ <orderEntry type="sourceFolder" forTests="false" />
+ </component>
+</module> \ No newline at end of file
diff --git a/ide/AndroidStudio3/HelloAndroid.iml b/ide/AndroidStudio3/HelloAndroid.iml
new file mode 100644
index 000000000..2f8158080
--- /dev/null
+++ b/ide/AndroidStudio3/HelloAndroid.iml
@@ -0,0 +1,19 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<module external.linked.project.id="HelloAndroid" external.linked.project.path="$MODULE_DIR$" external.root.project.path="$MODULE_DIR$" external.system.id="GRADLE" type="JAVA_MODULE" version="4">
+ <component name="FacetManager">
+ <facet type="java-gradle" name="Java-Gradle">
+ <configuration>
+ <option name="BUILD_FOLDER_PATH" value="$MODULE_DIR$/build" />
+ <option name="BUILDABLE" value="false" />
+ </configuration>
+ </facet>
+ </component>
+ <component name="NewModuleRootManager" LANGUAGE_LEVEL="JDK_1_7" inherit-compiler-output="true">
+ <exclude-output />
+ <content url="file://$MODULE_DIR$">
+ <excludeFolder url="file://$MODULE_DIR$/.gradle" />
+ </content>
+ <orderEntry type="inheritedJdk" />
+ <orderEntry type="sourceFolder" forTests="false" />
+ </component>
+</module> \ No newline at end of file
diff --git a/ide/AndroidStudio3/README.md b/ide/AndroidStudio3/README.md
new file mode 100644
index 000000000..73bbbc4e9
--- /dev/null
+++ b/ide/AndroidStudio3/README.md
@@ -0,0 +1,30 @@
+Hello Android
+=============
+Hello Android is an FLTK sample app that derives from the Android Studio sample
+project Native Plasma. This sample uses Android Studio 3 and CMake.
+
+Pre-requisites
+--------------
+- Android Studio 3.0+ with [NDK](https://developer.android.com/ndk/) bundle.
+
+Getting Started
+---------------
+1. [Download Android Studio](http://developer.android.com/sdk/index.html)
+1. Launch Android Studio.
+1. Open the Android directory inside the FLTK directory.
+1. Open the AndroidStudio project by loading the HelloAndroid directory.
+1. Click *Run/Run 'app'*.
+
+Micrososft Windows Users
+------------------------
+The file 'gradlew.zip' must be unzipped before you can use AndroidStudio. It contains the required file 'gradlew.bat'. This was neccessary because some svn setups block anything that looks like an executable file, including files that end in .bat .
+
+Support
+-------
+If you've found an error in these samples, please [file an issue](http://www.fltk.org/str.php). Patches are encouraged, and may be submitted via the same FLTK Bug & Feature system.
+
+Please visit the FLTK [Forum](http://www.fltk.org/newsgroups.php) for additional help.
+
+License
+-------
+FLTK is provided under the terms of the [GNU Library Public License, Version 2 with exceptions](http://www.fltk.org/COPYING.php) that allow for static linking.
diff --git a/ide/AndroidStudio3/app/app.iml b/ide/AndroidStudio3/app/app.iml
new file mode 100644
index 000000000..ffb02d88c
--- /dev/null
+++ b/ide/AndroidStudio3/app/app.iml
@@ -0,0 +1,141 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<module external.linked.project.id=":app" external.linked.project.path="$MODULE_DIR$" external.root.project.path="$MODULE_DIR$/.." external.system.id="GRADLE" type="JAVA_MODULE" version="4">
+ <component name="FacetManager">
+ <facet type="android-gradle" name="Android-Gradle">
+ <configuration>
+ <option name="GRADLE_PROJECT_PATH" value=":app" />
+ </configuration>
+ </facet>
+ <facet type="native-android-gradle" name="Native-Android-Gradle">
+ <configuration>
+ <option name="SELECTED_BUILD_VARIANT" value="debug" />
+ </configuration>
+ </facet>
+ <facet type="android" name="Android">
+ <configuration>
+ <option name="SELECTED_BUILD_VARIANT" value="debug" />
+ <option name="ASSEMBLE_TASK_NAME" value="assembleDebug" />
+ <option name="COMPILE_JAVA_TASK_NAME" value="compileDebugSources" />
+ <afterSyncTasks>
+ <task>generateDebugSources</task>
+ </afterSyncTasks>
+ <option name="ALLOW_USER_CONFIGURATION" value="false" />
+ <option name="MANIFEST_FILE_RELATIVE_PATH" value="/src/main/AndroidManifest.xml" />
+ <option name="RES_FOLDER_RELATIVE_PATH" value="/src/main/res" />
+ <option name="RES_FOLDERS_RELATIVE_PATH" value="file://$MODULE_DIR$/src/main/res" />
+ <option name="ASSETS_FOLDER_RELATIVE_PATH" value="/src/main/assets" />
+ </configuration>
+ </facet>
+ </component>
+ <component name="NewModuleRootManager" LANGUAGE_LEVEL="JDK_1_7">
+ <output url="file://$MODULE_DIR$/build/intermediates/classes/debug" />
+ <output-test url="file://$MODULE_DIR$/build/intermediates/classes/test/debug" />
+ <exclude-output />
+ <content url="file://$MODULE_DIR$">
+ <sourceFolder url="file://$MODULE_DIR$/src/main/cpp" isTestSource="false" />
+ <sourceFolder url="file://$MODULE_DIR$/build/generated/source/apt/debug" isTestSource="false" generated="true" />
+ <sourceFolder url="file://$MODULE_DIR$/build/generated/source/r/debug" isTestSource="false" generated="true" />
+ <sourceFolder url="file://$MODULE_DIR$/build/generated/source/aidl/debug" isTestSource="false" generated="true" />
+ <sourceFolder url="file://$MODULE_DIR$/build/generated/source/buildConfig/debug" isTestSource="false" generated="true" />
+ <sourceFolder url="file://$MODULE_DIR$/build/generated/source/rs/debug" isTestSource="false" generated="true" />
+ <sourceFolder url="file://$MODULE_DIR$/build/generated/res/rs/debug" type="java-resource" />
+ <sourceFolder url="file://$MODULE_DIR$/build/generated/res/resValues/debug" type="java-resource" />
+ <sourceFolder url="file://$MODULE_DIR$/build/generated/source/apt/androidTest/debug" isTestSource="true" generated="true" />
+ <sourceFolder url="file://$MODULE_DIR$/build/generated/source/r/androidTest/debug" isTestSource="true" generated="true" />
+ <sourceFolder url="file://$MODULE_DIR$/build/generated/source/aidl/androidTest/debug" isTestSource="true" generated="true" />
+ <sourceFolder url="file://$MODULE_DIR$/build/generated/source/buildConfig/androidTest/debug" isTestSource="true" generated="true" />
+ <sourceFolder url="file://$MODULE_DIR$/build/generated/source/rs/androidTest/debug" isTestSource="true" generated="true" />
+ <sourceFolder url="file://$MODULE_DIR$/build/generated/res/rs/androidTest/debug" type="java-test-resource" />
+ <sourceFolder url="file://$MODULE_DIR$/build/generated/res/resValues/androidTest/debug" type="java-test-resource" />
+ <sourceFolder url="file://$MODULE_DIR$/build/generated/source/apt/test/debug" isTestSource="true" generated="true" />
+ <sourceFolder url="file://$MODULE_DIR$/src/debug/res" type="java-resource" />
+ <sourceFolder url="file://$MODULE_DIR$/src/debug/resources" type="java-resource" />
+ <sourceFolder url="file://$MODULE_DIR$/src/debug/assets" type="java-resource" />
+ <sourceFolder url="file://$MODULE_DIR$/src/debug/aidl" isTestSource="false" />
+ <sourceFolder url="file://$MODULE_DIR$/src/debug/java" isTestSource="false" />
+ <sourceFolder url="file://$MODULE_DIR$/src/debug/jni" isTestSource="false" />
+ <sourceFolder url="file://$MODULE_DIR$/src/debug/rs" isTestSource="false" />
+ <sourceFolder url="file://$MODULE_DIR$/src/debug/shaders" isTestSource="false" />
+ <sourceFolder url="file://$MODULE_DIR$/src/testDebug/res" type="java-test-resource" />
+ <sourceFolder url="file://$MODULE_DIR$/src/testDebug/resources" type="java-test-resource" />
+ <sourceFolder url="file://$MODULE_DIR$/src/testDebug/assets" type="java-test-resource" />
+ <sourceFolder url="file://$MODULE_DIR$/src/testDebug/aidl" isTestSource="true" />
+ <sourceFolder url="file://$MODULE_DIR$/src/testDebug/java" isTestSource="true" />
+ <sourceFolder url="file://$MODULE_DIR$/src/testDebug/jni" isTestSource="true" />
+ <sourceFolder url="file://$MODULE_DIR$/src/testDebug/rs" isTestSource="true" />
+ <sourceFolder url="file://$MODULE_DIR$/src/testDebug/shaders" isTestSource="true" />
+ <sourceFolder url="file://$MODULE_DIR$/src/androidTestDebug/res" type="java-test-resource" />
+ <sourceFolder url="file://$MODULE_DIR$/src/androidTestDebug/resources" type="java-test-resource" />
+ <sourceFolder url="file://$MODULE_DIR$/src/androidTestDebug/assets" type="java-test-resource" />
+ <sourceFolder url="file://$MODULE_DIR$/src/androidTestDebug/aidl" isTestSource="true" />
+ <sourceFolder url="file://$MODULE_DIR$/src/androidTestDebug/java" isTestSource="true" />
+ <sourceFolder url="file://$MODULE_DIR$/src/androidTestDebug/jni" isTestSource="true" />
+ <sourceFolder url="file://$MODULE_DIR$/src/androidTestDebug/rs" isTestSource="true" />
+ <sourceFolder url="file://$MODULE_DIR$/src/androidTestDebug/shaders" isTestSource="true" />
+ <sourceFolder url="file://$MODULE_DIR$/src/main/res" type="java-resource" />
+ <sourceFolder url="file://$MODULE_DIR$/src/main/resources" type="java-resource" />
+ <sourceFolder url="file://$MODULE_DIR$/src/main/assets" type="java-resource" />
+ <sourceFolder url="file://$MODULE_DIR$/src/main/aidl" isTestSource="false" />
+ <sourceFolder url="file://$MODULE_DIR$/src/main/java" isTestSource="false" />
+ <sourceFolder url="file://$MODULE_DIR$/src/main/jni" isTestSource="false" />
+ <sourceFolder url="file://$MODULE_DIR$/src/main/rs" isTestSource="false" />
+ <sourceFolder url="file://$MODULE_DIR$/src/main/shaders" isTestSource="false" />
+ <sourceFolder url="file://$MODULE_DIR$/src/androidTest/res" type="java-test-resource" />
+ <sourceFolder url="file://$MODULE_DIR$/src/androidTest/resources" type="java-test-resource" />
+ <sourceFolder url="file://$MODULE_DIR$/src/androidTest/assets" type="java-test-resource" />
+ <sourceFolder url="file://$MODULE_DIR$/src/androidTest/aidl" isTestSource="true" />
+ <sourceFolder url="file://$MODULE_DIR$/src/androidTest/java" isTestSource="true" />
+ <sourceFolder url="file://$MODULE_DIR$/src/androidTest/jni" isTestSource="true" />
+ <sourceFolder url="file://$MODULE_DIR$/src/androidTest/rs" isTestSource="true" />
+ <sourceFolder url="file://$MODULE_DIR$/src/androidTest/shaders" isTestSource="true" />
+ <sourceFolder url="file://$MODULE_DIR$/src/test/res" type="java-test-resource" />
+ <sourceFolder url="file://$MODULE_DIR$/src/test/resources" type="java-test-resource" />
+ <sourceFolder url="file://$MODULE_DIR$/src/test/assets" type="java-test-resource" />
+ <sourceFolder url="file://$MODULE_DIR$/src/test/aidl" isTestSource="true" />
+ <sourceFolder url="file://$MODULE_DIR$/src/test/java" isTestSource="true" />
+ <sourceFolder url="file://$MODULE_DIR$/src/test/jni" isTestSource="true" />
+ <sourceFolder url="file://$MODULE_DIR$/src/test/rs" isTestSource="true" />
+ <sourceFolder url="file://$MODULE_DIR$/src/test/shaders" isTestSource="true" />
+ <excludeFolder url="file://$MODULE_DIR$/build/intermediates/assets" />
+ <excludeFolder url="file://$MODULE_DIR$/build/intermediates/blame" />
+ <excludeFolder url="file://$MODULE_DIR$/build/intermediates/check-manifest" />
+ <excludeFolder url="file://$MODULE_DIR$/build/intermediates/classes" />
+ <excludeFolder url="file://$MODULE_DIR$/build/intermediates/cmake" />
+ <excludeFolder url="file://$MODULE_DIR$/build/intermediates/incremental" />
+ <excludeFolder url="file://$MODULE_DIR$/build/intermediates/javaPrecompile" />
+ <excludeFolder url="file://$MODULE_DIR$/build/intermediates/jniLibs" />
+ <excludeFolder url="file://$MODULE_DIR$/build/intermediates/lint" />
+ <excludeFolder url="file://$MODULE_DIR$/build/intermediates/manifests" />
+ <excludeFolder url="file://$MODULE_DIR$/build/intermediates/prebuild" />
+ <excludeFolder url="file://$MODULE_DIR$/build/intermediates/res" />
+ <excludeFolder url="file://$MODULE_DIR$/build/intermediates/rs" />
+ <excludeFolder url="file://$MODULE_DIR$/build/intermediates/shaders" />
+ <excludeFolder url="file://$MODULE_DIR$/build/intermediates/splits-support" />
+ <excludeFolder url="file://$MODULE_DIR$/build/intermediates/symbols" />
+ <excludeFolder url="file://$MODULE_DIR$/build/intermediates/tmp" />
+ <excludeFolder url="file://$MODULE_DIR$/build/intermediates/transforms" />
+ <excludeFolder url="file://$MODULE_DIR$/build/outputs" />
+ <excludeFolder url="file://$MODULE_DIR$/build/tmp" />
+ </content>
+ <content url="file://$MODULE_DIR$/../../../jpeg">
+ <sourceFolder url="file://$MODULE_DIR$/../../../jpeg" isTestSource="false" />
+ </content>
+ <content url="file://$MODULE_DIR$/../../../png">
+ <sourceFolder url="file://$MODULE_DIR$/../../../png" isTestSource="false" />
+ </content>
+ <content url="file://$MODULE_DIR$/../../../src">
+ <sourceFolder url="file://$MODULE_DIR$/../../../src" isTestSource="false" />
+ </content>
+ <content url="file://$MODULE_DIR$/../../../src/drivers/Android">
+ <sourceFolder url="file://$MODULE_DIR$/../../../src/drivers/Android" isTestSource="false" />
+ </content>
+ <content url="file://$MODULE_DIR$/../../../src/drivers/PostScript">
+ <sourceFolder url="file://$MODULE_DIR$/../../../src/drivers/PostScript" isTestSource="false" />
+ </content>
+ <content url="file://$MODULE_DIR$/../../../src/xutf8">
+ <sourceFolder url="file://$MODULE_DIR$/../../../src/xutf8" isTestSource="false" />
+ </content>
+ <orderEntry type="jdk" jdkName="Android API 25 Platform" jdkType="Android SDK" />
+ <orderEntry type="sourceFolder" forTests="false" />
+ </component>
+</module> \ No newline at end of file
diff --git a/ide/AndroidStudio3/app/build.gradle b/ide/AndroidStudio3/app/build.gradle
new file mode 100644
index 000000000..dbe9d3dc9
--- /dev/null
+++ b/ide/AndroidStudio3/app/build.gradle
@@ -0,0 +1,23 @@
+apply plugin: 'com.android.application'
+
+ android {
+ compileSdkVersion 25
+
+ defaultConfig {
+ applicationId 'org.fltk.android_hello'
+ minSdkVersion 14
+ targetSdkVersion 25
+ }
+ buildTypes {
+ release {
+ minifyEnabled false
+ proguardFiles getDefaultProguardFile('proguard-android.txt'),
+ 'proguard-rules.pro'
+ }
+ }
+ externalNativeBuild {
+ cmake {
+ path 'src/main/cpp/CMakeLists.txt'
+ }
+ }
+ }
diff --git a/ide/AndroidStudio3/app/src/main/AndroidManifest.xml b/ide/AndroidStudio3/app/src/main/AndroidManifest.xml
new file mode 100644
index 000000000..e0131f422
--- /dev/null
+++ b/ide/AndroidStudio3/app/src/main/AndroidManifest.xml
@@ -0,0 +1,22 @@
+<?xml version="1.0" encoding="utf-8"?>
+<manifest xmlns:android="http://schemas.android.com/apk/res/android"
+ package="org.fltk.android_hello"
+ android:versionCode="1"
+ android:versionName="1.0">
+ <application
+ android:allowBackup="false"
+ android:fullBackupContent="false"
+ android:icon="@mipmap/ic_launcher"
+ android:label="@string/app_name"
+ android:hasCode="false">
+ <activity android:name="android.app.NativeActivity"
+ android:label="@string/app_name">
+ <meta-data android:name="android.app.lib_name"
+ android:value="android-hello" />
+ <intent-filter>
+ <action android:name="android.intent.action.MAIN" />
+ <category android:name="android.intent.category.LAUNCHER" />
+ </intent-filter>
+ </activity>
+ </application>
+</manifest>
diff --git a/ide/AndroidStudio3/app/src/main/cpp/CMakeLists.txt b/ide/AndroidStudio3/app/src/main/cpp/CMakeLists.txt
new file mode 100644
index 000000000..408052168
--- /dev/null
+++ b/ide/AndroidStudio3/app/src/main/cpp/CMakeLists.txt
@@ -0,0 +1,45 @@
+#
+# Copyright (C) The Android Open Source Project
+#
+# 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
+#
+# http://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.
+#
+
+cmake_minimum_required(VERSION 3.4.1)
+
+set(FLTK_DIR ../../../../../..)
+
+# FIXME: add as a second argument the binary build dir
+# so that the first argument can link directly to FLTK
+# instead of the fltk symlink, which is bad for SVN
+add_subdirectory(${FLTK_DIR}/ "${CMAKE_CURRENT_BINARY_DIR}/fltk" EXCLUDE_FROM_ALL)
+
+# now build app's shared lib
+add_library(android-hello SHARED
+ HelloAndroid.cxx)
+
+target_include_directories(android-hello PRIVATE
+ ${FLTK_DIR}/
+ ${FLTK_DIR}/Android/)
+
+# Export ANativeActivity_onCreate(),

+# Refer to: https://github.com/android-ndk/ndk/issues/381.
+set(CMAKE_SHARED_LINKER_FLAGS
+ "${CMAKE_SHARED_LINKER_FLAGS} -u ANativeActivity_onCreate")
+
+# add lib dependencies
+target_link_libraries(android-hello
+ fltk
+ android
+ log
+ m)
+
diff --git a/ide/AndroidStudio3/app/src/main/cpp/HelloAndroid.cxx b/ide/AndroidStudio3/app/src/main/cpp/HelloAndroid.cxx
new file mode 100644
index 000000000..bba38a5b7
--- /dev/null
+++ b/ide/AndroidStudio3/app/src/main/cpp/HelloAndroid.cxx
@@ -0,0 +1,182 @@
+/*
+ * Copyright (C) 2010 The Android Open Source Project
+ *
+ * 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
+ *
+ * http://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.
+ *
+ */
+
+//#include <android_native_app_glue.h>
+#include <src/drivers/Android/Fl_Android_Application.H>
+#include <src/drivers/Android/Fl_Android_Screen_Driver.H>
+
+#include <FL/Fl_Window.H>
+#include <FL/Fl_Button.H>
+#include <FL/Enumerations.H>
+Fl_Window *win;
+Fl_Button *btn;
+
+#include <errno.h>
+#include <jni.h>
+#include <sys/time.h>
+#include <time.h>
+#include <android/log.h>
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <math.h>
+
+#define LOG_TAG "HelloFLTK"
+#define LOGI(...) __android_log_print(ANDROID_LOG_INFO,LOG_TAG,__VA_ARGS__)
+#define LOGW(...) __android_log_print(ANDROID_LOG_WARN,LOG_TAG,__VA_ARGS__)
+#define LOGE(...) __android_log_print(ANDROID_LOG_ERROR,LOG_TAG,__VA_ARGS__)
+
+/* Set to 1 to enable debug log traces. */
+#define DEBUG 0
+
+// ----------------------------------------------------------------------
+
+struct engine {
+ int animating;
+};
+
+struct engine engine = { 0 };
+
+static void engine_draw_frame()
+{
+ //if (Fl_Android_Application::lock_screen()) {
+ Fl::damage(FL_DAMAGE_ALL);
+ win->redraw();
+ Fl::flush();
+ // Fl_Android_Application::unlock_and_post_screen();
+ //}
+}
+
+static void engine_term_display() {
+ engine.animating = 0;
+}
+
+static int32_t engine_handle_input(AInputEvent* event) {
+ if (AInputEvent_getType(event) == AINPUT_EVENT_TYPE_MOTION) {
+ engine.animating = 1;
+ Fl::e_x = Fl::e_x_root = AMotionEvent_getX(event, 0) * 600 / ANativeWindow_getWidth(Fl_Android_Application::native_window());
+ Fl::e_y = Fl::e_y_root = AMotionEvent_getY(event, 0) * 800 / ANativeWindow_getHeight(Fl_Android_Application::native_window());
+ Fl::e_state = FL_BUTTON1;
+ Fl::e_keysym = FL_Button+1;
+ if (AMotionEvent_getAction(event)==AMOTION_EVENT_ACTION_DOWN) {
+ Fl::e_is_click = 1;
+ Fl::handle(FL_PUSH, Fl::first_window());
+ LOGE("Mouse push %d at %d, %d", Fl::event_button(), Fl::event_x(), Fl::event_y());
+ } else if (AMotionEvent_getAction(event)==AMOTION_EVENT_ACTION_MOVE) {
+ Fl::handle(FL_DRAG, Fl::first_window());
+ } else if (AMotionEvent_getAction(event)==AMOTION_EVENT_ACTION_UP) {
+ Fl::e_state = 0;
+ Fl::handle(FL_RELEASE, Fl::first_window());
+ }
+ return 1;
+ } else if (AInputEvent_getType(event) == AINPUT_EVENT_TYPE_KEY) {
+ LOGI("Key event: action=%d keyCode=%d metaState=0x%x",
+ AKeyEvent_getAction(event),
+ AKeyEvent_getKeyCode(event),
+ AKeyEvent_getMetaState(event));
+ }
+
+ return 0;
+}
+
+static void engine_handle_cmd(int32_t cmd) {
+ static int32_t format = WINDOW_FORMAT_RGB_565;
+ switch (cmd) {
+ case APP_CMD_INIT_WINDOW:
+ if (Fl_Android_Application::native_window() != NULL) {
+ // fill_plasma() assumes 565 format, get it here
+ format = ANativeWindow_getFormat(Fl_Android_Application::native_window());
+ ANativeWindow_setBuffersGeometry(Fl_Android_Application::native_window(),
+#if 1
+ 600, //ANativeWindow_getWidth(app->window),
+ 800, //ANativeWindow_getHeight(app->window),
+#else
+ ANativeWindow_getWidth(app->window),
+ ANativeWindow_getHeight(app->window),
+#endif
+ WINDOW_FORMAT_RGB_565);
+ engine_draw_frame();
+ }
+ break;
+ case APP_CMD_TERM_WINDOW:
+ engine_term_display();
+ ANativeWindow_setBuffersGeometry(Fl_Android_Application::native_window(),
+#if 1
+ 600, //ANativeWindow_getWidth(app->window),
+ 800, //ANativeWindow_getHeight(app->window),
+#else
+ ANativeWindow_getWidth(app->window),
+ ANativeWindow_getHeight(app->window),
+#endif
+ format);
+ break;
+ case APP_CMD_LOST_FOCUS:
+ engine.animating = 0;
+ engine_draw_frame();
+ break;
+ default: break;
+ }
+}
+
+
+int main(int argc, char **argv)
+{
+ Fl_Android_Application::log_e("App path is %s", argv[0]);
+
+ memset(&engine, 0, sizeof(engine));
+ Fl_Android_Application::set_on_app_cmd(engine_handle_cmd);
+ Fl_Android_Application::set_on_input_event(engine_handle_input);
+
+ win = new Fl_Window(10, 10, 600, 400, "Hallo");
+ btn = new Fl_Button(190, 200, 280, 35, "Hello, Android!");
+ btn->color(FL_LIGHT2);
+ win->show();
+ Fl::damage(FL_DAMAGE_ALL);
+ win->redraw();
+
+
+ // loop waiting for stuff to do.
+
+ while (1) {
+ // Read all pending events.
+ int ident;
+ int events;
+ struct android_poll_source* source;
+
+ // If not animating, we will block forever waiting for events.
+ // If animating, we loop until all events are read, then continue
+ // to draw the next frame of animation.
+ while ((ident=ALooper_pollAll(engine.animating ? 0 : -1, NULL, &events,
+ (void**)&source)) >= 0) {
+
+ // Process this event.
+ if (source != NULL) {
+ source->process(source);
+ }
+
+ // Check if we are exiting.
+ if (Fl_Android_Application::destroy_requested() != 0) {
+ LOGI("Engine thread destroy requested!");
+ engine_term_display();
+ return 0;
+ }
+ }
+ Fl::flush();
+ }
+ return 0;
+}
diff --git a/ide/AndroidStudio3/app/src/main/res/mipmap-hdpi/ic_launcher.png b/ide/AndroidStudio3/app/src/main/res/mipmap-hdpi/ic_launcher.png
new file mode 100644
index 000000000..cde69bccc
--- /dev/null
+++ b/ide/AndroidStudio3/app/src/main/res/mipmap-hdpi/ic_launcher.png
Binary files differ
diff --git a/ide/AndroidStudio3/app/src/main/res/mipmap-mdpi/ic_launcher.png b/ide/AndroidStudio3/app/src/main/res/mipmap-mdpi/ic_launcher.png
new file mode 100644
index 000000000..c133a0cbd
--- /dev/null
+++ b/ide/AndroidStudio3/app/src/main/res/mipmap-mdpi/ic_launcher.png
Binary files differ
diff --git a/ide/AndroidStudio3/app/src/main/res/mipmap-xhdpi/ic_launcher.png b/ide/AndroidStudio3/app/src/main/res/mipmap-xhdpi/ic_launcher.png
new file mode 100644
index 000000000..bfa42f0e7
--- /dev/null
+++ b/ide/AndroidStudio3/app/src/main/res/mipmap-xhdpi/ic_launcher.png
Binary files differ
diff --git a/ide/AndroidStudio3/app/src/main/res/mipmap-xxhdpi/ic_launcher.png b/ide/AndroidStudio3/app/src/main/res/mipmap-xxhdpi/ic_launcher.png
new file mode 100644
index 000000000..324e72cdd
--- /dev/null
+++ b/ide/AndroidStudio3/app/src/main/res/mipmap-xxhdpi/ic_launcher.png
Binary files differ
diff --git a/ide/AndroidStudio3/app/src/main/res/values/strings.xml b/ide/AndroidStudio3/app/src/main/res/values/strings.xml
new file mode 100644
index 000000000..e2f60e96f
--- /dev/null
+++ b/ide/AndroidStudio3/app/src/main/res/values/strings.xml
@@ -0,0 +1,4 @@
+<?xml version="1.0" encoding="utf-8"?>
+<resources>
+ <string name="app_name">Hello Android</string>
+</resources>
diff --git a/ide/AndroidStudio3/build.gradle b/ide/AndroidStudio3/build.gradle
new file mode 100644
index 000000000..a4ea174d3
--- /dev/null
+++ b/ide/AndroidStudio3/build.gradle
@@ -0,0 +1,17 @@
+// Top-level build file where you can add configuration options common to all sub-projects/modules.
+buildscript {
+ repositories {
+ jcenter()
+ google()
+ }
+ dependencies {
+ classpath 'com.android.tools.build:gradle:3.0.1'
+ }
+}
+
+allprojects {
+ repositories {
+ jcenter()
+ google()
+ }
+}
diff --git a/ide/AndroidStudio3/gradle/wrapper/gradle-wrapper.jar b/ide/AndroidStudio3/gradle/wrapper/gradle-wrapper.jar
new file mode 100644
index 000000000..8c0fb64a8
--- /dev/null
+++ b/ide/AndroidStudio3/gradle/wrapper/gradle-wrapper.jar
Binary files differ
diff --git a/ide/AndroidStudio3/gradle/wrapper/gradle-wrapper.properties b/ide/AndroidStudio3/gradle/wrapper/gradle-wrapper.properties
new file mode 100644
index 000000000..a851373bd
--- /dev/null
+++ b/ide/AndroidStudio3/gradle/wrapper/gradle-wrapper.properties
@@ -0,0 +1,6 @@
+#Sun Feb 05 20:05:03 IST 2017
+distributionBase=GRADLE_USER_HOME
+distributionPath=wrapper/dists
+zipStoreBase=GRADLE_USER_HOME
+zipStorePath=wrapper/dists
+distributionUrl=https\://services.gradle.org/distributions/gradle-4.1-all.zip
diff --git a/ide/AndroidStudio3/gradlew b/ide/AndroidStudio3/gradlew
new file mode 100755
index 000000000..91a7e269e
--- /dev/null
+++ b/ide/AndroidStudio3/gradlew
@@ -0,0 +1,164 @@
+#!/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
+
+# For Cygwin, ensure paths are in UNIX format before anything is touched.
+if $cygwin ; then
+ [ -n "$JAVA_HOME" ] && JAVA_HOME=`cygpath --unix "$JAVA_HOME"`
+fi
+
+# 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\"`/" >&-
+APP_HOME="`pwd -P`"
+cd "$SAVED" >&-
+
+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"`
+
+ # 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/ide/AndroidStudio3/gradlew.zip b/ide/AndroidStudio3/gradlew.zip
new file mode 100644
index 000000000..699ec0b66
--- /dev/null
+++ b/ide/AndroidStudio3/gradlew.zip
Binary files differ
diff --git a/ide/AndroidStudio3/settings.gradle b/ide/AndroidStudio3/settings.gradle
new file mode 100644
index 000000000..e7b4def49
--- /dev/null
+++ b/ide/AndroidStudio3/settings.gradle
@@ -0,0 +1 @@
+include ':app'