Skip to content

Commit 8562088

Browse files
committed
going to tidy this up
1 parent bdf0f1b commit 8562088

File tree

8 files changed

+6
-66
lines changed

8 files changed

+6
-66
lines changed

build.zig

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
11
const std = @import("std");
22
const androidbuild = @import("src/androidbuild/androidbuild.zig");
33

4-
// Expose Android build functionality for use in your build.zig
5-
64
// TODO: rename tools.zig to Sdk.zig
75
pub const Sdk = @import("src/androidbuild/tools.zig");
86
pub const Apk = @import("src/androidbuild/apk.zig");
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
hello from android
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
hello android!

examples/minimal/build.zig

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ pub fn build(b: *std.Build) void {
2727
apk.setKeyStore(key_store_file);
2828
apk.setAndroidManifest(b.path("android/AndroidManifest.xml"));
2929
apk.addResourceDirectory(b.path("android/res"));
30+
apk.addAssetsDirectory(b.path("android/assets"));
3031

3132
// Add Java files
3233
// - If you have 'android:hasCode="false"' in your AndroidManifest.xml then no Java files are required

examples/minimal/src/android-bind.zig

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,3 @@
1-
// TODO(jae): 2024-09-19
2-
// Consider just making this import from native C libraries.
3-
// For now just wanted a basic example that compiles and runs on an Android emulator
4-
51
const __builtin_va_list = extern struct {
62
padding: u32,
73
};

examples/sdl2/android/AndroidManifest.xml

Lines changed: 2 additions & 56 deletions
Original file line numberDiff line numberDiff line change
@@ -4,22 +4,11 @@
44
android:versionName="1.0"
55
android:installLocation="auto"
66
package="com.zig.sdl2">
7-
<!--
8-
Based on:
9-
https://github.com/libsdl-org/SDL/blob/release-2.30.7/android-project/app/src/main/AndroidManifest.xml
10-
-->
11-
127
<uses-sdk android:minSdkVersion="16" android:targetSdkVersion="35" />
13-
14-
<!-- OpenGL ES 2.0 -->
158
<uses-feature android:glEsVersion="0x00020000" />
16-
17-
<!-- Touchscreen support -->
189
<uses-feature
1910
android:name="android.hardware.touchscreen"
2011
android:required="false" />
21-
22-
<!-- Game controller support -->
2312
<uses-feature
2413
android:name="android.hardware.bluetooth"
2514
android:required="false" />
@@ -29,50 +18,19 @@
2918
<uses-feature
3019
android:name="android.hardware.usb.host"
3120
android:required="false" />
32-
33-
<!-- External mouse input events -->
3421
<uses-feature
3522
android:name="android.hardware.type.pc"
3623
android:required="false" />
37-
38-
<!-- Audio recording support -->
39-
<!-- if you want to capture audio, uncomment this. -->
40-
<!-- <uses-feature
41-
android:name="android.hardware.microphone"
42-
android:required="false" /> -->
43-
44-
<!-- Allow downloading to the external storage on Android 5.1 and older -->
45-
<!-- <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" android:maxSdkVersion="22" /> -->
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 -->
24+
<uses-permission android:name="android.permission.BLUETOOTH" android:maxSdkVersion="30" />
25+
<uses-permission android:name="android.permission.BLUETOOTH_CONNECT" />
5326
<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-
-->
6627
<application android:label="@string/app_name"
6728
android:icon="@mipmap/ic_launcher"
6829
android:allowBackup="true"
6930
android:theme="@android:style/Theme.NoTitleBar.Fullscreen"
7031
android:hardwareAccelerated="true" >
7132

72-
<!-- Example of setting SDL hints from AndroidManifest.xml:
7333
<meta-data android:name="SDL_ENV.SDL_ACCELEROMETER_AS_JOYSTICK" android:value="0"/>
74-
-->
75-
7634
<activity android:name="ZigSDLActivity"
7735
android:label="@string/app_name"
7836
android:alwaysRetainTaskState="true"
@@ -85,18 +43,6 @@
8543
<action android:name="android.intent.action.MAIN" />
8644
<category android:name="android.intent.category.LAUNCHER" />
8745
</intent-filter>
88-
<!-- Let Android know that we can handle some USB devices and should receive this event -->
89-
<!-- <intent-filter>
90-
<action android:name="android.hardware.usb.action.USB_DEVICE_ATTACHED" />
91-
</intent-filter> -->
92-
<!-- Drop file event -->
93-
<!--
94-
<intent-filter>
95-
<action android:name="android.intent.action.VIEW" />
96-
<category android:name="android.intent.category.DEFAULT" />
97-
<data android:mimeType="*/*" />
98-
</intent-filter>
99-
-->
10046
</activity>
10147
</application>
10248

src/android/android.zig

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,6 @@
11
const std = @import("std");
22
const builtin = @import("builtin");
33

4-
// TODO(jae): 2024-10-03
5-
// Consider exposing this in the future
6-
// pub const builtin = android_builtin;
7-
84
const android_builtin = struct {
95
const ab = @import("android_builtin");
106

src/androidbuild/apk.zig

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -358,6 +358,7 @@ fn doInstallApk(apk: *Apk) std.mem.Allocator.Error!*Step.InstallFile {
358358
const val = dir.src_path.sub_path;
359359

360360
aapt2link.addArg(val);
361+
//aapt2link.addFileInput(dir);
361362
}
362363

363364
// Add resource files

0 commit comments

Comments
 (0)