Fixed incorrect SD card location for install paths

This commit is contained in:
pelya
2010-12-17 14:43:58 +00:00
parent 278506fd45
commit a57f8e3cb6
6 changed files with 17 additions and 11 deletions

View File

@@ -8,6 +8,7 @@ import android.view.MotionEvent;
import android.view.KeyEvent;
import android.view.Window;
import android.view.WindowManager;
import android.os.Environment;
import android.widget.TextView;
import org.apache.http.client.methods.*;
@@ -149,7 +150,7 @@ class DataDownloader extends Thread
//Status.setText( "Connecting to " + Globals.DataDownloadUrl );
outFilesDir = Parent.getFilesDir().getAbsolutePath();
if( Globals.DownloadToSdcard )
outFilesDir = "/sdcard/app-data/" + Globals.class.getPackage().getName();
outFilesDir = Environment.getExternalStorageDirectory().getAbsolutePath() + "/app-data/" + Globals.class.getPackage().getName();
DownloadComplete = false;
this.start();
}

View File

@@ -48,8 +48,6 @@ class Globals {
public static int AppTouchscreenKeyboardKeysAmountAutoFire = 1;
// Phone-specific config
// It will download app data to /sdcard/alienblaster if set to true,
// otherwise it will download it to /data/data/de.schwardtnet.alienblaster/files
public static boolean DownloadToSdcard = true;
public static boolean PhoneHasTrackball = false;
public static boolean PhoneHasArrowKeys = false;

View File

@@ -17,6 +17,7 @@ import android.view.MotionEvent;
import android.view.KeyEvent;
import android.view.Window;
import android.view.WindowManager;
import android.os.Environment;
import android.widget.TextView;
import java.lang.Thread;
@@ -211,7 +212,10 @@ class DemoRenderer extends GLSurfaceView_SDL.Renderer {
// Tweak video thread priority, if user selected big audio buffer
if(Globals.AudioBufferConfig >= 2)
Thread.currentThread().setPriority( (Thread.NORM_PRIORITY + Thread.MIN_PRIORITY) / 2 ); // Lower than normal
nativeInit(Globals.CommandLine); // Calls main() and never returns, hehe - we'll call eglSwapBuffers() from native code
nativeInit( Globals.DownloadToSdcard ?
Environment.getExternalStorageDirectory().getAbsolutePath() + "/app-data/" + Globals.class.getPackage().getName() :
context.getFilesDir().getAbsolutePath(),
Globals.CommandLine); // Calls main() and never returns, hehe - we'll call eglSwapBuffers() from native code
System.exit(0); // The main() returns here - I don't bother with deinit stuff, just terminate process
}
@@ -264,7 +268,7 @@ class DemoRenderer extends GLSurfaceView_SDL.Renderer {
};
private native void nativeInitJavaCallbacks();
private native void nativeInit(String CommandLine);
private native void nativeInit(String CurrentPath, String CommandLine);
private native void nativeResize(int w, int h, int keepAspectRatio);
private native void nativeDone();
private native void nativeGlContextLost();