Skip to content

Commit 28b9f67

Browse files
authored
Merge pull request #5 from artoolkitx/android
New Android version based on SDL Android skeleton.
2 parents 3d28e41 + cb0f7c9 commit 28b9f67

File tree

126 files changed

+57800
-19
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

126 files changed

+57800
-19
lines changed

.gitignore

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,3 +10,9 @@ macOS/user-config.xcconfig
1010
macOS/build/
1111
xcuserdata/
1212
*.xcscmblueprint
13+
local.properties
14+
Android/app/.cxx
15+
Android/app/build
16+
Android/build
17+
Android/.gradle
18+
depends/android/artoolkitx

Android/.idea/.gitignore

Lines changed: 3 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Android/.idea/compiler.xml

Lines changed: 6 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Android/.idea/gradle.xml

Lines changed: 20 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Android/.idea/jarRepositories.xml

Lines changed: 25 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Android/.idea/misc.xml

Lines changed: 9 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Android/.idea/vcs.xml

Lines changed: 6 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Android/app/build.gradle

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
plugins {
2+
id 'com.android.application'
3+
}
4+
5+
android {
6+
compileSdkVersion 33
7+
defaultConfig {
8+
applicationId "org.artoolkitx.utilities.calibcameraandroid"
9+
minSdkVersion 24
10+
targetSdkVersion 33
11+
versionCode 1
12+
versionName "1.0"
13+
externalNativeBuild {
14+
cmake {
15+
arguments "-DANDROID_APP_PLATFORM=android-24", "-DANDROID_STL=c++_shared"
16+
// abiFilters 'armeabi-v7a', 'arm64-v8a', 'x86', 'x86_64'
17+
//abiFilters 'arm64-v8a'
18+
}
19+
}
20+
}
21+
buildTypes {
22+
release {
23+
minifyEnabled false
24+
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
25+
}
26+
}
27+
applicationVariants.all { variant ->
28+
tasks["merge${variant.name.capitalize()}Assets"]
29+
.dependsOn("externalNativeBuild${variant.name.capitalize()}")
30+
}
31+
if (!project.hasProperty('EXCLUDE_NATIVE_LIBS')) {
32+
sourceSets.main {
33+
jniLibs.srcDir 'libs'
34+
}
35+
externalNativeBuild {
36+
cmake {
37+
path 'src/main/cpp/CMakeLists.txt'
38+
}
39+
}
40+
}
41+
namespace 'org.libsdl.app'
42+
lint {
43+
abortOnError false
44+
}
45+
}
46+
47+
dependencies {
48+
implementation fileTree(include: ['*.jar'], dir: 'libs')
49+
}

