Browse Source

doc: mention Android Screen Compatibility Mode firefighting.

This took me *weeks*. UGH.
pull/297/head
Vladimír Vondruš 8 years ago
parent
commit
5374aa44f7
  1. 23
      doc/platforms-android.dox
  2. 1
      src/Magnum/Platform/Test/AndroidManifest.xml

23
doc/platforms-android.dox

@ -142,8 +142,10 @@ version is:
@code{.xml-jinja} @code{.xml-jinja}
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android" package="{{ package }}" android:versionCode="1" android:versionName="1.0"> <manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="{{ package }}" android:versionCode="1" android:versionName="1.0">
<uses-feature android:glEsVersion="0x00020000" /> <uses-feature android:glEsVersion="0x00020000" />
<uses-sdk android:minSdkVersion="4" android:targetSdkVersion="11" />
<application android:label="{{ app_name }}" android:hasCode="false"> <application android:label="{{ app_name }}" android:hasCode="false">
<activity android:name="android.app.NativeActivity" android:label="{{ app_name }}"> <activity android:name="android.app.NativeActivity" android:label="{{ app_name }}">
<meta-data android:name="android.app.lib_name" android:value="{{ lib_name }}" /> <meta-data android:name="android.app.lib_name" android:value="{{ lib_name }}" />
@ -163,9 +165,22 @@ displayed in the system (so e.g. @cpp "My Application" @ce) and finally the
@cb{.jinja} {{ lib_name }} @ce is name of the library that you compiled with @cb{.jinja} {{ lib_name }} @ce is name of the library that you compiled with
CMake, which in this case would be @cpp "my-application" @ce. CMake, which in this case would be @cpp "my-application" @ce.
The @cb{.xml} <uses-feature android:glEsVersion="0x00020000" /> @ce says that The @cb{.xml} <uses-feature android:glEsVersion="0x00020000" /> @ce line says
the minimal OpenGL ES version is 2.0, change it in case you require a different that the minimal OpenGL ES version is 2.0, change it in case you require a
version. Consult [the Android developer documentation](https://developer.android.com/guide/topics/manifest/manifest-intro.html) different version.
@anchor platforms-android-apps-manifest-screen-compatibility-mode
The @cb{.xml} <uses-sdk android:minSdkVersion="4" android:targetSdkVersion="11" /> @ce
line requests the minimal and target Android SDK version. Setting the version
lower than this (or accidentally omitting this element) will enable the
[Screen Compatibility Mode](http://www.androiddocs.com/guide/practices/screen-compat-mode.html),
which doesn't report events in coordinates that match underlying framebuffer
pixel size. That is not supported by @ref Platform::AndroidApplication since
there's [no reliable way](https://stackoverflow.com/q/17481341) to get the
actual size used for events in that case.
Consult [the Android developer documentation](https://developer.android.com/guide/topics/manifest/manifest-intro.html)
for further information about the manifest file. for further information about the manifest file.
With this set up, you have two options how to build the final APK, either using With this set up, you have two options how to build the final APK, either using

1
src/Magnum/Platform/Test/AndroidManifest.xml

@ -1,6 +1,7 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android" package="cz.mosra.magnum.PlatformAndroidApplicationTest" android:versionCode="1" android:versionName="1.0"> <manifest xmlns:android="http://schemas.android.com/apk/res/android" package="cz.mosra.magnum.PlatformAndroidApplicationTest" android:versionCode="1" android:versionName="1.0">
<uses-feature android:glEsVersion="0x00020000" /> <uses-feature android:glEsVersion="0x00020000" />
<uses-sdk android:minSdkVersion="4" android:targetSdkVersion="11" />
<application android:label="AndroidApplication Test" android:hasCode="false"> <application android:label="AndroidApplication Test" android:hasCode="false">
<activity android:name="android.app.NativeActivity" android:label="AndroidApplication Test"> <activity android:name="android.app.NativeActivity" android:label="AndroidApplication Test">
<meta-data android:name="android.app.lib_name" android:value="PlatformAndroidApplicationTest" /> <meta-data android:name="android.app.lib_name" android:value="PlatformAndroidApplicationTest" />

Loading…
Cancel
Save