浏览代码

Android: move to the new, suggested file layout

LouYihua 7 年之前
父节点
当前提交
59282b20a9

+ 0 - 45
android/AndroidManifest.xml

@@ -1,45 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!-- Replace org.libsdl.app with the identifier of your game below, e.g.
-     com.gamemaker.game
--->
-<manifest xmlns:android="http://schemas.android.com/apk/res/android"
-      package="io.github.sdlpal"
-      android:versionCode="2"
-      android:versionName="2.0"
-      android:installLocation="auto">
-
-    <!-- Create a Java class extending SDLActivity and place it in a
-         directory under src matching the package, e.g.
-         	src/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.txt
-    -->
-    <application android:label="@string/app_name"
-                 android:icon="@drawable/ic_launcher"
-                 android:allowBackup="true"
-                 android:theme="@android:style/Theme.NoTitleBar.Fullscreen"
-                 android:hardwareAccelerated="true" >
-        <activity android:name="PalActivity"
-                  android:label="@string/app_name"
-                  android:configChanges="keyboardHidden|orientation"
-                  android:screenOrientation="landscape"
-                  >
-            <intent-filter>
-                <action android:name="android.intent.action.MAIN" />
-                <category android:name="android.intent.category.LAUNCHER" />
-            </intent-filter>
-        </activity>
-    </application>
-
-    <!-- Android 2.3.3 -->
-    <uses-sdk android:minSdkVersion="10" android:targetSdkVersion="12" />
-
-    <!-- OpenGL ES 2.0 -->
-    <uses-feature android:glEsVersion="0x00020000" /> 
-
-    <!-- Allow writing to external storage -->
-    <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" /> 
-</manifest> 

+ 2 - 2
android/app/build.gradle

@@ -10,7 +10,7 @@ android {
         targetSdkVersion 12
         externalNativeBuild {
             ndkBuild {
-                arguments "NDK_APPLICATION_MK:=../jni/Application.mk"
+                arguments "NDK_APPLICATION_MK:=src/main/cpp/Application.mk"
                 abiFilters "armeabi-v7a", "x86"
             }
         }
@@ -24,7 +24,7 @@ android {
     }
     externalNativeBuild {
         ndkBuild {
-            path '../jni/Android.mk'
+            path 'src/main/cpp/Android.mk'
         }
     }
 

+ 0 - 1
android/app/src/main/AndroidManifest.xml

@@ -1 +0,0 @@
-../../../AndroidManifest.xml

+ 45 - 0
android/app/src/main/AndroidManifest.xml

@@ -0,0 +1,45 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!-- Replace org.libsdl.app with the identifier of your game below, e.g.
+     com.gamemaker.game
+-->
+<manifest xmlns:android="http://schemas.android.com/apk/res/android"
+      package="io.github.sdlpal"
+      android:versionCode="2"
+      android:versionName="2.0"
+      android:installLocation="auto">
+
+    <!-- Create a Java class extending SDLActivity and place it in a
+         directory under src matching the package, e.g.
+         	src/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.txt
+    -->
+    <application android:label="@string/app_name"
+                 android:icon="@drawable/ic_launcher"
+                 android:allowBackup="true"
+                 android:theme="@android:style/Theme.NoTitleBar.Fullscreen"
+                 android:hardwareAccelerated="true" >
+        <activity android:name="PalActivity"
+                  android:label="@string/app_name"
+                  android:configChanges="keyboardHidden|orientation"
+                  android:screenOrientation="landscape"
+                  >
+            <intent-filter>
+                <action android:name="android.intent.action.MAIN" />
+                <category android:name="android.intent.category.LAUNCHER" />
+            </intent-filter>
+        </activity>
+    </application>
+
+    <!-- Android 2.3.3 -->
+    <uses-sdk android:minSdkVersion="10" android:targetSdkVersion="12" />
+
+    <!-- OpenGL ES 2.0 -->
+    <uses-feature android:glEsVersion="0x00020000" /> 
+
+    <!-- Allow writing to external storage -->
+    <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" /> 
+</manifest> 

+ 1 - 1
android/jni/src/Android.mk

@@ -1,5 +1,5 @@
 NDK_LOCAL_PATH := $(call my-dir)
-SDLPAL_PATH := $(NDK_LOCAL_PATH)/../../..
+SDLPAL_PATH := $(NDK_LOCAL_PATH)/../../../../..
 SDL_PATH := $(SDLPAL_PATH)/3rd/SDL
 
 include $(SDL_PATH)/Android.mk

android/jni/Application.mk → android/app/src/main/cpp/Application.mk


android/jni/src/android_jni.cpp → android/app/src/main/cpp/android_jni.cpp


android/jni/src/android_jni.h → android/app/src/main/cpp/android_jni.h


android/jni/src/native_midi.c → android/app/src/main/cpp/native_midi.c


android/jni/src/pal_config.h → android/app/src/main/cpp/pal_config.h


+ 0 - 1
android/app/src/main/java

@@ -1 +0,0 @@
-../../../src

android/src/io/github/sdlpal/PalActivity.java → android/app/src/main/java/io/github/sdlpal/PalActivity.java


+ 1 - 0
android/app/src/main/java/org/libsdl/app/SDLActivity.java

@@ -0,0 +1 @@
+../../../../../../../../3rd/SDL/android-project/src/org/libsdl/app/SDLActivity.java

+ 0 - 1
android/app/src/main/res

@@ -1 +0,0 @@
-../../../res

android/res/drawable-hdpi/ic_launcher.png → android/app/src/main/res/drawable-hdpi/ic_launcher.png


android/res/drawable-mdpi/ic_launcher.png → android/app/src/main/res/drawable-mdpi/ic_launcher.png


android/res/drawable-xhdpi/ic_launcher.png → android/app/src/main/res/drawable-xhdpi/ic_launcher.png


android/res/drawable-xxhdpi/ic_launcher.png → android/app/src/main/res/drawable-xxhdpi/ic_launcher.png


android/res/layout/main.xml → android/app/src/main/res/layout/main.xml


android/res/values/strings.xml → android/app/src/main/res/values/strings.xml


+ 0 - 1
android/jni/Android.mk

@@ -1 +0,0 @@
-include $(call all-subdir-makefiles)

+ 0 - 1
android/src/org/libsdl/app/SDLActivity.java

@@ -1 +0,0 @@
-../../../../../3rd/SDL/android-project/src/org/libsdl/app/SDLActivity.java