summaryrefslogtreecommitdiff
path: root/tests/projects/android/native_app
diff options
context:
space:
mode:
authorYi Jianlong <[email protected]>2025-12-15 10:10:35 +0800
committerYi Jianlong <[email protected]>2025-12-15 15:54:41 +0800
commit8e63376d62415825aa2836df19ebb7c895aa7a2e (patch)
treee7383f5f288453a47c56d1228505348d25d0da4a /tests/projects/android/native_app
parent7298699afb4e2baf50978cda9b2cc8822170301b (diff)
resolve review comments
Diffstat (limited to 'tests/projects/android/native_app')
-rw-r--r--tests/projects/android/native_app/android/AndroidManifest.xml31
-rw-r--r--tests/projects/android/native_app/android/debug.jksbin0 -> 2487 bytes
-rw-r--r--tests/projects/android/native_app/android/res/mipmap-mdpi/icon.pngbin0 -> 2643 bytes
-rw-r--r--tests/projects/android/native_app/android/res/mipmap/icon.pngbin0 -> 2643 bytes
-rw-r--r--tests/projects/android/native_app/android/res/values/strings.xml4
-rw-r--r--tests/projects/android/native_app/android/res/values/styles.xml9
-rw-r--r--tests/projects/android/native_app/src/main.cpp21
-rw-r--r--tests/projects/android/native_app/xmake.lua18
8 files changed, 83 insertions, 0 deletions
diff --git a/tests/projects/android/native_app/android/AndroidManifest.xml b/tests/projects/android/native_app/android/AndroidManifest.xml
new file mode 100644
index 000000000..40cfd7066
--- /dev/null
+++ b/tests/projects/android/native_app/android/AndroidManifest.xml
@@ -0,0 +1,31 @@
+<?xml version="1.0" encoding="utf-8"?>
+<manifest xmlns:android="http://schemas.android.com/apk/res/android"
+ xmlns:tools="http://schemas.android.com/tools"
+ package="com.raylib.demo"
+
+ android:versionCode="15"
+ android:versionName="1.5">
+
+ <uses-sdk android:minSdkVersion="21" android:targetSdkVersion="30" />
+
+ <uses-permission android:name="android.permission.SET_RELEASE_APP"/>
+
+ <application
+ android:label="Fighter" android:debuggable="true" android:hasCode="false"
+ tools:replace="android:icon,android:theme,android:allowBackup,label"
+ android:icon="@mipmap/icon">
+
+ <activity android:name="android.app.NativeActivity"
+ android:label="Fighter"
+ android:configChanges="orientation|keyboardHidden|screenSize|screenLayout"
+ android:screenOrientation="portrait"
+ android:theme="@android:style/Theme.NoTitleBar.Fullscreen">
+ <meta-data android:name="android.app.lib_name"
+ android:value="main" />
+ <intent-filter>
+ <action android:name="android.intent.action.MAIN" />
+ <category android:name="android.intent.category.LAUNCHER" />
+ </intent-filter>
+ </activity>
+ </application>
+</manifest> \ No newline at end of file
diff --git a/tests/projects/android/native_app/android/debug.jks b/tests/projects/android/native_app/android/debug.jks
new file mode 100644
index 000000000..b4eb4f9f2
--- /dev/null
+++ b/tests/projects/android/native_app/android/debug.jks
Binary files differ
diff --git a/tests/projects/android/native_app/android/res/mipmap-mdpi/icon.png b/tests/projects/android/native_app/android/res/mipmap-mdpi/icon.png
new file mode 100644
index 000000000..743413831
--- /dev/null
+++ b/tests/projects/android/native_app/android/res/mipmap-mdpi/icon.png
Binary files differ
diff --git a/tests/projects/android/native_app/android/res/mipmap/icon.png b/tests/projects/android/native_app/android/res/mipmap/icon.png
new file mode 100644
index 000000000..743413831
--- /dev/null
+++ b/tests/projects/android/native_app/android/res/mipmap/icon.png
Binary files differ
diff --git a/tests/projects/android/native_app/android/res/values/strings.xml b/tests/projects/android/native_app/android/res/values/strings.xml
new file mode 100644
index 000000000..e98a18284
--- /dev/null
+++ b/tests/projects/android/native_app/android/res/values/strings.xml
@@ -0,0 +1,4 @@
+<?xml version="1.0" encoding="utf-8"?>
+<resources>
+ <string name="app_name">Space Defender</string>
+</resources> \ No newline at end of file
diff --git a/tests/projects/android/native_app/android/res/values/styles.xml b/tests/projects/android/native_app/android/res/values/styles.xml
new file mode 100644
index 000000000..621547380
--- /dev/null
+++ b/tests/projects/android/native_app/android/res/values/styles.xml
@@ -0,0 +1,9 @@
+<?xml version="1.0" encoding="utf-8"?>
+<resources>
+ <style name="AppTheme" parent="android:Theme.NoTitleBar.Fullscreen">
+ <item name="android:windowBackground">@android:color/black</item>
+ <item name="android:colorPrimary">#FF6200EE</item>
+ <item name="android:colorPrimaryDark">#FF3700B3</item>
+ <item name="android:colorAccent">#FF03DAC5</item>
+ </style>
+</resources> \ No newline at end of file
diff --git a/tests/projects/android/native_app/src/main.cpp b/tests/projects/android/native_app/src/main.cpp
new file mode 100644
index 000000000..4c8253ead
--- /dev/null
+++ b/tests/projects/android/native_app/src/main.cpp
@@ -0,0 +1,21 @@
+#include <raylib.h>
+
+int main() {
+ InitWindow(0, 0, "Hello, xmake for raylib android!");
+
+ SetTargetFPS(60);
+
+ while (!WindowShouldClose()) { // Main game loop
+ BeginDrawing();
+
+ ClearBackground(BLACK);
+
+ DrawText("Hello, xmake for raylib android!", 250, 250, 25, BLUE);
+
+ EndDrawing();
+ }
+
+ CloseWindow();
+
+ return 0;
+} \ No newline at end of file
diff --git a/tests/projects/android/native_app/xmake.lua b/tests/projects/android/native_app/xmake.lua
new file mode 100644
index 000000000..81ac545e5
--- /dev/null
+++ b/tests/projects/android/native_app/xmake.lua
@@ -0,0 +1,18 @@
+add_rules("mode.debug", "mode.release")
+
+add_requires("raylib 5.5.0")
+
+target("raydemo_android")
+ set_kind("binary")
+ set_languages("c++17")
+ add_files("src/main.cpp")
+ add_packages("raylib")
+
+ add_rules("android.native_app", {
+ android_sdk_version = "35",
+ android_manifest = "android/AndroidManifest.xml",
+ android_res = "android/res",
+ keystore = "android/debug.jks",
+ keystore_pass = "123456",
+ package_name = "com.raylib.demo"
+ })