Cordova 2.9.0: “[ERROR] Error initializing Cordova: Class not found”


When I preview a page of my Android app with cordova.js (2.9.0) in Google Chrome, the page appears with an alert message saying,

The page at file://localhost/ says:
[ ]
gap:["Device","getDeviceInfo","Device1830682625"]
Cancel, OK

If I click on OK another alert appears, saying:

The page at file://localhost/ says:
[ ]
gap:["Device","getDeviceInfo","Device889844386"]
Cancel, OK

When I click on OK, the alert stops with no issues. These alerts pop up only on pages where cordova.js (2.9.0) are called, such as when the page contains external links and invokes the InAppBrowser. No other pages are affected.

I get these alerts on the Mac and PC. I’ve never received these alerts before 2.9.0. Continue reading

Adding Picture Zooming to Your PhoneGap App with iScroll4


I thought that by simply adding “user-scalable=yes” to the meta tag it would enable my pictures  to be pinch/zoom scalable. But such was not the case. Something more was needed, and iScroll4 supplied the missing functionality. What’s extra nice is that doesn’t need Jquery. Here are the simple steps I took to enable my pictures to have pinch/zoom. This was tested on a Nexus 7. 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