can I develop android applications using gwt?

前端 未结 7 2804
無奈伤痛
無奈伤痛 2021-02-19 23:35

(or is there a way to convert gwt apps to android apps?)

7条回答
  •  礼貌的吻别
    2021-02-19 23:49

    Here these are the steps to create android app from gwt app

    1. Compile the GWT project. Right click on the project, select Google-> GWT compile and select the project. It will take some time till it gets compiled. The new stuff is created in war directory in that GWT project
    2. Than create new Android Project let’s say GwtTest.
    3. Create libs folder if not generate automatic and paste the phonegap.jar (0.9.4 or above), I used phonegap-1.2.0.jar
    4. Add the jar file on project’s Build path
    5. Copy all generated stuff from GWTProject/war directory to GwtTest/assets directory (gtwproject, WEB-INF, css and html file)
    6. Now in android project’s MainActivity, extends DroidGap instead of Activity. Remove setContentView line and add this line: super.loadUrl(“file:///android_asset/index.html”);
    7. In Manifest.xml file add line of internet permission: uses-permission android:name=”android.permission.INTERNET”
    8. Create xml folder in res directory, put cordova.xml and config.xml file into the xml folder. Now you can run GwtTest as Android Application.

    Remember the apk that will be generated while run as android, the size of apk is around 35mb. So make sure that your android device has this enough size.

提交回复
热议问题