Blog
mobile-spec test suite on each phonegap platform
Sat, Mar 27, 2010
by
Anis

mobile-spec is a test suite that runs on each phonegap platform and tests mobile device functionality inside the mobile’s browser.

I will run mobile-spec on each platform once a week and report the results on this blog. Stay tuned!

This week I tested the following platforms:

  • PhoneGap iPhone
  • PhoneGap Android
  • PhoneGap BlackBerry
  • PhoneGap Palm

Test results are below. Click on the thumbnail to get more details on the failing tests. I only focus on failing tests.

iPhone - part 1
iPhone - part 2
Android - part 1
Android - part 2
Android - part 3
Android - part 4
Palm - part 1
Palm - part 2
Blackberry - Part 1
BlackBerry - Part 2
BlackBerry - Part 3
BlackBerry - Part 4

› Visit the original post

Android without Eclipse
Fri, Mar 26, 2010
by
Joe B

Now, for people who are Java developers, I can understand the attachment to Eclipse, but for the rest of us, Eclipse is a giant piece of bloatwear that gets in the way of the code and what we want to do with that code. However, it’s a fact of life for Android developers, or is it?

Building and running Android Applications:

Now, the first command that we deal with is the android command, which can generate a project. In typical java fashion, it takes a crap ton of flags, but you can create a project by typing this:


android create project -t 7 -k package name - a name -n name

This will create an android project. Now, on Android, the DroidGap script actually uses the Android script to create a project. So, once you have your project, what do you do with it? Well, the first thing to do is to build it, which you can do with ant. When you type ant on an Android project, you’ll get a list of commands like this:

help:
     [echo] Android Ant Build. Available targets:
     [echo]    help:      Displays this help.
     [echo]    clean:     Removes output files created by other targets.
     [echo]    compile:   Compiles project's .java files into .class files.
     [echo]    debug:     Builds the application and signs it with a debug key.
     [echo]    release:   Builds the application. The generated apk file must be
     [echo]               signed before it is published.
     [echo]    install:   Installs/reinstalls the debug package onto a running
     [echo]               emulator or device.
     [echo]               If the application was previously installed, the
     [echo]               signatures must match.
     [echo]    uninstall: Uninstalls the application from a running emulator or
     [echo]               device.

I think this is pretty self-explanatory, BUT there needs to be something said for the difference between debug versions and release versions of the same piece of software. Most of the time, you’ll want to sign the apks with a debug key, so that these are specific to your workstation. However, when releasing a project, you will want to sign it with a key in the keystore. (It’s important to take care of your keystore and not to do what I did and forget about it. This is why I haven’t gotten a free Nexus One from Google for the PhoneGap Demo Application.)

Of course, this only works either for one phone, or one emulator. What if you have multiple emulators? No problem, use adb. The Android Debug Bridge is one of the most handy tools in the Android Developers toolkit, and is extremely handy for debugging. To see what devices you have, run adb devices like this:


bowserj@shapley:~/Orbot$ adb devices
List of devices attached
0123456789012 device

To install an APK onto a device, type the following:

apk -s 0123456789012 install phonegap.apk

Debugging Javascript and Java on the Android WITHOUT ECLIPSE

Now, here’s where things get interesting. When you need to debug javascript in the latest version of PhoneGap, you can use logcat to do so, all you need to do is run adb logcat, like this:


adb logcat

Of course, to actually use a Java Debugger, such as jdb, you need to attach it to a process on the device. ADB has you covered as well, all you need to do is this:

adb jdwp

Then once you have the PID that you want, do this:

adb forward tcp:8000 jdwp:

jdb -attach localhost:8000

Then you’re in! Make sure that you don’t have another process (i.e. Eclipse) running that connects to this, and you should be able to debug your Java code just like how you would debug Java code normally. I admit that I’m not a jdb/gdb ninja and things like DDD have made me dumb. Therefore, I’d appreciate any book recommendations on how to use JDB/GDB for debugging.

› Visit the original post

Curiosity of the Day: DroidScript
Fri, Mar 12, 2010
by
Joe B

Recently, a blog post came forward from Mikael Kindbord about running Rhino on Android. I was then asked to take a look at it,and it was pretty interesting. He recently released a project called DroidScript, which is actually really interesting. It’s an interesting front-end to Rhino, and it has the Javascript using Dalvik Android classes with Javascript so that you can have intents and invoke any method in Javascript that you can in Java. It does produce some pretty verbose code, and while I’m not going to re-structure Android PhoneGap so that it uses this just yet, it’s an interesting thought experiment in how many different ways you can write code for Android.

If you’re interested in Android and Javascript, I high recommend checking it out.


› Visit the original post

Learn PhoneGap from The Experts in Seattle on March 11
Mon, Mar 1, 2010
by
Andre Charland

Learn the easiest way to use HTML, CSS and JavaScript to build cross-platform mobile apps.

Creators of PhoneGap, a ground-breaking mobile application development framework, will show web developers how to build mobile applications in HTML and JavaScript while still taking advantage of core features of iPhone, Google Android, Blackberry, Symbian and Palm mobile devices. This full-day PhoneGap training session takes place in Seattle on March 11, 2010. Attendees can register at http://mobileappdevtraining5.eventbrite.com/.

PhoneGap gained widespread recognition last year when the project won the LaunchPad competition at Web 2.0 Expo. Since then, hundreds, even thousands, of PhoneGap applications have been built and submitted to the Apple app store and directories.

In the training session, you’ll learn how to use your HTML/JavaScript skills to build app store ready applications for mobile platforms including iPhone, Google Android, Blackberry, Symbian and Palm. At the completion of this course, you’ll be able to:

  • Set up your development environment
  • Compile for multiple platforms
  • Run code in a emulator
  • Debug your HTML and JavaScript
  • Access native APIs, including location, camera, accelerometer, contacts, and more via JavaScript
  • Optimize your JavaScript for mobile devices
  • Make security considerations
  • Build a mobile application that runs offline
  • Use CSS transitions, animations and transforms to create native looking interfaces
  • Use the Canvas for advanced graphics
  • Use mobile JS libraries, such as XUI and Dashcode to build mobile applications faster

Event Details
March 11, 2010 from 9:30 am – 4:30 pm
Fee: $499 USD
World Trade Center, 2200 Alaskan Way, Seattle WA
Register: http://mobileappdevtraining5.eventbrite.com/

Hope to see you there!


› Visit the original post