Android/app/proguard-rules.pro

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
# Add project specific ProGuard rules here.
2+
# By default, the flags in this file are appended to flags specified
3+
# in [sdk]/tools/proguard/proguard-android.txt
4+
# You can edit the include path and order by changing the proguardFiles
5+
# directive in build.gradle.
6+
#
7+
# For more details, see
8+
# http://developer.android.com/guide/developing/tools/proguard.html
9+
10+
# Add any project specific keep options here:
11+
12+
# If your project uses WebView with JS, uncomment the following
13+
# and specify the fully qualified class name to the JavaScript interface
14+
# class:
15+
#-keepclassmembers class fqcn.of.javascript.interface.for.webview {
16+
# public *;
17+
#}
Lines changed: 104 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,104 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
3+
android:versionCode="1"
4+
android:versionName="1.0"
5+
android:installLocation="auto">
6+
7+
<uses-permission android:name="android.permission.CAMERA" />
8+
<uses-permission android:name="android.permission.INTERNET" />
9+
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
10+
11+
<uses-feature android:name="android.hardware.camera.any" />
12+
<uses-feature android:name="android.hardware.camera"
13+
android:required="true" />
14+
<uses-feature android:name="android.hardware.camera2"
15+
android:required="true"/>
16+
<uses-feature android:name="android.hardware.camera.autofocus"
17+
android:required="false" />
18+
<uses-feature android:glEsVersion="0x00020000" android:required="true" />
19+
20+
<!-- Touchscreen support -->
21+
<uses-feature
22+
android:name="android.hardware.touchscreen"
23+
android:required="false" />
24+
25+
<!-- Game controller support -->
26+
<uses-feature
27+
android:name="android.hardware.bluetooth"
28+
android:required="false" />
29+
<uses-feature
30+
android:name="android.hardware.gamepad"
31+
android:required="false" />
32+
<uses-feature
33+
android:name="android.hardware.usb.host"
34+
android:required="false" />
35+
36+
<!-- External mouse input events -->
37+
<uses-feature
38+
android:name="android.hardware.type.pc"
39+
android:required="false" />
40+
41+
<!-- Audio recording support -->
42+
<!-- if you want to capture audio, uncomment this. -->
43+
<!-- <uses-feature
44+
android:name="android.hardware.microphone"
45+
android:required="false" /> -->
46+
47+
<!-- Allow access to Bluetooth devices -->
48+
<!-- Currently this is just for Steam Controller support and requires setting SDL_HINT_JOYSTICK_HIDAPI_STEAM -->
49+
<!-- <uses-permission android:name="android.permission.BLUETOOTH" android:maxSdkVersion="30" /> -->
50+
<!-- <uses-permission android:name="android.permission.BLUETOOTH_CONNECT" /> -->
51+
52+
<!-- Allow access to the vibrator -->
53+
<uses-permission android:name="android.permission.VIBRATE" />
54+
55+
<!-- if you want to capture audio, uncomment this. -->
56+
<!-- <uses-permission android:name="android.permission.RECORD_AUDIO" /> -->
57+
58+
<!-- Create a Java class extending SDLActivity and place it in a
59+
directory under app/src/main/java matching the package, e.g. app/src/main/java/com/gamemaker/game/MyGame.java
60+
61+
then replace "SDLActivity" with the name of your class (e.g. "MyGame")
62+
in the XML below.
63+
64+
An example Java class can be found in README-android.md
65+
-->
66+
<application android:label="@string/app_name"
67+
android:icon="@mipmap/ic_launcher"
68+
android:allowBackup="true"
69+
android:theme="@android:style/Theme.NoTitleBar.Fullscreen"
70+
android:hardwareAccelerated="true" >
71+
72+
<!-- Example of setting SDL hints from AndroidManifest.xml:
73+
<meta-data android:name="SDL_ENV.SDL_ACCELEROMETER_AS_JOYSTICK" android:value="0"/>
74+
-->
75+
76+
<activity android:name="SDLActivity"
77+
android:label="@string/app_name"
78+
android:alwaysRetainTaskState="true"
79+
android:launchMode="singleInstance"
80+
android:configChanges="layoutDirection|locale|orientation|uiMode|screenLayout|screenSize|smallestScreenSize|keyboard|keyboardHidden|navigation"
81+
android:preferMinimalPostProcessing="true"
82+
android:screenOrientation="portrait"
83+
android:exported="true"
84+
>
85+
<intent-filter>
86+
<action android:name="android.intent.action.MAIN" />
87+
<category android:name="android.intent.category.LAUNCHER" />
88+
</intent-filter>
89+
<!-- Let Android know that we can handle some USB devices and should receive this event -->
90+
<intent-filter>
91+
<action android:name="android.hardware.usb.action.USB_DEVICE_ATTACHED" />
92+
</intent-filter>
93+
<!-- Drop file event -->
94+
<!--
95+
<intent-filter>
96+
<action android:name="android.intent.action.VIEW" />
97+
<category android:name="android.intent.category.DEFAULT" />
98+
<data android:mimeType="*/*" />
99+
</intent-filter>
100+
-->
101+
</activity>
102+
</application>
103+
104+
</manifest>

0 commit comments

Comments
 (0)