Tutorial: Displaying additional UserData in mobile native applications

In this tutorial, you learn how to display custom UserData in a mobile native application via REST services.

In the Tutorial: Extending a search profile to retrieve and display custom data in the storefront tutorial, you learned how to create more catalog data warranty and display it in the storefront by using the search-based catalog navigation noun. The purpose of this tutorial is to show you how to display the custom UserData Warranty in a mobile native application by using REST service.

REST services are built on top of OAGIS services. REST services use an access profile and XPath to get data from an OAGIS noun. The access profiles that are used by REST services are defined in a configuration file wc-rest-resourceconfig.xml. In this scenario, you need to extend the configuration file wc-rest-resourceconfig.xml to specify your custom access profile so that you can retrieve the custom user data.

Next, you extend the existing sample Android native application. You learn to work with the application code by adding a table row for warranty on the product display page to view related warranty information.

To add this new capability, there are several areas of the Android application where you must update code. First, you must extend the Product object and JSON parsing code to capture the related user data. This information is returned by the REST service but is not currently stored in the application. Next, you add a table row to the product display page to show the related product warranty information. To implement the new table row, you create an activity and provide a layout for the related page. Finally, you add your new activity to the application manifest file.

Developing mobile web application requires that you have an Android development environment setup. If you need instructions to complete this setup, consult the Android installation guide as noted in the System Requirements section of this document.

Note: This tutorial is valid for the Madisons starter store.
After completing this tutorial, you should be familiar with the following concepts:
  • REST Services
  • JavaScript Object Notation
After completing this tutorial, you should be familiar with the following tasks:
  • Specify a custom access profile to retrieve custom UserData by using REST services
  • Extend existing sample Android code to add information about the product page
  • Create an activity to retrieve custom warranty data

Time required

Expect this tutorial to take three hours to complete. The tutorial takes longer if you explore concepts that are related to this tutorial.

Skill level

This tutorial is intended for advanced WebSphere Commerce developers responsible for customizing the Mobile Native Application. To complete this tutorial, familiarize yourself with the following terms and concepts:
  • WebSphere Commerce search
  • REST service
  • XML
  • WebSphere Commerce Services
  • Rational databases
  • SQL
  • Mobile Native App
  • JsonParser

System requirements

Before you begin this tutorial, ensure that you completed the following tasks:


Before you start this tutorial, ensure that you completed the following prerequisites: