Setting Up Your Development Environment for Cordova Android projects


Updated 8/2/2015 to include Windows 7 setup. Adobe PhoneGap/Apache Cordova CLI quickly sets up your project files for the mobile environment. However, it requires a hefty setup of your development environment before you can begin making Android apps. If you are a working developer, all these tools are par for the course and you’ll have them already installed. If you are trying out Cordova/PhoneGap for the first time, and you are new to the programming world – welcome! – you need to install all the “dependencies” that Cordova/PhoneGap assumes are already resident on your system. Follow all these steps to make your Cordova/PhoneGap work go smoothly. Of course, these steps need to be done just once. Continue reading

Adding Cordova APIs to Android via CLI: Geolocation, Globalization, Notification


In this article, we are in part 3 of exploring the Cordova APIs, which started in https://iphonedevlog.wordpress.com/2014/01/31/adding-cordova-apis-to-android-via-cli-accelerometer-and-camera/ Refer to that article to set up your Cordova PhoneGap project files. You’ll need to follow the “Set Up the Android Project” section through step 9 inclusive. On this page, we’ll explore the Geolocation, Globalization, Notification APIs from the perspective of getting our feet wet. Continue reading

Using PhoneGap 3.0 CLI on Mac OS X to Build iOS and Android Projects


At the time this was written PhoneGap Build does not support PG 3.0. These instructions assume Cordova PhoneGap is being used, not Build.

I highly recommend following the latest version of PhoneGap or Cordova. For instance, try these pages:

iOS: https://iphonedevlog.wordpress.com/2014/06/24/using-cordova-3-5-cli-on-mac-os-x-mavericks-to-build-ios-apps/

Android: https://iphonedevlog.wordpress.com/2014/06/20/using-cordova-3-5-cli-on-mac-os-x-mavericks-to-build-android-apps/

In this article, you will use CLI to build iOS and Android projects:

  • Install Cordova
  • Create a project with all necessary www folders and files
  • Add iOS and Android platform version folders and files
  • Build an Android debug apk for installation on a device for previewing
  • Build an Android project and view on a browser for previewing
  • Add the InAppBrowser and Splashscreen plugins
  • Update icons and splash screens for each platform
  • Update the config.xml, AndroidManifest.xml, and index.html files
  • Customize content for a particular platform
  • Finalize a product apk for Google Play upload, including keys and certificates

Continue reading

Installing a 9-Patch Splash Screen for Android using draw9patch and PhoneGap


Cordova includes a Splashscreen API so you can add a splash screen to your app, which consists of a still graphic image displaying before your app starts.

If you create your Android splash screen as a 9-patch image, then the image will resize proportionally when displayed in either portrait or landscape mode. Continue reading

Fixing Android Lint Warnings Found when Building a PhoneGap Project


One of the checks you should make before creating your apk file for testing or uploading to an Android-based app store is the Run Lint command in Eclipse. This is found when you right-click on your project name in the Project Explorer, and select Android Tools > Run Lint…

The Lint Warnings view will show various performance, correctness, security, and other Android-environment-specific problems that may give rise to your app not loading or working in your device. (You would not use Lint to check for the validity of your HTML; you would use Validate for that.) Continue reading

Cordova PhoneGap 2.7.0 in Windows with Eclipse: Install to Release (updated 6/25/13)


I already have the major software installed on my Windows machine from my last Eclipse build, detailed in https://iphonedevlog.wordpress.com/2012/11/20/building-a-phonegap-android-app-on-windows-cordova-2-2-0-with-eclipse/. If this is your first time with Eclipse and PhoneGap, follow the link above and pay careful attention to the following setup sections:

Install Eclipse Juno IDE
Install Java JDK
Install ADT
Install the Android SDK
Android SDK Manager
Set up your PATH environment variables

The steps following will take up where these left off.
Continue reading

What programming language should you learn if you want to make apps?


Newcomers ask this question a lot. I’ve posted my response to this under the link, “Which programming language should I learn to make apps?” I hope it helps to narrow down your choice of languages to start learning. I posted it here so I can point to it when I encounter the question in forum posts.

Building a PhoneGap Android App in Windows: Cordova 2.3.0 with Eclipse 4.2.1


