Fixed crashing when downloading data to SD card, fixed crashing when running SDL 1.2 app on Android 1.6 device
This commit is contained in:
@@ -135,7 +135,7 @@ class DataDownloader extends Thread
|
||||
Status.setText( "Connecting to " + Globals.DataDownloadUrl );
|
||||
outFilesDir = Parent.getFilesDir().getAbsolutePath();
|
||||
if( Globals.DownloadToSdcard )
|
||||
outFilesDir = "/sdcard/" + Globals.ApplicationName;
|
||||
outFilesDir = "/sdcard/" + Globals.class.getPackage().getName();
|
||||
this.start();
|
||||
}
|
||||
|
||||
@@ -176,22 +176,13 @@ class DataDownloader extends Thread
|
||||
}
|
||||
checkFile = null;
|
||||
|
||||
// Create output directory
|
||||
// Create output directory (not necessary for phone storage)
|
||||
if( Globals.DownloadToSdcard )
|
||||
{
|
||||
try {
|
||||
(new File( "/sdcard/" + Globals.ApplicationName )).mkdirs();
|
||||
(new File( outFilesDir )).mkdirs();
|
||||
} catch( SecurityException e ) { };
|
||||
}
|
||||
else
|
||||
{
|
||||
try {
|
||||
FileOutputStream dummy = Parent.openFileOutput( "dummy", Parent.MODE_WORLD_READABLE );
|
||||
dummy.write(0);
|
||||
dummy.flush();
|
||||
} catch( FileNotFoundException e ) {
|
||||
} catch( java.io.IOException e ) {};
|
||||
}
|
||||
|
||||
HttpResponse response = null;
|
||||
String [] downloadUrls = Globals.DataDownloadUrl.split("[|]");
|
||||
|
||||
Reference in New Issue
Block a user