Book Image

WordPress Mobile Applications with PhoneGap

By : Eugene Liang
Book Image

WordPress Mobile Applications with PhoneGap

By: Eugene Liang

Overview of this book

With the explosive popularity of mobile apps and its much anticipated continued growth for the foreseeable future, developers will want to get their hands dirty and build some cool mobile apps. But we know that building mobile apps is not easy: we need to handle cross-platform issues, mobile devices of different screen sizes, not to mention traditional issues such as providing a content management system of the content served in the application. Enter "WordPress Mobile Applications with PhoneGap". We leverage on some of the most popular open source projects: Wordpress, jQuery, jQuery Mobile and PhoneGap and discover how they can be pieced together to build a fully functional cross platform mobile application. "WordPress Mobile Applications with PhoneGap" teaches you how to build mobile application with minimal effort and coding by leveraging on some of the most popular open source projects such as Wordpress, jQuery, jQuery Mobile and PhoneGap. This book looks at some of the most popular open source projects: Wordpress, jQuery, jQuery Mobile and PhoneGap and breaks down the nitty gritty details on how to leverage on these projects to build a fully functional cross-platform mobile application with minimal coding and effort. You will start off by quickly going through the capabilities of Wordpress. Then you will prepare some groundwork on how to make use of plugins and the GeoPlaces theme to provide geographic and API capabilities to WordPress. Next you will learn how to create an external HTML/CSS/JavaScript that consumes and posts data to your Wordpress blog. More importantly, you will see how to convert this external app into a PhoneGap in as little as five minutes. Finally, you will learn how to apply all these techniques and skills to a Wordpress app based on the Twenty-Ten theme and create a cross-platform mobile app using PhoneGap. By the end of "Wordpress Mobile Applications with PhoneGap" you will learn how to piece Wordpress, jQuery, jQuery Mobile and PhoneGap together into a fully functional mobile app.
Table of Contents (13 chapters)

Preface

If you have picked up this book, there is a good chance that you are interested in combining WordPress with PhoneGap and building some really cool mobile applications. While it may not be obvious, WordPress can be used in conjunction with PhoneGap to create native mobile apps, with a powerful backend content management system (CMS) provided by WordPress.

This book shows you how to combine WordPress and PhoneGap so that you can create native mobile apps with minimal coding.

A 30,000-feet overview of this book

How can we use WordPress together with PhoneGap? It turns out that this is possible through the use of WordPress's Application Programming Interface (API). For starters, consider how popular websites such as Facebook, Twitter, and Google allow third-party programmers to extend their website's core functionalities via APIs; third-party developers create mashups or build new applications through two basic requests, namely the GET and POST requests. In this book, you will also learn how to extend your WordPress site's capabilities over to mobile applications.

What this book covers

Chapter 1, WordPress Overview and Installation, walks you through a high-level overview of WordPress, from getting it up and running, to its key features such as plugins and themes.

Chapter 2, Adding Geographical Capabilities via the GeoPlaces Theme, talks about creating a location-based directory via the GeoPlaces theme. It covers the setting up and addition of sample geographic data into your WordPress site.

Chapter 3, Extending WordPress Using JSON-API, covers how to create your very own API that exposes WordPress's functionality with the JSON-API plugin. From here you'll see how you can quickly create a third-party app based on your WordPress site's content and its exposed API.

Chapter 4, Building Mobile Applications Using PhoneGap, walks you through the installation and creation of a PhoneGap application.

Chapter 5, Extending WordPress to the Mobile World, continues and builds upon the concepts learned in Chapter 4, Building Mobile Applications Using PhoneGap You will extend your WordPress site to native mobile applications via PhoneGap. You will learn how easy it is to convert a JavaScript application to a PhoneGap application with just a few lines of code.

Chapter 6, Using Open Source Themes, walks you through applying what we have learned from the first five chapters to open source themes. The theme we are using is the Twenty Ten theme.

What you need for this book

You'll need a basic text editor to get started in this book. Instructions for installing MySQL, PHP, WordPress, and so on are provided in this book.

Who this book is for

This book is for people who are interested in building cross-platform, native mobile applications with a minimum effort for coding. You should have at least a beginner's knowledge of JavaScript/jQuery and WordPress. Knowledge of PhoneGap, JSON, and API-related concepts is not required.

Conventions

In this book, you will find a number of styles of text that distinguish between different kinds of information. Here are some examples of these styles, and an explanation of their meaning.

Code words in text are shown as follows: "We will be writing a readSinglePost() function."

A block of code is set as follows:

<!DOCTYPE HTML>
<html>
<head>
<title>Hello World</title>
<script type="text/javascript" charset="utf-8"src="cordova-1.9.0.js"></script>
</head>
<body>
<h1>Hello World</h1>
</body>
</html>

When we wish to draw your attention to a particular part of a code block, the relevant lines or items are set in bold:

<body>
<h1>Hello World</h1>
<div id="main">
<div id="title"></div>
<div id="contents"></div>
</div>
</body>

New terms and important words are shown in bold. Words that you see on the screen, in menus or dialog boxes for example, appear in the text like this: "clicking the Next button moves you to the next screen".

Note

Warnings or important notes appear in a box like this.

Tip

Tips and tricks appear like this.

Reader feedback

Feedback from our readers is always welcome. Let us know what you think about this book—what you liked or may have disliked. Reader feedback is important for us to develop titles that you really get the most out of.

To send us general feedback, simply send an e-mail to , and mention the book title through the subject of your message.

If there is a topic that you have expertise in and you are interested in either writing or contributing to a book, see our author guide on www.packtpub.com/authors.

Customer support

Now that you are the proud owner of a Packt book, we have a number of things to help you to get the most from your purchase.

Downloading the example code

You can download the example code files for all Packt books you have purchased from your account at http://www.packtpub.com. If you purchased this book elsewhere, you can visit http://www.packtpub.com/support and register to have the files e-mailed directly to you.

Errata

Although we have taken every care to ensure the accuracy of our content, mistakes do happen. If you find a mistake in one of our books—maybe a mistake in the text or the code—we would be grateful if you would report this to us. By doing so, you can save other readers from frustration and help us improve subsequent versions of this book. If you find any errata, please report them by visiting http://www.packtpub.com/support, selecting your book, clicking on the errata submission form link, and entering the details of your errata. Once your errata are verified, your submission will be accepted and the errata will be uploaded to our website, or added to any list of existing errata, under the Errata section of that title.

Piracy

Piracy of copyright material on the Internet is an ongoing problem across all media. At Packt, we take the protection of our copyright and licenses very seriously. If you come across any illegal copies of our works, in any form, on the Internet, please provide us with the location address or website name immediately so that we can pursue a remedy.

Please contact us at with a link to the suspected pirated material.

We appreciate your help in protecting our authors, and our ability to bring you valuable content.

Questions

You can contact us at if you are having a problem with any aspect of the book, and we will do our best to address it.