Building Mobile Applications with Java: Using the Google Web Toolkit and PhoneGap

By Joshua Marinacci

Do you must advance cellular apps with Java—and have them paintings on a number of units powered through iOS and Android? You’ve come to the appropriate place.

This project-driven e-book exhibits you the way to construct moveable apps with remarkable open resource frameworks, Google internet instruments (GWT) and PhoneGap. With those instruments, you’ll use how you can write Java code that compiles into cross-platform Javascript and HTML, and notice the way to benefit from gains in numerous renowned units, similar to the digicam, accelerometer, and GPS.

  • Get began with GWT through construction an instance Twitter seek app
  • Build a instance net app and adapt it for cellular with CSS
  • Add contact centric controls with the GWT cellular UI library
  • Develop a operating wine magazine app that tracks a user’s GPS location
  • Use thoughts to make a cellular model of your internet or computing device app
  • Work with HTML5 Canvas to construct a cellular video game
  • Package your apps for iOS, webOS, and Android with PhoneGap

Show description

Quick preview of Building Mobile Applications with Java: Using the Google Web Toolkit and PhoneGap PDF

Best Java books

Mastering Lambdas: Java Programming in a Multicore World (Oracle Press)

The Definitive consultant to Lambda Expressions getting to know Lambdas: Java Programming in a Multicore global describes how the lambda-related positive aspects of Java SE eight will permit Java to satisfy the demanding situations of next-generation parallel architectures. The publication explains tips on how to write lambdas, and the way to exploit them in streams and in assortment processing, offering code examples all through.

Mastering JavaFX 8 Controls (Oracle Press)

Layout and installation High-Performance JavaFX Controls convey cutting-edge purposes with visually gorgeous UIs. gaining knowledge of JavaFX eight Controls offers transparent directions, special examples, and ready-to-use code samples. tips to paintings with the newest JavaFX APIs, configure UI elements, instantly generate FXML, construct state of the art controls, and successfully observe CSS styling.

Data Abstraction and Problem Solving with Java: Walls and Mirrors (3rd Edition)

The 3rd version of info Abstraction and challenge fixing with Java: partitions and Mirrors employs the analogies of partitions (data abstraction) and Mirrors (recursion) to educate Java programming layout ideas, in a manner that starting scholars locate available. The publication has a student-friendly pedagogical procedure that rigorously money owed for the strengths and weaknesses of the Java language.

Java Software Solutions: Foundations of Program Design (7th Edition)

Java software program ideas teaches a origin of programming thoughts to foster well-designed object-oriented software program. Heralded for its integration of small and massive lifelike examples, this all over the world best-selling textual content emphasizes development good problem-solving and layout talents to put in writing fine quality courses.

Extra info for Building Mobile Applications with Java: Using the Google Web Toolkit and PhoneGap

Show sample text content

Opt for the SDK you’ve put in and go away the defaults for the remainder of the choices. Then click on create avd to create the digital gadget. you can now release the emulator (Figure 3-4). for instance, from the command line run . /emulator @phonegap_tester in case you named your digital gadget phonegap_tester. determine 3-4. Create new Android emulator it's going to take some time in addition up because it is emulating the full Android OS and equipment undefined. as soon as it’s booted you could collect and run your apps within the emulator (Figure 3-5). PerchSearch for Android just like what we did for webOS, replica the Android/Sample listing from the place you kept PhoneGap for your improvement listing (probably subsequent to the place you place the phonegap-palm directory). Rename the listing to anything like perchsearch-android. 18 | bankruptcy 3: Getting begun with PhoneGap Figure 3-5. Android Emulator operating Now you want to permit the venture recognize the place you could have put in the android SDK and select the model of the API you will have. You do that by means of operating the subsequent command: android replace venture --path --target i've got downloaded the Android four. zero. three SDK, so i'll use the objective unlock of android-15. you will see that an inventory of put in releases with android record pursuits for instance, on my desktop I did this: ~/bin/android-sdk-macosx/tools/android replace undertaking --path perchsearch-android -target android-15 Now pass into the undertaking listing and construct and set up the applying into the emulator with ant fresh debug set up This command will totally construct the app and set up it within the emulator however it won't really release the app. in its place you need to manually visit the emulator and click the app’s icon to begin it. occasionally ant set up will fail to discover the emulator. If that occurs simply run it back. Now you will have the normal PhoneGap app working Packaging an Android App | 19 in the Android emulator (Figure 3-6). If ant fresh debug set up did not truly set up the app then try out restarting the emulator and run it back. determine 3-6. PhoneGap operating in Android emulator To make our personal app prepared for Android we do a similar factor we did with webOS: reproduction the contents of PerchSearch/war/ to the perchsearch-android/assets/www listing. additionally rename PerchSearch. html to index. html. To rebuild the app run ant fresh debug set up back. at any time when you alter your resource code it is important to replica it over to the www listing and recompile. The app seems like determine 3-7 within the Android emulator. word: If the obvious PhoneGap template works yet your app a lot basically as a white monitor within the Android emulator you then could have stumbled throughout a brand new trojan horse. In Android four+ the webkit implementation brought a brand new safety characteristic which may holiday apps which use iframe. through default GWT will use an iframe as a part of the generated code. Disable this by means of including on your gwt. xml dossier and recompile the GWT venture. Now it's going to paintings in Android 4+. 20 | bankruptcy 3: Getting began with PhoneGap Figure 3-7.

Download PDF sample

Rated 4.71 of 5 – based on 45 votes