-
Notifications
You must be signed in to change notification settings - Fork 264
Create an Android build #459
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Draft
tophyr
wants to merge
10
commits into
DescentDevelopers:main
Choose a base branch
from
tophyr:android
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Draft
Changes from all commits
Commits
Show all changes
10 commits
Select commit
Hold shift + click to select a range
0ef140d
HogMaker as external project
Lgt2x 7d62278
Fix printf security hole
tophyr 1d18b25
Add top-level Android compile definitions, based on Linux
tophyr 4a8730a
Generate a d3-android-fullhog
tophyr 2e38c6d
Produce a module instead of an executable for Android
tophyr 23d5080
Support both GLES 3.0 and GL 3.2
tophyr 0b82fff
Add Android support
tophyr 28983f9
Extract gamedata knowledge into dedicated common methods
tophyr f992e0a
Add instructions to Gamedata Upload screen
tophyr 6f02671
Lock game to landscape mode
tophyr File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
apply plugin: 'com.android.application' | ||
|
||
repositories { | ||
mavenCentral() | ||
} | ||
|
||
android { | ||
namespace "com.descent3.droid" | ||
compileSdk 34 | ||
defaultConfig { | ||
minSdkVersion 32 | ||
targetSdkVersion 34 | ||
versionCode 1 | ||
versionName "1.0" | ||
externalNativeBuild { | ||
cmake { | ||
arguments "-DANDROID_APP_PLATFORM=android-19", "-DANDROID_STL=c++_static", "-DENABLE_LOGGER=ON" | ||
// abiFilters 'armeabi-v7a', 'arm64-v8a', 'x86', 'x86_64' | ||
abiFilters 'arm64-v8a' | ||
} | ||
} | ||
} | ||
buildTypes { | ||
release { | ||
minifyEnabled false | ||
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' | ||
} | ||
} | ||
applicationVariants.all { variant -> | ||
tasks["merge${variant.name.capitalize()}Assets"] | ||
.dependsOn("externalNativeBuild${variant.name.capitalize()}") | ||
} | ||
sourceSets { | ||
main { | ||
jniLibs.srcDir 'libs' | ||
java.srcDirs = ['src/main/java'] | ||
} | ||
} | ||
externalNativeBuild { | ||
cmake { | ||
path '../CMakeLists.txt' | ||
} | ||
} | ||
lint { | ||
abortOnError false | ||
} | ||
} | ||
|
||
dependencies { | ||
implementation fileTree(include: ['*.jar'], dir: 'libs') | ||
implementation 'org.nanohttpd:nanohttpd:2.2.0' | ||
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
# Add project specific ProGuard rules here. | ||
# By default, the flags in this file are appended to flags specified | ||
# in [sdk]/tools/proguard/proguard-android.txt | ||
# You can edit the include path and order by changing the proguardFiles | ||
# directive in build.gradle. | ||
# | ||
# For more details, see | ||
# http://developer.android.com/guide/developing/tools/proguard.html | ||
|
||
# Add any project specific keep options here: | ||
|
||
# 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 *; | ||
#} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,97 @@ | ||
<?xml version="1.0" encoding="utf-8"?><!-- Replace com.test.game with the identifier of your game below, e.g. | ||
com.gamemaker.game | ||
--> | ||
<manifest xmlns:android="http://schemas.android.com/apk/res/android" | ||
xmlns:tools="http://schemas.android.com/tools" | ||
android:installLocation="auto" | ||
android:versionCode="1" | ||
android:versionName="devel"> | ||
|
||
<!-- OpenGL ES 3.2 --> | ||
<uses-feature | ||
android:glEsVersion="0x00030002" | ||
android:required="true" /> | ||
|
||
<!-- Touchscreen support --> | ||
<uses-feature | ||
android:name="android.hardware.touchscreen" | ||
android:required="false" /> | ||
|
||
<!-- Game controller support --> | ||
<uses-feature | ||
android:name="android.hardware.bluetooth" | ||
android:required="false" /> | ||
<uses-feature | ||
android:name="android.hardware.gamepad" | ||
android:required="false" /> | ||
<uses-feature | ||
android:name="android.hardware.usb.host" | ||
android:required="false" /> | ||
|
||
<!-- External mouse input events --> | ||
<uses-feature | ||
android:name="android.hardware.type.pc" | ||
android:required="false" /> | ||
|
||
<!-- Audio recording support --> | ||
<!-- if you want to capture audio, uncomment this. --> | ||
<!-- <uses-feature | ||
android:name="android.hardware.microphone" | ||
android:required="false" /> --> | ||
<!-- <uses-permission android:name="android.permission.RECORD_AUDIO" /> --> | ||
|
||
<!-- Allow access to Bluetooth devices --> | ||
<!-- Currently this is just for Steam Controller support and requires setting SDL_HINT_JOYSTICK_HIDAPI_STEAM --> | ||
<!-- <uses-permission android:name="android.permission.BLUETOOTH" android:maxSdkVersion="30" /> --> | ||
<!-- <uses-permission android:name="android.permission.BLUETOOTH_CONNECT" /> --> | ||
|
||
<!-- Allow access to the vibrator --> | ||
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" /> | ||
<uses-permission android:name="android.permission.VIBRATE" /> | ||
<uses-permission android:name="android.permission.INTERNET" /> | ||
|
||
<!-- Create a Java class extending SDLActivity and place it in a | ||
directory under app/src/main/java matching the package, e.g. app/src/main/java/com/gamemaker/game/MyGame.java | ||
|
||
then replace "SDLActivity" with the name of your class (e.g. "MyGame") | ||
in the XML below. | ||
|
||
An example Java class can be found in README-android.md | ||
--> | ||
<application | ||
android:allowBackup="true" | ||
android:hardwareAccelerated="true" | ||
android:icon="@mipmap/ic_launcher" | ||
android:label="@string/app_name" | ||
android:theme="@style/AppTheme"> | ||
|
||
<!-- Example of setting SDL hints from AndroidManifest.xml: | ||
<meta-data android:name="SDL_ENV.SDL_ACCELEROMETER_AS_JOYSTICK" android:value="0"/> | ||
--> | ||
|
||
<activity | ||
android:name="MainActivity" | ||
android:alwaysRetainTaskState="true" | ||
android:screenOrientation="sensorLandscape" | ||
android:configChanges="layoutDirection|locale|orientation|uiMode|screenLayout|screenSize|smallestScreenSize|keyboard|keyboardHidden|navigation" | ||
android:exported="true" | ||
android:label="@string/app_name" | ||
android:launchMode="singleInstance" | ||
android:preferMinimalPostProcessing="true" | ||
tools:ignore="DiscouragedApi"> | ||
|
||
<!-- Let Android know that we can handle some USB devices and should receive this event --> | ||
<intent-filter> | ||
<action android:name="android.hardware.usb.action.USB_DEVICE_ATTACHED" /> | ||
</intent-filter> | ||
<intent-filter> | ||
<action android:name="android.intent.action.MAIN" /> | ||
<category android:name="android.intent.category.LAUNCHER" /> | ||
</intent-filter> | ||
</activity> | ||
<activity | ||
android:name="com.descent3.droid.GameDataUploadActivity" | ||
android:exported="true" /> | ||
</application> | ||
|
||
</manifest> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
.title { | ||
font-size: 24pt; | ||
text-align: center; | ||
} | ||
.dir_select { | ||
margin: 12pt; | ||
border: 2pt solid black; | ||
padding: 12pt; | ||
text-align: center; | ||
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
<html> | ||
<head><title>Not Found</title></head> | ||
<body> | ||
<h1 style="text-align: center;">Bad Request</h1> | ||
<h3 style="text-align: center;">d3.hog not found in upload</h3> | ||
</body> | ||
</html> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
<html> | ||
<head><title>Not Found</title></head> | ||
<body> | ||
<h1 style="text-align: center;">Not Found</h1> | ||
</body> | ||
</html> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
<html> | ||
<head><title>Method Not Allowed</title></head> | ||
<body> | ||
<h1 style="text-align: center;">Method Not Allowed</h1> | ||
</body> | ||
</html> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
<html> | ||
<head><title>Not Implemented</title></head> | ||
<body> | ||
<h1 style="text-align: center;">Not Implemented</h1> | ||
</body> | ||
</html> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
<html> | ||
<head> | ||
<link href="css/style.css" rel="stylesheet"/> | ||
<script src="js/jquery-3.7.1.js" type="text/javascript"></script> | ||
tophyr marked this conversation as resolved.
Show resolved
Hide resolved
|
||
<script src="js/main.js" type="text/javascript"></script> | ||
<title>Upload Game Data</title> | ||
</head> | ||
<body> | ||
<div class="title">Upload Game Data</div> | ||
<form action="" class="dir_select" enctype="multipart/form-data" method="post"> | ||
Upload Descent 3 Game Data: | ||
<input id="file" mozdirectory name="file" type="file" webkitdirectory/> | ||
<input id="submit" type="submit"/> | ||
</form> | ||
</body> | ||
</html> |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.