following commands can be used for build, run and test on device.. Echo Clean Project call gradle clean Echo Build Project call gradle assembleRelease Echo Install APK and Run Android Tests call gradle connectedAndroidTest
//Add interface to webview webView.addJavascriptInterface( new WebAppInterface(getApplicationContext()), "Android" ); class WebAppInterface { Context mContext ; /** * Instantiate the interface and set the context */ WebAppInterface(Context c) { mContext = c; } /** * Show a toast from the web page */ @JavascriptInterface public void showToast(String toast) { Toast. makeText ( mContext , toast, Toast. LENGTH_SHORT ).show(); } //Create a toast / event in JavaScript <input type="button" value="Say hello" onClick="showAndroidToast('Hello Android!')" /> <script type="text/javascript"> function showAndroidToast(toast) { Android.showToast(toast); } </script>
using apktool, following command will give the resources as well.
ReplyDeleteapktool.bat d *.apk