mosdev's Recent Forum Activity

  • I've trouble to exec a java method by the following.

    I use the Browser.executeJavaScript from Construct2... As Function name i said: startGame();

    In Android Studio I created a Class like:

    public class GameEventsPlugin extends CordovaPlugin {

    private Context context;

    override

    public void initialize(CordovaInterface cordova, CordovaWebView webView) {

    this.context = cordova.getActivity().getApplicationContext();

    super.initialize(cordova, webView);

    }

    override

    public boolean execute(String action, JSONArray args, CallbackContext callbackContext) throws JSONException {

    if (action.equals("startGame")) {

    Toast.makeText(this.context, "App gestartet", Toast.LENGTH_LONG).show();

    }

    return true;

    }

    }

    In my activfity class I put this before loadUrl(launchUrl):

    pluginEntries.add(new PluginEntry("QM-Plugins", new GameEventsPlugin()));

    The initialize method is called, but never the execute... What is wrong?

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • I buy this plugin. All is well so far... But how I can tell Android, that i will exit the game by pressing the back button on my MainLayout? Thx

mosdev's avatar

mosdev

Member since 22 Apr, 2017

None one is following mosdev yet!

Trophy Case

  • 7-Year Club
  • Email Verified

Progress

8/44
How to earn trophies