SDL: request Marshmallow SD card runtime permission using SDL_ANDROID_RequestExternalStorageRuntimePermission()

This commit is contained in:
pelya
2016-06-27 01:11:18 +03:00
parent 58558aa892
commit 7e032dd40a
8 changed files with 52 additions and 2 deletions

View File

@@ -170,7 +170,7 @@ AppUsesMultitouch=y
AppRecordsAudio=n
# Application needs to access SD card. If your data files are bigger than 5 Mb, enable it. (y) / (n)
AccessSdCard=
AccessSdCard=y
# Application needs Internet access. If you disable it, you'll have to bundle all your data files inside .apk (y) / (n)
AccessInternet=

View File

@@ -18,6 +18,7 @@
#include <SDL/SDL.h>
#include <SDL/SDL_image.h>
#include <SDL/SDL_screenkeyboard.h>
#include <SDL/SDL_android.h>
#define fprintf(X, ...) __android_log_print(ANDROID_LOG_INFO, "Ballfield", __VA_ARGS__)
#define printf(...) __android_log_print(ANDROID_LOG_INFO, "Ballfield", __VA_ARGS__)
@@ -686,7 +687,10 @@ int main(int argc, char* argv[])
if(evt.key.keysym.sym == SDLK_0)
SDL_ANDROID_SetScreenKeyboardButtonShown(SDL_ANDROID_SCREENKEYBOARD_BUTTON_2, 1);
if(evt.key.keysym.sym == SDLK_1)
{
SDL_ANDROID_SetScreenKeyboardButtonShown(SDL_ANDROID_SCREENKEYBOARD_BUTTON_2, 0);
SDL_ANDROID_RequestExternalStorageRuntimePermission();
}
if(evt.key.keysym.sym == SDLK_2)
{
SDL_ANDROID_SetScreenKeyboardButtonShown(SDL_ANDROID_SCREENKEYBOARD_BUTTON_DPAD, 1);

View File

@@ -64,7 +64,7 @@ SdlVideoResize=y
SdlVideoResizeKeepAspect=n
# Do not allow device to sleep when the application is in foreground, set this for video players or apps which use accelerometer
InhibitSuspend=n
InhibitSuspend=y
# Create Android service, so the app is less likely to be killed while in background
CreateService=