Android: Add simple launcher

This adds a minimal launcher activity for the android app, which does
the followings:

- Opens a file chooser to let user select a zip file
- Extracts the zip into the app's internal storage
- Launches the SDL activity
This commit is contained in:
kichikuou
2019-12-31 21:17:39 +09:00
parent e3c812da3a
commit 358ea7b1a9
6 changed files with 146 additions and 9 deletions
+7
View File
@@ -1,6 +1,7 @@
#include "common.h"
#include "fileio.h"
#include "sys/nact.h"
#include <unistd.h>
#ifdef __EMSCRIPTEN__
#include <emscripten.h>
#include <emscripten/html5.h>
@@ -14,6 +15,12 @@ SDL_Window* g_window;
int main(int argc, char *argv[])
{
#ifdef __ANDROID__
// Chdir to the internal storage path where the launcher should have placed
// game files.
chdir(SDL_AndroidGetInternalStoragePath());
#endif
SDL_Init(SDL_INIT_VIDEO);
// ウィンドウ表示