diff --git a/README.md b/README.md index 128a175..b13dbe5 100644 --- a/README.md +++ b/README.md @@ -1,35 +1,51 @@ -![Game.apk](app/src/main/res/mipmap-xxxhdpi/app_icon.png) -[![Donate](https://img.shields.io/badge/Donate-PayPal-green.svg)](https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=H55F9KTF8JWBS) -## What is the MV Android Client - -The MV Android Client is a runtime client for the [Android™ operating system](https://www.android.com) intended to play games created with the [RPG Maker MV](http://www.rpgmakerweb.com) game development tool-kit. - -This client can be used to deploy your game as an Android APK package for distribution. - -## How to get MV Android Client - -The latest (master branch) of the client can be downloaded via this URL: -https://github.com/AltimitSystems/mv-android-client/zipball/master - -## Tutorial & Usage Support - -A tutorial is hosted at HBGames.org at the following URL: -[hbgames.org/forums/viewtopic.php?f=48&t=79391](http://www.hbgames.org/forums/viewtopic.php?f=48&t=79391) - -Usage support is provided with this tutorial. - -You are free to provide a translation of this tutorial with the condition that you link back to this repository and the original English translation hosted at HBGames.org. - -## Bugs, issues and enhancements - -Please create reports for bugs related to the project at [GitHub issues](https://github.com/AltimitSystems/mv-android-client/issues) -Suggestions and other forms of feedback and concerns can either be posted as a GitHub issue or in the HBGames.org tutorial thread. - -## License - -The MV Android Client is under the [Apache License 2.0](https://github.com/AltimitSystems/mv-android-client/blob/master/LICENSE). - -## Contributing - -Please read the [contributing guide](https://github.com/AltimitSystems/mv-android-client/blob/master/CONTRIBUTING.md) and send pull requests to [https://github.com/AltimitSystems/mv-android-client](https://github.com/AltimitSystems/mv-android-client). +![Game.apk](app/src/main/res/mipmap-xxxhdpi/app_icon.png) +[![Donate](https://img.shields.io/badge/Donate-PayPal-green.svg)](https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=H55F9KTF8JWBS) + +## What is the MV Android Client + +The MV Android Client is a runtime client for the [Android™ operating system](https://www.android.com) intended to play games created with the [RPG Maker MV](http://www.rpgmakerweb.com) game development tool-kit. + +This client can be used to deploy your game as an Android APK package for distribution. + +## How to get MV Android Client + +The latest (master branch) of the client can be downloaded via this URL: +https://github.com/AltimitSystems/mv-android-client/zipball/master + +## Tutorial & Usage Support + +A tutorial is hosted at HBGames.org at the following URL: +[hbgames.org/forums/viewtopic.php?f=48&t=79391](http://www.hbgames.org/forums/viewtopic.php?f=48&t=79391) + +Usage support is provided with this tutorial. + +You are free to provide a translation of this tutorial with the condition that you link back to this repository and the original English translation hosted at HBGames.org. + +## Triggering Events on Android + +You can now trigger events on Android devices to show an ad (interstitial or other) or perform another action (solicit a review, share, etc.) To trigger these events, add a custom script to your Event like the following: + +``` +if(typeof boot !== 'undefined'){ + boot.triggerEvent("ad_interstitial") +} +``` + +Where "ad_interstitial" can be any event you want to handle. And then edit the following method in WebPlayerActivity.Bootstrapper to perform your actions: +``` +public void onTriggerEvent(String type) +``` + +## Bugs, issues and enhancements + +Please create reports for bugs related to the project at [GitHub issues](https://github.com/AltimitSystems/mv-android-client/issues) +Suggestions and other forms of feedback and concerns can either be posted as a GitHub issue or in the HBGames.org tutorial thread. + +## License + +The MV Android Client is under the [Apache License 2.0](https://github.com/AltimitSystems/mv-android-client/blob/master/LICENSE). + +## Contributing + +Please read the [contributing guide](https://github.com/AltimitSystems/mv-android-client/blob/master/CONTRIBUTING.md) and send pull requests to [https://github.com/AltimitSystems/mv-android-client](https://github.com/AltimitSystems/mv-android-client). \ No newline at end of file diff --git a/app/src/main/java/systems/altimit/rpgmakermv/WebPlayerActivity.java b/app/src/main/java/systems/altimit/rpgmakermv/WebPlayerActivity.java index d7dc1bb..eb0092a 100644 --- a/app/src/main/java/systems/altimit/rpgmakermv/WebPlayerActivity.java +++ b/app/src/main/java/systems/altimit/rpgmakermv/WebPlayerActivity.java @@ -26,6 +26,8 @@ import android.support.v7.app.AlertDialog; import android.util.Base64; import android.view.View; +import android.webkit.WebView; +import android.widget.Toast; import java.io.File; import java.nio.charset.Charset; @@ -45,6 +47,13 @@ public class WebPlayerActivity extends Activity { @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); + + if(BuildConfig.DEBUG){ + if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT) { + WebView.setWebContentsDebuggingEnabled(true); + } + } + if (BuildConfig.BACK_BUTTON_QUITS) { createQuitDialog(); } @@ -233,9 +242,23 @@ protected void onPrepare(boolean webgl, boolean webaudio, boolean showfps) { mPlayer.post(this); } + @Override + public void onTriggerEvent(String type) { + //these events can be any type, in this case we're just showing an AlertDialog, but it could be an ad + if(mPlayer.getContext() instanceof Activity) { + new AlertDialog.Builder(mPlayer.getContext()) + .setTitle("Event") + .setMessage("Here's where I'd trigger an event of type: " + type) + .setPositiveButton(android.R.string.ok, null) + .show(); + }else{ + Toast.makeText(mPlayer.getContext(), "Here's where I'd trigger an event of type: " + type, Toast.LENGTH_SHORT); + } + } + @Override public void run() { - mPlayer.removeJavascriptInterface(INTERFACE); + //mPlayer.removeJavascriptInterface(INTERFACE); mPlayer.loadUrl(mURIBuilder.build().toString()); } diff --git a/app/src/main/res/values/values_internal.xml b/app/src/main/res/values/values_internal.xml index fb86dfe..a1ae7b9 100644 --- a/app/src/main/res/values/values_internal.xml +++ b/app/src/main/res/values/values_internal.xml @@ -33,12 +33,7 @@ - PCFET0NUWVBFIGh0bWw+CjxodG1sPgo8aGVhZD4KPG1ldGEgY2hhcnNldD1VVEYtOD4KPHN0eWxlPmJvZHl7YmFja2dy - b3VuZC1jb2xvcjpibGFja30jY29weXJpZ2h0e3Bvc2l0aW9uOmZpeGVkO2JvdHRvbTowO3JpZ2h0OjA7Y29sb3I6d2hp - dGU7Zm9udC1mYW1pbHk6Q29uc29sYXMsTW9uYWNvLEx1Y2lkYSBDb25zb2xlLExpYmVyYXRpb24gTW9ubyxEZWphVnUg - U2FucyBNb25vLEJpdHN0cmVhbSBWZXJhIFNhbnMgTW9ubyxDb3VyaWVyIE5ldyxtb25vc3BhY2V9PC9zdHlsZT4KPC9o - ZWFkPgo8Ym9keSBvbmxvYWQ9Ym9vdC5zdGFydCgpPgo8ZGl2IGlkPWNvcHlyaWdodD4mIzE2OTsgJiM5MjM7TFRJTUlU - IENPTU1VTklUWSBDT05UUklCVVRPUlM8L2Rpdj4KPC9ib2R5Pgo8L2h0bWw+ + PCFET0NUWVBFIGh0bWw+CjxodG1sPgo8aGVhZD4KPG1ldGEgY2hhcnNldD1VVEYtOD4KPC9oZWFkPgo8Ym9keSBvbmxvYWQ9Ym9vdC5zdGFydCgpPgo8L2JvZHk+CjwvaHRtbD4=