PHP Certified Java Professional Certified Java EE Web Component Developer OMG Certified UML Professional • MBA (cum laude) from Tel-Aviv University Information Systems Management LifeMichael.com
include code written in a native programming language and code written in JavaScript that uses various client side web technologies. LifeMichael.com Device Display Web Browser Object
that functions as a web browser. • WebView extends View. We can treat the object as any other view. • As of Android 4.4, WebView is based on the Chromium open source project. LifeMichael.com
WebView object we will get a WebSettings object through which we can configure the behavior of our WebView. … WebView ob; … WebSettings settings = ob.getSettings(); settings.setJavaScriptEnabled(true); settings.setDatabaseEnabled(true); … LifeMichael.com
WebView object we can set our own implementation for WebViewClient class. … WebView ob; … ob.setWebViewClient(new WebViewClient() { public void shouldOverrideUrlLoading(WebView view, String url){ ob.loadUrl(… ); } }); … LifeMichael.com
WebView object we can set our own implementation for WebChromeClient class. • We can set a specific behavior to take place when things related to the browser UI happen (e.g. progress updates and JavaScript alerts). … WebView ob; … ob.setWebChromeClient(new WebChromeClient() { public void onProgressChanged(WebView view, String url){ … } }); … LifeMichael.com
developed using SenchaTouch at http://dev.sencha.com/deploy/touch/examples/ • You can find samples for hybrid applications developed using jQueryMobile at http://www.jqmgallery.com LifeMichael.com
in Java we want to allow their execution from code written in JavaScript with the @android.webkit.JavascriptInterface annotation. LifeMichael.com class CalculateObject { @android.webkit.JavascriptInterface public int calculateSum(int numA, int numB) { return numA + numB; } }
passing over a string that starts with “javascript:” in order to invoke a specific function in JavaScript. webView.loadUrl("javascript:increment()"); LifeMichael.com
the device's back button he is taken to the previous activity. • We can override this normal behavior by overriding the onBackPresses() function, that was defined in Activity. … public onBackPresses() { webView.loadUrl(…); }
URL link displayed inside the web view the user will be forwarded to the web browser. • We can set a different behavior by setting our own implementation for WebViewClient. ob.setWebViewClient(new WebViewClient() { public void shouldOverrideUrlLoading ( WebView view, String url) { view.loadUrl(… ); } });
DevTools debugger for debugging the code in JavaScript running inside the WebView. • We should call the setWebContentDebuggingEnabled static method (defined in WebView) passing over true in order to enable the debugging. WebView.setWebContentDebuggingEnabled(true); • We should open Chrome web browser and browse at the following URL address: chrome://inspect/#devices
development of hybrid applications for mobile platforms. • The PhoneGap framework includes two parts. The JavaScript library that includes the definition of functions that allow using the platform native capabilities. The native code developed specifically separately for each and every mobile platform. LifeMichael.com
is different for each and every platform. It includes invocation of functions that belong to the native part. • You can find detailed documentation for PhoneGap capabilities at http://docs.phonegap.com. LifeMichael.com
Android M) is a customized window of Google Chrome shown on top of the active application. • The chrome custom tabs provide both the user and the developer with chrome's rendering capabilities, saved passwords, auto-fill from the keyboard, and all of Chrome's security features. LifeMichael.com
application we can use the chrome custom tabs instead of using a web view object. • Using a chrome custom tab we can customize its look & feel, set a different color for the tool bar, add animation to the transition from the application to the chrome custom tab and add custom actions to the tab's tool bar. LifeMichael.com
can pre-start the chrome web browser and pre-fetch content in order to allow faster loading. • The chrome custom tab will usually fit when we want to take the user to a URL address that is not ours and in those cases in which we want to integrate between our application for Chrome OS and our application for android. LifeMichael.com
for using google chrome custom tabs, published by Google at https://developer.chrome.com/multidevice/android/customtabs You can find the pinterest's demo for using chrome custom tabs at https://youtu.be/7V-fIGMDsmE?t=15m35s
can find the free online course PhoneGap Basics at http://abelski.lifemichael.com • The following recommended textbooks focus on the PhoneGap open source framework: LifeMichael.com
the http://developer.android.com website. • Tutorial for learning how to use the chrome custom tabs at https://developer.chrome.com/multidevice/android/customta bs LifeMichael.com