1
1
package org .renpy .android ;
2
2
3
+ import org .libsdl .app .SDLActivity ;
4
+
5
+ public class PythonActivity extends SDLActivity {
6
+ }
7
+
8
+ /**
3
9
import android.app.Activity;
4
10
import android.content.Intent;
5
11
import android.content.ActivityNotFoundException;
49
55
public class PythonActivity extends Activity implements Runnable {
50
56
private static String TAG = "Python";
51
57
52
- // The audio thread for streaming audio...
53
- private static AudioThread mAudioThread = null ;
54
-
55
58
// The SDLSurfaceView we contain.
56
59
public static SDLSurfaceView mView = null;
57
60
public static PythonActivity mActivity = null;
@@ -150,10 +153,6 @@ protected void onCreate(Bundle savedInstanceState) {
150
153
setContentView(mView);
151
154
}
152
155
153
- /**
154
- * Show an error using a toast. (Only makes sense from non-UI
155
- * threads.)
156
- */
157
156
public void toastError(final String msg) {
158
157
159
158
final Activity thisActivity = this;
@@ -183,10 +182,6 @@ public void recursiveDelete(File f) {
183
182
}
184
183
185
184
186
- /**
187
- * This determines if unpacking one the zip files included in
188
- * the .apk is necessary. If it is, the zip file is unpacked.
189
- */
190
185
public void unpackData(final String resource, File target) {
191
186
192
187
// The version of data in memory and on disk.
@@ -245,13 +240,13 @@ public void run() {
245
240
unpackData("private", getFilesDir());
246
241
unpackData("public", externalStorage);
247
242
248
- System .loadLibrary ("sdl " );
249
- System .loadLibrary ("sdl_image " );
250
- System .loadLibrary ("sdl_ttf " );
251
- System .loadLibrary ("sdl_mixer " );
243
+ System.loadLibrary("SDL2 ");
244
+ System.loadLibrary("SDL2_image ");
245
+ System.loadLibrary("SDL2_ttf ");
246
+ System.loadLibrary("SDL2_mixer ");
252
247
System.loadLibrary("python2.7");
253
248
System.loadLibrary("application");
254
- System .loadLibrary ("sdl_main" );
249
+ // System.loadLibrary("sdl_main");
255
250
256
251
System.load(getFilesDir() + "/lib/python2.7/lib-dynload/_io.so");
257
252
System.load(getFilesDir() + "/lib/python2.7/lib-dynload/unicodedata.so");
@@ -269,11 +264,6 @@ public void run() {
269
264
} catch(UnsatisfiedLinkError e) {
270
265
}
271
266
272
- if ( mAudioThread == null ) {
273
- Log .i ("python" , "Starting audio thread" );
274
- mAudioThread = new AudioThread (this );
275
- }
276
-
277
267
runOnUiThread(new Runnable () {
278
268
public void run() {
279
269
mView.start();
@@ -501,13 +491,6 @@ public void onRestoreTransactionsResponse(RestoreTransactions request,
501
491
}
502
492
}
503
493
504
- /**
505
- * If the database has not been initialized, we send a
506
- * RESTORE_TRANSACTIONS request to Android Market to get the list of purchased items
507
- * for this user. This happens if the application has just been installed
508
- * or the user wiped data. We do not want to do this on every startup, rather, we want to do
509
- * only when the database needs to be initialized.
510
- */
511
494
private void restoreDatabase() {
512
495
SharedPreferences prefs = getPreferences(MODE_PRIVATE);
513
496
boolean initialized = prefs.getBoolean(DB_INITIALIZED, false);
@@ -516,8 +499,6 @@ private void restoreDatabase() {
516
499
}
517
500
}
518
501
519
- /** An array of product list entries for the products that can be purchased. */
520
-
521
502
private enum Managed { MANAGED, UNMANAGED, SUBSCRIPTION }
522
503
523
504
@@ -622,4 +603,4 @@ static String billingGetPendingMessage() {
622
603
}
623
604
624
605
}
625
-
606
+ **/
0 commit comments