Book Image

PhoneGap 2.x Mobile Application Development HOTSHOT

By : Kerri Shotts
Book Image

PhoneGap 2.x Mobile Application Development HOTSHOT

By: Kerri Shotts

Overview of this book

<p>Do you want to create mobile apps that run on multiple mobile platforms? With PhoneGap (Apache Cordova), you can put your existing development skills and HTML, CSS, and JavaScript knowledge to great use by creating mobile apps for cross-platform devices.</p> <p>"PhoneGap 2.x Mobile Application Development Hotshot" covers the concepts necessary to let you create great apps for mobile devices. The book includes ten apps varying in difficulty that cover the gamut – productivity apps, games, and more - that are designed to help you learn how to use PhoneGap to create a great experience.</p> <p>"PhoneGap 2.x Mobile Application Development Hotshot" covers the creation of ten apps, from their design to their completion, using the PhoneGap APIs. The book begins with the importance of localization and how HTML, CSS, and JavaScript interact to create the mobile app experience. The book then proceeds through mobile apps of various genres, including productivity apps, entertainment apps, and games. Each app covers specific items provided by PhoneGap that help make the mobile app experience better. This book covers the camera, geolocation, audio and video, and much more in order to help you create feature-rich mobile apps.</p>
Table of Contents (19 chapters)
PhoneGap 2.x Mobile Application Development HOTSHOT
Credits
About the Author
About the Reviewers
www.PacktPub.com
Preface
InstallingShareKit 2.0
Index

Implementing the video thumbnail plugin for Android


The Android version of the plugin is very similar to the iOS version, although it doesn't have to worry about the version of PhoneGap in use, so it is a little shorter. Ultimately, though, the steps are the same: grab a frame from a video, save it to storage, and return to JavaScript.

Getting ready

First off, create a new class by opening the File menu, selecting New, and then selecting Class.

Next, set the Package to com.kerrishotts.PKVideoThumbnail, the Name field of the class to PKVideoThumbnail, and then uncheck the first item under Which method stubs would you like to create? – we won't need any sample code. This is shown in the following screenshot:

Next, open the resulting file PKVideoThumbnail.java file, and we'll start writing the Android version.

Getting on with it

Unlike iOS, we only need one file, and it ends up being a bit shorter too, given as follows:

package com.kerrishotts.PKVideoThumbnail;

import org.apache.cordova.api.Plugin...