From e82df3c78f56972157d7429b1123115f78b53dfc Mon Sep 17 00:00:00 2001 From: pelya Date: Sun, 23 Feb 2014 20:37:49 +0200 Subject: [PATCH] Xserver - start dummy service, so OS won't kill us --- bugs.txt | 31 +++++++++++++ changeAppSettings.sh | 12 ++++- project/java/Globals.java | 1 + project/java/MainActivity.java | 29 ++++++++++++ .../xserver/AndroidAppSettings.cfg | 6 +++ todo.txt | 44 ++----------------- 6 files changed, 81 insertions(+), 42 deletions(-) diff --git a/bugs.txt b/bugs.txt index b3e5e2c64..ce13dbae9 100644 --- a/bugs.txt +++ b/bugs.txt @@ -8,3 +8,34 @@ Known bugs (see also todo.txt) - SDL_FillRect() does not work with SDL 1.2 in HW mode (and probably with SDL 1.3 too). - 32-bpp color mode does not work with SW video surface, 24-bpp and 32-bpp mode does not work with SDL_HWSURFACE. + +Requested features, might never get implemented, see todo.txt for features that are going to be implemented +=========================================================================================================== + +- Select between normal mouse input and magnifying glass/relative input automatically, based on screen size. + +- Show/hide screen controls with longpress on Text Edit button. + +- Floating on-screen joystick - initially invisible, it appears when you touch the screen, + centered on your finger, then it slides with your finger if you bump the joystick edge. + +- Export phone vibrator to SDL - interface is available in SDL 1.3. + +- Control screen brightness with SDL_SetGamma(). + +- Zoom in-out whole screen in SW mode with some SDL key or gesture, as in AndroidVNC. + +- Support of libjnigraphics (it will disable on-screen keyboard, only SW SDL screen surface supported). + This is not relevant already, as every device around is fast enough with GL. + +- GIMP: x86 architecture support. + +- GIMP: File open dialog shows error message when loading preview for JPG file. + +- UfoAI: huge huge update. + +- OpenArena: chat text input should be faster. + +- OpenArena: Shift and Ctrl keys on USB keyboard do not work for text input. + +- OpenArena: When entering with USB keyboard into chatbox, first 't' disappears. diff --git a/changeAppSettings.sh b/changeAppSettings.sh index c6547e6a7..2a239590f 100755 --- a/changeAppSettings.sh +++ b/changeAppSettings.sh @@ -809,6 +809,9 @@ echo >> AndroidAppSettings.cfg echo "# Do not allow device to sleep when the application is in foreground, set this for video players or apps which use accelerometer" >> AndroidAppSettings.cfg echo InhibitSuspend=$InhibitSuspend >> AndroidAppSettings.cfg echo >> AndroidAppSettings.cfg +echo "# Create Android service, so the app is less likely to be killed while in background" >> AndroidAppSettings.cfg +echo CreateService=$CreateService >> AndroidAppSettings.cfg +echo >> AndroidAppSettings.cfg echo "# Video color depth - 16 BPP is the fastest and supported for all modes, 24 bpp is supported only" >> AndroidAppSettings.cfg echo "# with SwVideoMode=y, SDL_OPENGL mode supports everything. (16)/(24)/(32)" >> AndroidAppSettings.cfg echo VideoDepthBpp=$VideoDepthBpp >> AndroidAppSettings.cfg @@ -964,7 +967,7 @@ echo FirstStartMenuOptions=\'$FirstStartMenuOptions\' >> AndroidAppSettings.cfg echo >> AndroidAppSettings.cfg echo "# Enable multi-ABI binary, with hardware FPU support - it will also work on old devices," >> AndroidAppSettings.cfg echo "# but .apk size is 2x bigger (y) / (n) / (x86) / (all)" >> AndroidAppSettings.cfg -echo MultiABI=$MultiABI >> AndroidAppSettings.cfg +echo MultiABI=\'$MultiABI\' >> AndroidAppSettings.cfg echo >> AndroidAppSettings.cfg echo "# Minimum amount of RAM application requires, in Mb, SDL will print warning to user if it's lower" >> AndroidAppSettings.cfg echo AppMinimumRAM=$AppMinimumRAM >> AndroidAppSettings.cfg @@ -1052,6 +1055,12 @@ else InhibitSuspend=false fi +if [ "$CreateService" = "y" ] ; then + CreateService=true +else + CreateService=false +fi + if [ "$NeedDepthBuffer" = "y" ] ; then NeedDepthBuffer=true else @@ -1374,6 +1383,7 @@ $SEDI "s/public static boolean CompatibilityHacksTextInputEmulatesHwKeyboard = . $SEDI "s/public static boolean HorizontalOrientation = .*;/public static boolean HorizontalOrientation = $HorizontalOrientation;/" project/src/Globals.java $SEDI "s^public static boolean KeepAspectRatioDefaultSetting = .*^public static boolean KeepAspectRatioDefaultSetting = $SdlVideoResizeKeepAspect;^" project/src/Globals.java $SEDI "s/public static boolean InhibitSuspend = .*;/public static boolean InhibitSuspend = $InhibitSuspend;/" project/src/Globals.java +$SEDI "s/public static boolean CreateService = .*;/public static boolean CreateService = $CreateService;/" project/src/Globals.java $SEDI "s/public static boolean AppUsesMouse = .*;/public static boolean AppUsesMouse = $AppUsesMouse;/" project/src/Globals.java $SEDI "s/public static boolean AppNeedsTwoButtonMouse = .*;/public static boolean AppNeedsTwoButtonMouse = $AppNeedsTwoButtonMouse;/" project/src/Globals.java $SEDI "s/public static boolean ForceRelativeMouseMode = .*;/public static boolean ForceRelativeMouseMode = $ForceRelativeMouseMode;/" project/src/Globals.java diff --git a/project/java/Globals.java b/project/java/Globals.java index bb81fcd4c..05c8f035e 100644 --- a/project/java/Globals.java +++ b/project/java/Globals.java @@ -46,6 +46,7 @@ class Globals public static boolean HorizontalOrientation = true; public static boolean KeepAspectRatioDefaultSetting = false; public static boolean InhibitSuspend = false; + public static boolean CreateService = false; public static String ReadmeText = "^You may press \"Home\" now - the data will be downloaded in background".replace("^","\n"); public static String CommandLine = ""; public static boolean AppUsesMouse = false; diff --git a/project/java/MainActivity.java b/project/java/MainActivity.java index b0bb32062..ed8a72a70 100644 --- a/project/java/MainActivity.java +++ b/project/java/MainActivity.java @@ -22,8 +22,10 @@ freely, subject to the following restrictions: package net.sourceforge.clonekeenplus; import android.app.Activity; +import android.app.Service; import android.content.Context; import android.os.Bundle; +import android.os.IBinder; import android.view.MotionEvent; import android.view.KeyEvent; import android.view.Window; @@ -212,6 +214,11 @@ public class MainActivity extends Activity } }; (new Thread(new Callback(this))).start(); + if( Globals.CreateService ) + { + Intent intent = new Intent(this, DummyService.class); + startService(intent); + } } public void setUpStatusLabel() @@ -1275,3 +1282,25 @@ abstract class SetLayerType } } } + +class DummyService extends Service +{ + public DummyService() + { + super(); + } + @Override + public int onStartCommand(Intent intent, int flags, int startId) + { + return Service.START_STICKY; + } + @Override + public void onDestroy() + { + } + @Override + public IBinder onBind(Intent intent) + { + return null; + } +} diff --git a/project/jni/application/xserver/AndroidAppSettings.cfg b/project/jni/application/xserver/AndroidAppSettings.cfg index 087240d6c..fbfb123da 100644 --- a/project/jni/application/xserver/AndroidAppSettings.cfg +++ b/project/jni/application/xserver/AndroidAppSettings.cfg @@ -39,6 +39,9 @@ ScreenOrientation=h # Do not allow device to sleep when the application is in foreground, set this for video players or apps which use accelerometer InhibitSuspend=n +# Create Android service, so the app is less likely to be killed while in background +CreateService=y + # Video color depth - 16 BPP is the fastest and supported for all modes, 24 bpp is supported only # with SwVideoMode=y, SDL_OPENGL mode supports everything. (16)/(24)/(32) VideoDepthBpp=16 @@ -137,6 +140,9 @@ AppRecordsAudio=n # Application needs to access SD card. If your data files are bigger than 5 Mb, enable it. (y) / (n) AccessSdCard= +# Application needs Internet access. If you disable it, you'll have to bundle all your data files inside .apk (y) / (n) +AccessInternet=y + # Immersive mode - Android will hide on-screen Home/Back keys. Looks bad if you invoke Android keyboard. (y) / (n) ImmersiveMode=y diff --git a/todo.txt b/todo.txt index 2ae3a878c..75ddd46ce 100644 --- a/todo.txt +++ b/todo.txt @@ -1,49 +1,10 @@ -Requested features, might never get implemented -=============================================== - -- Select between normal mouse input and magnifying glass/relative input automatically, based on screen size. - -- Show/hide screen controls with longpress on Text Edit button. - -- Floating on-screen joystick - initially invisible, it appears when you touch the screen, - centered on your finger, then it slides with your finger if you bump the joystick edge. - -- Export phone vibrator to SDL - interface is available in SDL 1.3. - -- Control screen brightness with SDL_SetGamma(). - -- Zoom in-out whole screen in SW mode with some SDL key or gesture, as in AndroidVNC. - -- Support of libjnigraphics (it will disable on-screen keyboard, only SW SDL screen surface supported). - This is not relevant already, as every device around is fast enough with GL. - -- GIMP: x86 architecture support. - -- UfoAI: huge huge update. - -- OpenArena: chat text input should be faster. - -- OpenArena: Shift and Ctrl keys on USB keyboard do not work for text input. - -- OpenArena: When entering with USB keyboard into chatbox, first 't' disappears. - TODO, which will get actually done ================================== -- SDL: option to filter finger hover jitter. - -- XSDL: Android clipboard support. - -- XSDL: create a service, so we'll never be killed. - - SDL: Send right mouse click when releasing two fingers, add mouse wheel event when dragging two fingers. -- OpenArena: do not treat commands starting with / as chat text. - - GIMP: Ctrl/Alt/Shift toggles in the taskbar. -- GIMP: File open dialog shows error message when loading preview for JPG file. - - SuperTux: Update, enable OpenGL renderer, add touchscreen jump helper, add gamepad support. - TeeWorlds: infinite loop while trying to enter chat text. @@ -52,7 +13,8 @@ TODO, which will get actually done - TeeWorlds: Three on-screen joysticks MWAHAHA. -- SDL: cloud save support. - - OpenArena: navigate game menu with analog joystick. +- OpenArena: do not treat commands starting with / as chat text. + +- SDL: cloud save support.