1 / 39

Java Mobile Apps with GWT & PhoneGap

Java Mobile Apps with GWT & PhoneGap. Josh Marinacci, webOS Developer Advocate. overview. the problem what are gwt & phone gap building an app device apis fun stuff!. josh: java ninja. Open Source Project Founder. Swing, JavaFX, JavaStore. JavaScript. the problem.

ulla
Download Presentation

Java Mobile Apps with GWT & PhoneGap

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Java Mobile Apps with GWT & PhoneGap • Josh Marinacci, webOS Developer Advocate

  2. overview • the problem • what are gwt & phone gap • building an app • device apis • fun stuff!

  3. josh: java ninja

  4. Open Source Project Founder

  5. Swing, JavaFX, JavaStore

  6. JavaScript

  7. the problem • no Java on iOS, webOS, PlayBook OS and others • we want to code in Java • we want to use web technologies

  8. the solution • GWT cross compiler • PhoneGap build scripts • Open source API bindings

  9. what is GWT? • Google Web Toolkit • compiler: Java to JavaScript • UI Toolkit & JavaSE APIs • optimized by smart Googlers • works on any WebKit!

  10. How GWT works • write Java code against GWT APIs • debug with your Java IDE • compile to optimized JavaScript • run in any browser • client and server side code

  11. First GWT App • download: code.google.com/webtoolkit/ • work through online tutorial • mobilize

  12. generate new project webAppCreator -out MyApp com.myco.MyApp

  13. localhost:gwt-2.0.4 joshmarinacci$ ./webAppCreator -out MyApp com.joshondesign.myapp.MyAppNot creating tests because -junit argument was not specified.Created directory MyApp/srcCreated directory MyApp/warCreated directory MyApp/war/WEB-INFCreated directory MyApp/war/WEB-INF/libCreated directory MyApp/src/com/joshondesign/myappCreated directory MyApp/src/com/joshondesign/myapp/clientCreated directory MyApp/src/com/joshondesign/myapp/serverCreated directory MyApp/src/com/joshondesign/myapp/sharedCreated directory MyApp/test/com/joshondesign/myappCreated directory MyApp/test/com/joshondesign/myapp/clientCreated file MyApp/src/com/joshondesign/myapp/MyApp.gwt.xmlCreated file MyApp/war/MyApp.htmlCreated file MyApp/war/MyApp.cssCreated file MyApp/war/WEB-INF/web.xmlCreated file MyApp/src/com/joshondesign/myapp/client/MyApp.javaCreated file MyApp/src/com/joshondesign/myapp/client/GreetingService.javaCreated file MyApp/src/com/joshondesign/myapp/client/GreetingServiceAsync.javaCreated file MyApp/src/com/joshondesign/myapp/server/GreetingServiceImpl.javaCreated file MyApp/src/com/joshondesign/myapp/shared/FieldVerifier.javaCreated file MyApp/build.xmlCreated file MyApp/README.txtCreated file MyApp/.projectCreated file MyApp/.classpathCreated file MyApp/MyApp.launchCreated file MyApp/war/WEB-INF/lib/gwt-servlet.jarlocalhost:gwt-2.0.4 joshmarinacci$

  14. GWT App Structure • client/ • GUI code, define services & proxies • server/ • implement services • shared/ • common code

  15. build • run ant • gwtc will compile your app to javascript • generates permutations & war • run in appserver

  16. [demo]

  17. Web Technology: Browser Page or App? • Browser: always remote • easy deployment • 100% connection required • App: always local • loads faster, easy to launch • have to submit to app catalog

  18. What is PhoneGap? • packages HTML into native apps • iPhone -> generate ObjC wrapper -> app • Android -> generate Java wrapper -> app • webOS -> app

  19. Build a Mobile App • Turn the client code into an app • Don’t use server code OR put server side code on a real server • Generate native projects with Phone Gap • Compile and submit for each platform

  20. GWT + PhoneGap • create phonegap dir • copy phonegap-palm • copy /war/myapp/ to framework/www/myapp/ • copy /war/MyApp.html to framework/www/index.html • package, install, and run webOS app • repeat for other platforms

  21. [demo]

  22. Mobilize your App

  23. Customizing for Mobile • improve your UI design for tapping • shrink everything with CSS • support multiple resolutions • hook into device APIs • use HTML Canvas

  24. UI Styling with CSS • [example] • [master detail app with transitions]

  25. Device Sizes • media-queries • [show same app on phone and touchpad]

  26. Device Access: Camera • [example] • [simple app to take a picture, show it, then upload it to twitpic]

  27. HTML Canvas • 2D drawing api in HTML • direct GWT support • good for games and graphics

  28. Canvas • [demo of doing some charts]

  29. GWT Play • [demo]

  30. Tools • code.google.com/p/gwt-mobile-webkit/ • github.com/dennisjzh/GwtMobile-PhoneGap • Chrome w/ Developer Tools

  31. developer.palm.com • 100% free: • docs & forums • tools & sdk • app submission • Use any tools or language you want!

  32. Questions? • josh.marinacci@palm.com • JoshOnDesign.com • @joshmarinacci • Developer.Palm.Com • Come by the HP Booth!

More Related