demos: Add APK with layers to cube
authorCody Northrop <cnorthrop@google.com>
Mon, 26 Sep 2016 23:53:00 +0000 (17:53 -0600)
committerCody Northrop <cnorthrop@google.com>
Wed, 28 Sep 2016 16:36:18 +0000 (10:36 -0600)
demos/android/cube-with-layers/AndroidManifest.xml [new file with mode: 0644]
demos/android/cube-with-layers/custom_rules.xml [new file with mode: 0644]
demos/android/cube-with-layers/res/values/strings.xml [new file with mode: 0644]

diff --git a/demos/android/cube-with-layers/AndroidManifest.xml b/demos/android/cube-with-layers/AndroidManifest.xml
new file mode 100644 (file)
index 0000000..50ac927
--- /dev/null
@@ -0,0 +1,27 @@
+<?xml version="1.0"?>\r
+<manifest xmlns:android="http://schemas.android.com/apk/res/android" package="com.example.CubeWithLayers" android:versionCode="1" android:versionName="1.0">\r
+\r
+    <!-- Allow this app to read and write files (for use by tracing libraries). -->
+    <uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE"/>\r
+    <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/>\r
+    <uses-permission android:name="android.permission.INTERNET"/>
+\r
+    <!-- This is the platform API where NativeActivity was introduced. -->\r
+    <uses-sdk android:minSdkVersion="23" android:targetSdkVersion="23"/>\r
+\r
+    <!-- This .apk has no Java code itself, so set hasCode to false. -->\r
+    <application android:label="@string/app_name" android:hasCode="false" android:debuggable='true'>\r
+\r
+        <!-- Our activity is the built-in NativeActivity framework class.\r
+             This will take care of integrating with our NDK code. -->\r
+        <activity android:name="android.app.NativeActivity" android:label="@string/app_name" android:exported="true">\r
+            <!-- Tell NativeActivity the name of or .so -->\r
+            <meta-data android:name="android.app.lib_name" android:value="Cube"/>\r
+            <intent-filter>\r
+                <action android:name="android.intent.action.MAIN"/>\r
+                <category android:name="android.intent.category.LAUNCHER"/>\r
+            </intent-filter>\r
+        </activity>\r
+    </application>\r
+\r
+</manifest>\r
diff --git a/demos/android/cube-with-layers/custom_rules.xml b/demos/android/cube-with-layers/custom_rules.xml
new file mode 100644 (file)
index 0000000..ab517bf
--- /dev/null
@@ -0,0 +1,25 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project name="NativeActivity" default="help">
+
+<property name="cubeWithLayersDir" location="../libs-with-layers" />
+<property name="cubeDir" location="../libs" />
+<property name="layersDir" location="../../../build-android/libs" />
+
+<echo>CubeWithLayers: Creating libs-with-layers</echo>
+<mkdir dir="${cubeWithLayersDir}"/>
+
+<echo>CubeWithLayers: Copying libs from demos/android</echo>
+<copy todir="${cubeWithLayersDir}">
+<fileset dir="${cubeDir}"/>
+</copy>
+
+<echo>CubeWithLayers: Copying layers from build-android</echo>
+<copy todir="${cubeWithLayersDir}">
+<fileset dir="${layersDir}"/>
+</copy>
+
+<!-- Point ndk-build at the libs-with-layers common dir -->
+<echo>CubeWithLayers: Overriding native.libs.absolute.dir with ${cubeWithLayersDir}</echo>
+<property name="native.libs.absolute.dir" location="${cubeWithLayersDir}" />
+
+</project>
diff --git a/demos/android/cube-with-layers/res/values/strings.xml b/demos/android/cube-with-layers/res/values/strings.xml
new file mode 100644 (file)
index 0000000..bdf81e5
--- /dev/null
@@ -0,0 +1,24 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!-- Copyright 2013 The Android Open Source Project
+
+     Licensed under the Apache License, Version 2.0 (the "License");
+     you may not use this file except in compliance with the License.
+     You may obtain a copy of the License at
+
+          http://www.apache.org/licenses/LICENSE-2.0
+
+     Unless required by applicable law or agreed to in writing, software
+     distributed under the License is distributed on an "AS IS" BASIS,
+     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+     See the License for the specific language governing permissions and
+     limitations under the License.
+-->
+
+<!-- This file contains resource definitions for displayed strings, allowing
+     them to be changed based on the locale and options. -->
+
+<resources>
+    <!-- Simple strings. -->
+    <string name="app_name">CubeWithLayers</string>
+
+</resources>