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)

The famous five minute installation of WordPress


Now, let us quickly install WordPress so we are on the same frequency:

  1. Pop over to http://WordPress.org/download/ and download WordPress in either the .zip or .tar.gz format. At the time of writing, the latest stable version of WordPress was 3.3.2. Unzip WordPress and place it into a desired location on your local web server.

  2. Next, let's create a database for WordPress on your website. For the purposes of this book, I've decided to name my database wordpress_phonegap. In my case, I created the database wordpress_phonegap using phpMyAdmin:

    Creating a database using phpMyAdmin

  3. Type in wordpress_phonegap and click on Create.

  4. Now, go to the root of your WordPress folder and you should see a file named wp-config-sample.php. Open up the file in the text editor of your choice and look for these lines: define('DB_NAME', 'database_name_here');, define('DB_USER' and 'username_here');, define('DB_PASSWORD', 'password_here');. Change database_name_here, username_here, and password_here to the appropriate values and save the file as wp-config.php.

  5. Now open up your web browser and navigate to the location where you have placed your WordPress installation. In my case, I renamed the WordPress folder to worpress_phonegap and I have placed the folder at http://loc alhost/public_html. Hence, this is what I will see when I visit http://localhost/public_html/WordPress_phonegap:

    Setup page for WordPress

Now enter the information for the Site Title, Username, Passwords, and Your E-mail fields. Once done, click on the button Install WordPress. For the purposes of this book, I named the site as WordPress and PhoneGap Mobile Applications and I am using admin as the username.

Once you have successfully installed WordPress, you should see the following on your browser:

Success message when you have installed WordPress successfully