android-project/app/src/main/AndroidManifest.xml
author Sam Lantinga <slouken@libsdl.org>
Tue, 24 Oct 2017 00:17:07 -0700
changeset 11653 4130b92b6be4
parent 11650 e7ea7ca30199
child 11667 22aa48874257
permissions -rw-r--r--
Added the ability to set SDL hints from AndroidManifest.xml (thanks Rachel!)
This is especially useful for things like the accelerometer hint which could be needed before application main().
     1 <?xml version="1.0" encoding="utf-8"?>
     2 <!-- Replace com.test.game with the identifier of your game below, e.g.
     3      com.gamemaker.game
     4 -->
     5 <manifest xmlns:android="http://schemas.android.com/apk/res/android"
     6     package="org.libsdl.app"
     7     android:versionCode="1"
     8     android:versionName="1.0"
     9     android:installLocation="auto">
    10 
    11     <!-- Example of setting SDL hints from AndroidManifest.xml:
    12     <meta-data android:value="0" android:name="SDL_ENV.SDL_ACCELEROMETER_AS_JOYSTICK"/>
    13      -->
    14      
    15     <!-- Android 4.0.1 -->
    16     <uses-sdk android:minSdkVersion="14" android:targetSdkVersion="16" />
    17 
    18     <!-- OpenGL ES 2.0 -->
    19     <uses-feature android:glEsVersion="0x00020000" />
    20 
    21     <!-- Allow writing to external storage -->
    22     <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
    23     <!-- Allow access to the vibrator -->
    24     <uses-permission android:name="android.permission.VIBRATE" />
    25 
    26     <!-- if you want to capture audio, uncomment this. -->
    27     <!-- <uses-permission android:name="android.permission.RECORD_AUDIO" /> -->
    28 
    29     <!-- Create a Java class extending SDLActivity and place it in a
    30          directory under app/src/main/java matching the package, e.g. app/src/main/java/com/gamemaker/game/MyGame.java
    31  
    32          then replace "SDLActivity" with the name of your class (e.g. "MyGame")
    33          in the XML below.
    34 
    35          An example Java class can be found in README-android.md
    36     -->
    37     <application android:label="@string/app_name"
    38         android:icon="@mipmap/ic_launcher"
    39         android:allowBackup="true"
    40         android:theme="@android:style/Theme.NoTitleBar.Fullscreen"
    41         android:hardwareAccelerated="true" >
    42         <activity android:name="SDLActivity"
    43             android:label="@string/app_name"
    44             android:configChanges="keyboardHidden|orientation|screenSize"
    45             >
    46             <intent-filter>
    47                 <action android:name="android.intent.action.MAIN" />
    48                 <category android:name="android.intent.category.LAUNCHER" />
    49             </intent-filter>
    50             <!-- Drop file event -->
    51             <!--
    52             <intent-filter>
    53                 <action android:name="android.intent.action.VIEW" />
    54                 <category android:name="android.intent.category.DEFAULT" />
    55                 <data android:mimeType="*/*" />
    56             </intent-filter>
    57             -->
    58         </activity>
    59     </application>
    60 
    61 </manifest>