Sidebar

Developing Mobile Apps for the IBM i, Part I

Development Tools / Utilities
Typography
  • Smaller Small Medium Big Bigger
  • Default Helvetica Segoe Georgia Times

Just as there's more than one way to skin a cat, there's more than one way to develop mobile apps for the IBM i.

 

Everywhere you turn these days, people are talking about mobile applications. There is endless chatter about apps for iPads and iPhones, Android-style phones and tablets, and several flavors of BlackBerry, among others. The race is on to get mobile apps built and deployed as quickly as possible. Every time you look up, someone is saying "There's an app for that!"

 

Maybe that's your cue to get started. You just need to sort out the technical details and build a mobile app for yourself or your company. Timing is everything, right? So let's begin.

 

Where does the IBM i fit into the fray? Just as important, where do you as an IBM i software developer fit in?

 

Over the course of two articles, I will provide a solid answer to both questions.

 

First, let's lay some groundwork. There are two basic approaches used to build mobile applications. One is to build your apps using native development methodologies. Another is to create your apps using an HTML5 type of development approach.

 

In this article, we're going to build an HTML5 app that runs on the IBM i HTTP Web server. However, having a basic understanding of each approach is imperative to making a good decision about which approach to employ.

 

Let's take a quick look at both.

Native Development

Native development involves a proprietary development API designed to make the most of the device it was created for.

 

iPad and iPhone use Object C, which has a significant learning curve. You can read about native iOS development at the iOS Dev Center.

 

Android uses Java. You can read about Java development for Android here.

 

BlackBerry uses Java too. Go to the BlackBerry Developer site to read about Java development for BlackBerry.

 

Although native for Android and BlackBerry both use Java, the APIs are completely different. Each has its own specific Java API, each with its own learning curve.

 

Advantages of Native Development

 

Apps written with native code libraries are optimized for the target device.

 

Native apps are built to be deployed to their respective app store:

 

  • Apple App Store
  • Android Marketplace
  • BlackBerry App World

 

Native apps also have direct access to the mobile device's features, such as camera, accelerometer, compass, file system, contacts, storage, geolocation, storage, and push notifications.

 

Disadvantages of Native Development

 

If you decide to build a native app and you want to engage audiences from each native platform, you will have to build the app three times.

 

Three times? Really?

 

As mentioned, each of the native platforms above (iOS, Android, BlackBerry) have completely separate and unique APIs. That means:

 

  • Three substantial learning curves
  • Three development efforts
  • Three testing efforts
  • Three deployment strategies
  • Three maintenance efforts
  • Three distinct support burdens

 

Wow, that's a lot to do!

 

If you're going to build your app for a single device type, it's easier to consider a native solution.

 

However, if you want to build your app for multiple devices or if you prefer more of a mobile Web-style look and feel (note: with HTML5 you can achieve a native appearance too!), then an HTML 5 solution is just what you're looking for.

HTML 5

 

Advantages of HTML5 Development

 

One app can run on multiple devices.

 

HTML5 is easier to learn than any of the native solutions.

  • One learning curve
  • One development effort
  • One testing effort
  • One deployment strategy
  • One maintenance effort
  • One support burden

 

One of the great things about adopting the HTML5 approach to mobile development is that if you have any Web development taking place in your shop, then you already understand at least part of the list above.

 

Note: All three of the device types mentioned in this article support what is known as the WebKit browser. WebKit is the provider of HTML5 support. Google Chrome and Apple Safari are both built on WebKit, as are the browsers running in iPad, iPhone, Android, and BlackBerry devices.

 

It's important to note that the HTML5 approach typically employs CSS, JavaScript, and of course HTML5, staples of a typical Web development setting.

 

Your deployment target (WebKit) is also your debugging platform. Google Chrome and Apple Safari have excellent debugging support, including all of the things that you know and love about the green-screen debugger and more!

 

It's easier to roll out changes to a Web-style app than it is to make changes and redeploy a native-style app. With HTML5, you simply push your changes to production. The next time your users run the app, they have your revisions.

 