I already have the major software installed on my Windows machine from my last Eclipse build, detailed in https://iphonedevlog.wordpress.com/2012/11/20/building-a-phonegap-android-app-on-windows-cordova-2-2-0-with-eclipse/. If this is your first time with Eclipse and PhoneGap, follow the link above and pay careful attention to the following setup sections:  Continue reading

Book review: PhoneGap Mobile Application Development Cookbook, by Matt Gifford


October 2012. Published by Packt Publishing Ltd. ISBN 978-1-84951-858-1.
Packt asked me to review the book, which I did in PDF format.

About the author: “A regular presenter at national and international conferences, Matt Gifford also contributes articles and tutorials in leading international industry magazines, as well as publishing on his blog (www.mattgifford.co.uk).”

This book functions as a cookbook, so it creates spare apps that do exactly what they set out to do and little else. As a result, there is no disc of complicated code included. The benefit of this approach is that you don’t get lost in the programming of a more fully functioning app. The cookbook format, however, means that you will get only little more explanation of the code than what you’ll see on PhoneGap’s site. So this is not a book for those already comfortable using the code on PG’s site. Continue reading

Building a PhoneGap Android App in Windows: Cordova 2.2.0 with Eclipse 4.2.1


Install Eclipse Juno IDE

Eclipse is an IDE (integrated development environment) for creating a variety of applications. Download Eclipse Classic 4.2.1, Windows 32-bit, from: http://www.eclipse.org/downloads/. 222MB download. It went into my Downloads folder. I unzipped it and put it in my C:/Program Files/eclipse folder. I right-dragged the eclipse.exe file to my desktop and designated it a Shortcut.

On startup, it asked me to set up a workspace:
C:\Documents and Settings\shusting\workspace
I opted for that location to be the default. After it started up, I exited. Continue reading

Cordova 2.2 Android App Creation in Mountain Lion with Eclipse


I upgraded an Android app from Cordova 2.0 to 2.2. There were no plugins involved. These are the steps I followed. This article assumes you already have Eclipse (a software developement kit used to create Android apps; available for Windows and Mac) and its associated files installed.

If you are new to developing apps for an app store, I recommend reading the following:

Developing for the Amazon app store:
https://developer.amazon.com/help/faq.html
http://www.amazonappstoredev.com/

Developing for Google Play:
http://developer.andr oid.com/distribute/googleplay/publish/preparing.html 
Continue reading

Cordova 2.0 Android App Creation in Mountain Lion with Eclipse: from Install to Google Play


I kept meticulous notes as I downloaded Eclipse and all the other software I needed to create an Android app for Google Play as though my readers were absolute newbies on the Mac (I’ve been there and I haven’t forgotten) using PhoneGap 2.0.0.

I highly recommend you read this informative FAQ page before you start your app if you are going to submit to the Amazon app store: https://developer.amazon.com/help/faq.html  and this page if you want your app to work on the Kindle Fire devices: http://www.amazonappstoredev.com/2012/09/the-kindle-fire-hd-7-emulator.html

My article below follows these basic steps, but provides much more material to finalize the app: http://docs.phonegap.com/en/2.0.0/guide_getting-started_android_index.md.html#Getting%20Started%20with%20Android

(After I finished the app, I discovered strange error. An Aussie colleague told me to open up the bin/create file in the Downloads folder and do a search for “Darwin.” “Darwin11” should be changed to “Darwin12.” It looks like it would be better off to download PG 2.1.0 instead.) Continue reading

Android App Process with Cordova-PhoneGap and Eclipse – from Download to Google Play


The following steps parallel this page for PhoneGap 1.8.x for the most part: http://wiki.phonegap.com/w/page/30862722/phonegap-android-eclipse-quickstart 

These steps assume you’ve already downloaded and installed Eclipse Classic, Android SDK, and the ADT Plugin, as mentioned in the above web page (which includes links if you haven’t downloaded them).

Set up the Eclipse workspace

Eclipse is the software development kit (SDK) you’ll use to assemble your project, then prepare it for app submission to Google Play or any other Android app store. The final file used in devices ends in “.apk” and this is the software that creates that file. Continue reading