// Load the .so static { System.loadLibrary("SDL"); // System.loadLibrary("SDL_image"); // System.loadLibrary("SDL_mixer"); // System.loadLibrary("SDL_ttf"); System.loadLibrary("main"); }
// Load the .so static { System.loadLibrary("SDL2"); System.loadLibrary("SDL2_image"); // System.loadLibrary("SDL2_mixer"); // System.loadLibrary("SDL2_net"); System.loadLibrary("SDL2_ttf"); System.loadLibrary("main"); }
// Load the .so public void loadLibraries() { for (String lib : getLibraries()) { System.loadLibrary(lib); } }
// Setup @Override protected void onCreate(Bundle savedInstanceState) { Log.v("SDL", "Device: " + android.os.Build.DEVICE); Log.v("SDL", "Model: " + android.os.Build.MODEL); Log.v("SDL", "onCreate():" + mSingleton); super.onCreate(savedInstanceState); SDLActivity.initialize(); // So we can call stuff from static callbacks mSingleton = this; // Load shared libraries String errorMsgBrokenLib = ""; try { loadLibraries(); } catch (UnsatisfiedLinkError e) { System.err.println(e.getMessage()); mBrokenLibraries = true; errorMsgBrokenLib = e.getMessage(); } catch (Exception e) { System.err.println(e.getMessage()); mBrokenLibraries = true; errorMsgBrokenLib = e.getMessage(); } if (mBrokenLibraries) { AlertDialog.Builder dlgAlert = new AlertDialog.Builder(this); dlgAlert.setMessage( "An error occurred while trying to start the application. Please try again and/or reinstall." + System.getProperty("line.separator") + System.getProperty("line.separator") + "Error: " + errorMsgBrokenLib); dlgAlert.setTitle("SDL Error"); dlgAlert.setPositiveButton( "Exit", new DialogInterface.OnClickListener() { @Override public void onClick(DialogInterface dialog, int id) { // if this button is clicked, close current activity SDLActivity.mSingleton.finish(); } }); dlgAlert.setCancelable(false); dlgAlert.create().show(); return; } // Set up the surface mSurface = new SDLSurface(getApplication()); if (Build.VERSION.SDK_INT >= 12) { mJoystickHandler = new SDLJoystickHandler_API12(); } else { mJoystickHandler = new SDLJoystickHandler(); } mLayout = new AbsoluteLayout(this); mLayout.addView(mSurface); setContentView(mLayout); }
// Load the .so static { // Urho3D: everything resides in urho3d.so System.loadLibrary("Urho3D"); }
public void forceQuit() { System.exit(0); }