All of the benefits of building a native app—including access to device internals (camera, accelerometer, compass, file system, contacts, storage, geolocation, and push notifications) and deploying to the various app stores—are available through a technology called PhoneGap (I'll address this in Part II of this article).

 

Disadvantages of HTML5 Development

 

The biggest knock against the HTML5 approach is performance. Native code is compiled to optimize apps built for a given device, producing more efficient, faster code. While this is true, the real issue with performance for any communications-related application is in the way that data is moved between the client and the server. So whether you're writing a native app or an HTML5 app, you need to be mindful of how much data you're sending and receiving and the impact that has on overall response time.

 

Given the many advantages of using HTML5, plus the huge and growing community of HTML5 mobile developers, HTML5 technology for mobile has reached a level of acceptance that makes it a great choice.

 

As mentioned above, in this article we're going to build an app using the HTML5 approach. Also, we will use the IBM i.

 

In any Web development environment, there are two distinct components that you need to be aware of:

 

  • The Web server—For the IBM i, the HTTP Web server is installed by default and is free. We'll use Valence 3.1 from CNX Corporation to provide RPG support for our mobile application. More info below.
  • The browser—For mobile use, the browser comes with the mobile device. All the modern mobile browsers support HTML5 through the use of WebKit. We'll use Google Chrome to test our app on the PC. We'll also use Sencha Touch 2 from Sencha as the JavaScript library for our sample project. More info below.

 

Software Tools

All of the software tools needed for this article are available free. In order to build the app accompanying this article, you should download them now:

 

Google Chrome

 

Google Chrome is for testing and debugging your app on your PC. You may have it already. If not, download it.

 

Google Chrome is simply the best HTML5 browser available for testing mobile apps on your desktop. It has excellent debugging support and very closely emulates the browser running on your mobile device.

 

073012SalisburyFig1

Figure 1: Download Google Chrome.

 

Sencha Touch 2

 

Sencha Touch 2 is the front-end of your application (the screens for your mobile app). This free JavaScript library has captured considerable market share and momentum in the mobile application development world. We'll use it to build the mobile app portion (front-end) of our application. There are several JavaScript libraries in the mobile application development market, but I've found the Sencha library to be the most complete and well-thought-out mobile development platform available.

 

Sencha Touch 2 will be downloaded below as part of the Valence tool, which you will download next.

 

You will need to download Sencha Touch 2 directly only if you are going to build mobile apps that don't involve RPG or Valence. For instance, if your Web-based language of choice is Java, PHP, C#, or any other non-RPG language, you can download it directly from this link. Otherwise, just download Valence in the next step and you'll be all set.

 

073012SalisburyFig2

Figure 2: Download Sencha Touch 2.


Valence for IBM i

 

Valence for IBM i provides a portal into which desktop Web apps and mobile Web apps can be deployed. Valence is an IBM i-centric Web development platform that supports both desktop and mobile app development. Valence also provides an easy-to-use RPG API to support Web apps (both desktop and mobile) as well as built-in support for Sencha's Ext JS desktop browser apps and Sencha Touch 2's mobile browser apps. Download the free community edition!

 

073012SalisburyFig3

Figure 3: Download Valence.

 

Valence installs on your IBM i in just a few minutes and requires no effort to set up. Run the installation process. It will guide you through the installation steps. Once Valence is installed, point your Google Chrome browser to your IBM i using one of these URLs:

 

http://yourIP/valence/vvlogin.pgm

 

or

 

http://yourIBMiname/valence/vvlogin.pgm

 

Valence supports desktop login and mobile (touch) login. If you log in from your desktop browser, Valence will default to a desktop view. You can see what "touch" view looks like via this URL:

 

http://yourIBMiname/valence/vvlogin.pgm?display=touch

 

Here is a mile-high view of how the downloaded pieces relate to each other:

 

073012SalisburyFig4

Figure 4: All the pieces work together.

 

Here's how the different pieces lay out on your IBMi.

 

The Valence Portal is located on your IFS at /valence-3.1.

 

Sencha Touch 2 is located on your IFS at /valence-3.1/sencha-touch-2.0.0.

 

The files for the customer map app (custmapapp.html and custmapapp.js) will be stored at /valence-3.1/mcpress. (You'll create the mcpress folder later.)

 

The RPG source for CUSTMAPR will be located at VALENCE31/QRPGLESRC.

 

The RPG portion of Valence is stored in the Valence31 library.

 

OK, now that you have everything downloaded and you know how the pieces fit together, let's take a look at the customer map app that we're going to build.

 

Here's the flow of the app:

 

1. When the app starts, a list of customers is displayed on the mobile device.

2. The user taps one of the customers.

3. The customer's address is displayed.

4. In addition to the customer address, a map of the area that the customer is located in is displayed.

5. A back button can be used to return to the customer list.

 

This simple app illustrates a number of common functions that are typical of a touch-based app. We have a list (think subfile), we have a detail screen, and we have a Google map component.

 

Let's take a look at the screenshots:

 

073012SalisburyFig5

Figure 5: Here's our customer list.

 

073012SalisburyFig6

Figure 6: A customer has been selected.

Stay Tuned

There you go! Now you know the basics of how to start. In Part II of this article series, we'll pick up where we left off.

BLOG COMMENTS POWERED BY DISQUS

LATEST COMMENTS

Support MC Press Online

RESOURCE CENTER

  • WHITE PAPERS

  • WEBCAST

  • TRIAL SOFTWARE

  • White Paper: Node.js for Enterprise IBM i Modernization

    SB Profound WP 5539

    If your business is thinking about modernizing your legacy IBM i (also known as AS/400 or iSeries) applications, you will want to read this white paper first!

    Download this paper and learn how Node.js can ensure that you:
    - Modernize on-time and budget - no more lengthy, costly, disruptive app rewrites!
    - Retain your IBM i systems of record
    - Find and hire new development talent
    - Integrate new Node.js applications with your existing RPG, Java, .Net, and PHP apps
    - Extend your IBM i capabilties to include Watson API, Cloud, and Internet of Things


    Read Node.js for Enterprise IBM i Modernization Now!

     

  • Profound Logic Solution Guide

    SB Profound WP 5539More than ever, there is a demand for IT to deliver innovation.
    Your IBM i has been an essential part of your business operations for years. However, your organization may struggle to maintain the current system and implement new projects.
    The thousands of customers we've worked with and surveyed state that expectations regarding the digital footprint and vision of the companyare not aligned with the current IT environment.

    Get your copy of this important guide today!

     

  • 2022 IBM i Marketplace Survey Results

    Fortra2022 marks the eighth edition of the IBM i Marketplace Survey Results. Each year, Fortra captures data on how businesses use the IBM i platform and the IT and cybersecurity initiatives it supports.

    Over the years, this survey has become a true industry benchmark, revealing to readers the trends that are shaping and driving the market and providing insight into what the future may bring for this technology.

  • Brunswick bowls a perfect 300 with LANSA!

    FortraBrunswick is the leader in bowling products, services, and industry expertise for the development and renovation of new and existing bowling centers and mixed-use recreation facilities across the entertainment industry. However, the lifeblood of Brunswick’s capital equipment business was running on a 15-year-old software application written in Visual Basic 6 (VB6) with a SQL Server back-end. The application was at the end of its life and needed to be replaced.
    With the help of Visual LANSA, they found an easy-to-use, long-term platform that enabled their team to collaborate, innovate, and integrate with existing systems and databases within a single platform.
    Read the case study to learn how they achieved success and increased the speed of development by 30% with Visual LANSA.

     

  • The Power of Coding in a Low-Code Solution

    LANSAWhen it comes to creating your business applications, there are hundreds of coding platforms and programming languages to choose from. These options range from very complex traditional programming languages to Low-Code platforms where sometimes no traditional coding experience is needed.
    Download our whitepaper, The Power of Writing Code in a Low-Code Solution, and:

    • Discover the benefits of Low-code's quick application creation
    • Understand the differences in model-based and language-based Low-Code platforms
    • Explore the strengths of LANSA's Low-Code Solution to Low-Code’s biggest drawbacks

     

     

  • Why Migrate When You Can Modernize?

    LANSABusiness users want new applications now. Market and regulatory pressures require faster application updates and delivery into production. Your IBM i developers may be approaching retirement, and you see no sure way to fill their positions with experienced developers. In addition, you may be caught between maintaining your existing applications and the uncertainty of moving to something new.
    In this white paper, you’ll learn how to think of these issues as opportunities rather than problems. We’ll explore motivations to migrate or modernize, their risks and considerations you should be aware of before embarking on a (migration or modernization) project.
    Lastly, we’ll discuss how modernizing IBM i applications with optimized business workflows, integration with other technologies and new mobile and web user interfaces will enable IT – and the business – to experience time-added value and much more.

     

  • UPDATED: Developer Kit: Making a Business Case for Modernization and Beyond

    Profound Logic Software, Inc.Having trouble getting management approval for modernization projects? The problem may be you're not speaking enough "business" to them.

    This Developer Kit provides you study-backed data and a ready-to-use business case template to help get your very next development project approved!

  • What to Do When Your AS/400 Talent Retires

    FortraIT managers hoping to find new IBM i talent are discovering that the pool of experienced RPG programmers and operators or administrators is small.

    This guide offers strategies and software suggestions to help you plan IT staffing and resources and smooth the transition after your AS/400 talent retires. Read on to learn:

    • Why IBM i skills depletion is a top concern
    • How leading organizations are coping
    • Where automation will make the biggest impact

     

  • Node.js on IBM i Webinar Series Pt. 2: Setting Up Your Development Tools

    Profound Logic Software, Inc.Have you been wondering about Node.js? Our free Node.js Webinar Series takes you from total beginner to creating a fully-functional IBM i Node.js business application. In Part 2, Brian May teaches you the different tooling options available for writing code, debugging, and using Git for version control. Attend this webinar to learn:

    • Different tools to develop Node.js applications on IBM i
    • Debugging Node.js
    • The basics of Git and tools to help those new to it
    • Using NodeRun.com as a pre-built development environment

     

     

  • Expert Tips for IBM i Security: Beyond the Basics

    SB PowerTech WC GenericIn this session, IBM i security expert Robin Tatam provides a quick recap of IBM i security basics and guides you through some advanced cybersecurity techniques that can help you take data protection to the next level. Robin will cover:

    • Reducing the risk posed by special authorities
    • Establishing object-level security
    • Overseeing user actions and data access

    Don't miss this chance to take your knowledge of IBM i security beyond the basics.

     

     

  • 5 IBM i Security Quick Wins

    SB PowerTech WC GenericIn today’s threat landscape, upper management is laser-focused on cybersecurity. You need to make progress in securing your systems—and make it fast.
    There’s no shortage of actions you could take, but what tactics will actually deliver the results you need? And how can you find a security strategy that fits your budget and time constraints?
    Join top IBM i security expert Robin Tatam as he outlines the five fastest and most impactful changes you can make to strengthen IBM i security this year.
    Your system didn’t become unsecure overnight and you won’t be able to turn it around overnight either. But quick wins are possible with IBM i security, and Robin Tatam will show you how to achieve them.

  • Security Bulletin: Malware Infection Discovered on IBM i Server!

    SB PowerTech WC GenericMalicious programs can bring entire businesses to their knees—and IBM i shops are not immune. It’s critical to grasp the true impact malware can have on IBM i and the network that connects to it. Attend this webinar to gain a thorough understanding of the relationships between:

    • Viruses, native objects, and the integrated file system (IFS)
    • Power Systems and Windows-based viruses and malware
    • PC-based anti-virus scanning versus native IBM i scanning

    There are a number of ways you can minimize your exposure to viruses. IBM i security expert Sandi Moore explains the facts, including how to ensure you're fully protected and compliant with regulations such as PCI.

     

     

  • Encryption on IBM i Simplified

    SB PowerTech WC GenericDB2 Field Procedures (FieldProcs) were introduced in IBM i 7.1 and have greatly simplified encryption, often without requiring any application changes. Now you can quickly encrypt sensitive data on the IBM i including PII, PCI, PHI data in your physical files and tables.
    Watch this webinar to learn how you can quickly implement encryption on the IBM i. During the webinar, security expert Robin Tatam will show you how to:

    • Use Field Procedures to automate encryption and decryption
    • Restrict and mask field level access by user or group
    • Meet compliance requirements with effective key management and audit trails

     

  • Lessons Learned from IBM i Cyber Attacks

    SB PowerTech WC GenericDespite the many options IBM has provided to protect your systems and data, many organizations still struggle to apply appropriate security controls.
    In this webinar, you'll get insight into how the criminals accessed these systems, the fallout from these attacks, and how the incidents could have been avoided by following security best practices.

    • Learn which security gaps cyber criminals love most
    • Find out how other IBM i organizations have fallen victim
    • Get the details on policies and processes you can implement to protect your organization, even when staff works from home

    You will learn the steps you can take to avoid the mistakes made in these examples, as well as other inadequate and misconfigured settings that put businesses at risk.

     

     

  • The Power of Coding in a Low-Code Solution

    SB PowerTech WC GenericWhen it comes to creating your business applications, there are hundreds of coding platforms and programming languages to choose from. These options range from very complex traditional programming languages to Low-Code platforms where sometimes no traditional coding experience is needed.
    Download our whitepaper, The Power of Writing Code in a Low-Code Solution, and:

    • Discover the benefits of Low-code's quick application creation
    • Understand the differences in model-based and language-based Low-Code platforms
    • Explore the strengths of LANSA's Low-Code Solution to Low-Code’s biggest drawbacks

     

     

  • The Biggest Mistakes in IBM i Security

    SB Profound WC Generic The Biggest Mistakes in IBM i Security
    Here’s the harsh reality: cybersecurity pros have to get their jobs right every single day, while an attacker only has to succeed once to do incredible damage.
    Whether that’s thousands of exposed records, millions of dollars in fines and legal fees, or diminished share value, it’s easy to judge organizations that fall victim. IBM i enjoys an enviable reputation for security, but no system is impervious to mistakes.
    Join this webinar to learn about the biggest errors made when securing a Power Systems server.
    This knowledge is critical for ensuring integrity of your application data and preventing you from becoming the next Equifax. It’s also essential for complying with all formal regulations, including SOX, PCI, GDPR, and HIPAA
    Watch Now.

  • Comply in 5! Well, actually UNDER 5 minutes!!

    SB CYBRA PPL 5382

    TRY the one package that solves all your document design and printing challenges on all your platforms.

    Produce bar code labels, electronic forms, ad hoc reports, and RFID tags – without programming! MarkMagic is the only document design and print solution that combines report writing, WYSIWYG label and forms design, and conditional printing in one integrated product.

    Request your trial now!

  • Backup and Recovery on IBM i: Your Strategy for the Unexpected

    FortraRobot automates the routine tasks of iSeries backup and recovery, saving you time and money and making the process safer and more reliable. Automate your backups with the Robot Backup and Recovery Solution. Key features include:
    - Simplified backup procedures
    - Easy data encryption
    - Save media management
    - Guided restoration
    - Seamless product integration
    Make sure your data survives when catastrophe hits. Try the Robot Backup and Recovery Solution FREE for 30 days.

  • Manage IBM i Messages by Exception with Robot

    SB HelpSystems SC 5413Managing messages on your IBM i can be more than a full-time job if you have to do it manually. How can you be sure you won’t miss important system events?
    Automate your message center with the Robot Message Management Solution. Key features include:
    - Automated message management
    - Tailored notifications and automatic escalation
    - System-wide control of your IBM i partitions
    - Two-way system notifications from your mobile device
    - Seamless product integration
    Try the Robot Message Management Solution FREE for 30 days.

  • Easiest Way to Save Money? Stop Printing IBM i Reports

    FortraRobot automates report bursting, distribution, bundling, and archiving, and offers secure, selective online report viewing.
    Manage your reports with the Robot Report Management Solution. Key features include:

    - Automated report distribution
    - View online without delay
    - Browser interface to make notes
    - Custom retention capabilities
    - Seamless product integration
    Rerun another report? Never again. Try the Robot Report Management Solution FREE for 30 days.

  • Hassle-Free IBM i Operations around the Clock

    SB HelpSystems SC 5413For over 30 years, Robot has been a leader in systems management for IBM i.
    Manage your job schedule with the Robot Job Scheduling Solution. Key features include:
    - Automated batch, interactive, and cross-platform scheduling
    - Event-driven dependency processing
    - Centralized monitoring and reporting
    - Audit log and ready-to-use reports
    - Seamless product integration
    Scale your software, not your staff. Try the Robot Job Scheduling Solution FREE for 30 days.