JavaFX: Webview

This entry is part 50 of 55 in the series JavaFX

You have heard of phonegap where you can develop your App in HTML/Javascript and publish it in Apple App store?  This is also called the non native App and judging from the trend, it seems to be getting more and more popular.

The single piece of module that makes it work is the Web View engine found in Java and Objective-C.

Consider the example below.  If my site snapwhere.com is coded in Javascript/HTML, I can have it run on top of Java using just a few lines of code.

package webviewsample;

import javafx.application.Application;
import javafx.scene.Scene;
import javafx.scene.web.WebEngine;
import javafx.scene.web.WebView;
import javafx.stage.Stage;

public class WebViewSample extends Application {

    @Override
    public void start(Stage stage) {

        stage.setTitle("Snapwhere.com");
        WebView view = new WebView();
        WebEngine engine = view.getEngine();
        engine.load("http://www.snapwhere.com");
        Scene scene = new Scene(view, 400, 600);
        stage.setScene(scene);
        stage.show();
    }

    public static void main(String[] args) {
        launch(args);
    }
}

webview1

 

jQuery Mobile: Introduction

This entry is part 2 of 73 in the series jQuery Mobile

jQuery Mobile is a touch-optimized Web Framework.

It is a HTML5-based user interface system designed to make responsive web sites and apps that are accessible on all smartphone, tablet and desktop devices.

If you have an Android phone or tablet and have like to play around with a jQuery Mobile App, you could download a Chinese Language learning app and play around with it to get a feel of what jQuery Mobile could do.

With jQuery mobile, designing the user interface becomes really easy.

jQuery Mobile: Mobile App Development

This entry is part 1 of 73 in the series jQuery Mobile

If you are new to app development, you might be surprised to learn that it is possible to develop touch based app using HTML5.

Apps developed using HTML5 are the so called non-native app as it actually depends on webview to display the web pages.

Webview is part of the Android or iOS class activity. All that webview does is actually to display a web page.

For an app to access the native tools such as camera or GPS built inside a phone or tablet, most people would rely on phonegap, a framework that allow developers to wrap the app for running in Android or iPhone.

So in a way, you could say Javascript + HTML5 + phonegap = Mobile Apps.