Subscribe

Share

Mobile

Extending Mobile Apps

Add maps, cameras, and browser support to your Oracle Mobile Application Accelerator app.

By Chris Muir

March/April 2017

In “Empowering the Mobile Citizen Developer,” I covered how to create a basic phone book application for your staff in Oracle’s citizen development tool: Oracle Mobile Application Accelerator. The result was a very simple app listing all company employees and their phone numbers, and it didn’t require me to write a single line of code. The app was rudimentary, with two pages: one a list view of employees and the other a detail page for a selected employee, which then enabled me to phone or email them.

This article explores how easy it is for everyday business users to use Oracle Mobile Application Accelerator to add support for maps and the camera and the ability to launch an in-app browser to view web pages. In the context of my existing phone book app, this will enable me to show the location of employees, take photos of employees to update their photographs, and open websites with other content about the employee.

Prerequisites

Much as in the prerequisites section of the previous Oracle Mobile Application Accelerator article, to follow along with the steps in this article, you will need access to Oracle Mobile Cloud Service, which you can obtain by signing up for a free trial on the Oracle Mobile Cloud Service home page. After signing up for the trial and receiving approval, watch and follow the instructions in the video on how to set up and provision your Oracle Mobile Cloud Service instance.

Also much as you did in the previous article’s prerequisites section, you need to set up two team members, Jeff the service developer, who will work with the Oracle Mobile Cloud Service APIs used by the Oracle Mobile Application Accelerator application, and Bob the business developer, who will build the Oracle Mobile Application Accelerator application based on the Oracle Mobile Cloud Service APIs built by Jeff. Finally, you will need to create Mary the mobile user, who will actually use the Oracle Mobile Application Accelerator application built by Bob.

Now I can pick up the app where I left off in the last Oracle Mobile Application Accelerator article. From a tutorial perspective, because I can’t guarantee that you completely implemented the previous article’s API and application and because I’ve made some changes to the underlying employee API the app relies on in this article, you’ll reimport these. Watch the following video, where I demonstrate how to import a new version of the API, quickly demonstrate how I built the app in the previous article, and finally demonstrate an export of the app for you to import. Before watching the video, download the exported API and exported Oracle MAX app source code. Then follow the steps in video 01.

Video 1

Adding a Map

Inherently, mobile devices are, well, mobile, because users roam the world during their daily lives. As a result, maps and locations are a core feature of mobile applications. Map and location features include showing the user’s current location, the location of another person or place, or even a range of locations plotted as markers so you can see their relative distances from each other.

The implementation of maps is somewhat more complex than a marker on a map image, though. A location can be identified by a latitude and a longitude, which are relatively easy to plot, but there are also more-complex use cases, such as where only a human-readable address is available.

Both of these use cases—that is, the ability to plot one or more locations with latitude and longitude or addresses—are supported by Oracle Mobile Application Accelerator. Check out video 02 for details on how to do this.

Video 2

Adding Camera Support

My app also shows pictures of all employees, a handy feature that enables users to put faces to names. But, of course, employees change over time: they grow a few gray whiskers, change their hair, or grow two heads. Given these kinds of changes, it would be good to give users of my app the ability to upload new photos to keep their pictures up to date.

To add support for updating an employee’s picture, the underlying REST API needs to support an explicit POST API for updating employee photos. In the API you’ve uploaded for this article, I’ve provided this for you as POST employees/:id/updatePhoto. Watch video 03 to see how I add camera support to update an employee’s image.

Video 3

Add Support to Launch In-App Browser

Employees also have their own home pages and other relevant links, such as Twitter and Facebook. It would be handy to be able to open links to these and other websites in my application, in a separate browser session inside the app.

Adding support for hyperlinks is as easy as having URIs in the data returned from the APIs and mapping the resulting fields to a “Link” field type. Watch video 04 to see how.

Video 4

Conclusion

From the perspective of a “traditional” mobile developer, adding maps, camera, and in-app browser support to mobile apps takes a considerable amount of coding and configuration. From the perspective of an Oracle Mobile Application Accelerator business developer, adding this functionality to your mobile apps is easy. As you’ve seen in this article’s videos, you can expand your app’s functionality with just a few clicks.

Next Steps

READ more about Oracle Mobile Cloud Service.

WATCH Oracle Mobile Cloud Service YouTube training.

JOIN the Oracle Mobile LinkedIn community.

TRY Oracle Mobile Cloud Service.

DOWNLOAD

FOLLOW Oracle Mobile Cloud Service on Twitter.

 

Photography by Raw Pixel, Unsplash