OpenRPGUI Meets Android

Multitasking phone could be your next business breakthrough

Multitasking phone could be your next business breakthrough

At the beginning of 2010, I switched from a BlackBerry to a Motorola Google Android (aka Droid) for my mobile device, which was a big risk for me because I run my entire work and personal life based on where my phone tells me to be. While sitting in an airport waiting for a delayed flight, I decided to see how much work was involved in creating a simple Android application frosidebarm scratch. It took only about 45 minutes and that included downloading the entire Android development environment.

That got me excited because I realized I could not only develop something that ran on the Droid platform but also that it could easily communicate with RPG on IBM i using the OpenRPGUI free and open-source framework.

The Google Android platform is fast becoming one of the most popular in existence. And increasingly more people are using their mobile devices for things normally done from a laptop or desktop. This means your customers or other internal employees (i.e., C-level executives) will soon start expecting you to offer them the capability to communicate with your data and business logic through mobile devices.

This article will guide you through setting up the Droid development environment on your PC. Then we’ll develop a Hello World Droid application and run it in the provided emulator; this means you don't need to own a Droid phone to test this out. Lastly, we’ll walk through a full working example showing how to have the Droid phone talk to OpenRPGUI via HTTP.

What Is Android?

Android is a Linux-based operating system first introduced on Nov. 5, 2007, was originally developed by Android Inc. and subsequently purchased by Google. It primarily runs on cell phones, but Android devices do so much more than just act as a phone. For example, the other day I discovered an application that lets me check my heart rate using my Droid phone by holding my finger over the flash bulb and camera lens at the same time, and it watches for the slight coloration change that your pulsing blood makes in your finger—very creative application. The sidebar, “What I Do on my Droid,” gives a listing of the various ways I use my Android device. As you can see, it’s more than just a phone; it’s how I communicate, stay organized and gain access to information.

The Android Market is a place where Android developers can publish their applications so users can easily download and install them. If I want to use an application I heard about through the grapevine, I click the Android Market icon on my phone, search for the application and click install.

Setting Up Your PC for Android Development

You need four things on your PC to develop an Android application and you can download them for free:

1) A Java Development Kit (JDK) of 1.5 or higher

2) Eclipse Java Developer IDE (or equivalent)

3) Android SDK Starter Pack

4) Once in Eclipse, use URL to access the Android Development Tools Plugin (ADT)

The JDK is sometimes already installed on your machine because of other tooling needing it (i.e., WDSC, RDi or RDP for i). If you aren't sure if it’s installed, you can install it again without harming anything. I like to think of the JDK as being similar to the RPG compiler and the Create Bound RPG Program (CRTBNDRPG) command.

The Eclipse Java Developer IDE is a little trickier to download because the latest version doesn't work correctly with the Android tooling per Google. That means we must obtain an archived version of Eclipse. To do this from the Eclipse website, select the Downloads link in the header navigation as shown in Figure 1. Once on the Download page, select the Older Versions link as shown in Figure 2. We want to download the "Eclipse Galileo SR2 Packages (v 3.5.2)" version of Eclipse as noted in Figure 3. This takes us to a page of different Eclipse Galileo flavors (i.e., J2EE, Java Developer, SOA Architect, etc.) where we want to download the .zip file for "Eclipse IDE for Java Developers" as shown in Figure 4. Unzip the file to your desktop. In the third step of configuring your PC, download the Android SDK Starter Pack, which is a .zip file that needs to be unpacked to your desktop and will be referenced in a later step when we go into the Eclipse Preferences. Now that the basic components are downloaded and unpacked, it’s easiest to convey the next portions of PC development configuration by going through a video. The video walks you through starting Eclipse, installing the Android Development Tools Plugin for Eclipse, configuring the location of the Android SDK Starter Pack, configuring the Android version 2.2 SDK, and configuring a virtual android device so you can run your applications without needing to own a physical device of your own. Audio is required for this video.

Aaron Bartell is Director of IBM i Innovation for Krengel Technology Inc. and an IBM Champion.

comments powered by Disqus



2018 Solutions Edition

A Comprehensive Online Buyer's Guide to Solutions, Services and Education.

New and Improved XML-INTO

Namespace support makes the opcode a viable option

Authenticating on the Web

The finer points of OpenRPGUI, Part 1

The Microphone is Open

Add your voice: Should IBM i include open-source RPG tools?

IBM Systems Magazine Subscribe Box Read Now Link Subscribe Now Link iPad App Google Play Store
IBMi News Sign Up Today! Past News Letters