Skip to Content
Author's profile photo Former Member

An experiment of Android with HANA

In this article I will discuss regarding experimenting the mobile UI for HANA. In particular about Android based chart showing the data coming from HANA.

I took a simple retail scenario using which I wanted to know about a product’s performance across various stores vis-a-vis quantity and price. I created a simple bar chart with X axis being the product name or store name and Y Axis being the quantity or total price of products. In my case I wanted to look into the product quality so as to check all the refunded product aggregations. In the practical scenario this would give the user an idea regarding how a product is performing in any geographical region or worst case if overall it isn’t doing well at all. Many actions could be triggered based on these evaluations.

I am listing below the step-by-step information of various tool usages and process to create this above business scenario’s prototype.

     Step1: Install HANA studio by taking the latest release. You can this link from the HANA community.

     Step2: Build your schema and load the data.

      In my case I created the transaction table which is from the POS(Point of Sale) counters. In this data I had the store name,      material/product name and transaction type such as ‘Refund’ or ‘Sale’ type and product actual price.

Step3: Download the Android Development Environment. Install the ADT plug-in for the eclipse.

Step4: I needed the chart library to display the bar chart on the android mobile app. I used the “achartengine” open source library to display a bar graph.

Apart from the above required software you would need Netweaver server and studio to develop & deploy the servlet.

The three layered architecture to consume the data is shown in the diagram below:

Apart from the above required software you would need Netweaver server and studio to develop & deploy the servlet.

The three layered architecture to consume the data is shown in the diagram below:

Apart from the above required software you would need Netweaver server and studio to develop & deploy the servlet.

The three layered architecture to consume the data is shown in the diagram below:

In the Android layer (UI) layer I implemented the following:

  1. Main android activity which fetches the data from the servlet using the HTTP GET.
  2. Data model of “Product & Quality” data which is stored in the list.
  3. Setting dialog is implemented to change the X-Axis and Y-Axis. X-Axis can be Product Name or Store Name and. Y-Axis can be quantity and total actual price.

Using the achartengine API chart gets displayed in the main view.

In the Android layer (UI) layer I implemented the following:

  1. Main android activity which fetches the data from the servlet using the HTTP GET.
  2. Data model of “Product & Quality” data which is stored in the list.
  3. Setting dialog is implemented to change the X-Axis and Y-Axis. X-Axis can be Product Name or Store Name and. Y-Axis can be quantity and total actual price.

Using the achartengine API chart gets displayed in the main view.

/wp-content/uploads/2012/06/image_jpeg_108156.jpg

In the Android layer (UI) layer I implemented the following:

  1. Main android activity which fetches the data from the servlet using the HTTP GET.
  2. Data model of “Product & Quality” data which is stored in the list.
  3. Setting dialog is implemented to change the X-Axis and Y-Axis. X-Axis can be Product Name or Store Name and. Y-Axis can be quantity and total actual price.

Using the achartengine API chart gets displayed in the main view.

In the Android layer (UI) layer I implemented the following:

  1. Main android activity which fetches the data from the servlet using the HTTP GET.
  2. Data model of “Product & Quality” data which is stored in the list.
  3. Setting dialog is implemented to change the X-Axis and Y-Axis. X-Axis can be Product Name or Store Name and. Y-Axis can be quantity and total actual price.

Using the achartengine API chart gets displayed in the main view.

/wp-content/uploads/2012/06/21638_307_517_cache_108157.jpg

Product and Quantity – “Article-3” is being refunded the most.

The servlet was implemented within the net weaver layer which fetches the data using the calculation View of the HANA newDB. This servlet currently returns a simple string response using comma as column separator and line break for the next record.

The HANA studio was used to create the POS transaction table and the sample data was loaded. Calculation view is created to fetch the data from the columnar POS transaction table and aggregate it across Product and Store id with quantity and actual price as measure.

Here is the screen shot of the simulator display for Android:

/wp-content/uploads/2012/06/21645_316_532_cache_108161.jpg

Conclusion :

The above retail example shows the feasibility of HANA to be consumed via mobile. I see unlimited potential of mobile apps consuming RESTful API’s (via HTTP GET /POST) or web services as HANA new DB provides the power of analytics in milliseconds.

I think we have huge potential of using HANA within mobile application and perform real real-time analytics on hand held devices for various industries.

Assigned Tags

      5 Comments
      You must be Logged on to comment or reply to a post.
      Author's profile photo Former Member
      Former Member

      Very informative blog. Thanks for sharing your knowledge.

      Author's profile photo Former Member
      Former Member
      Blog Post Author

      Hello Raghavendra,

      Thanks a lot

      Author's profile photo Former Member
      Former Member

      Good Experiment Sha .Yes now even HANA can be directly connected to gateway system using IW_HDB  component , now the generating oData Services will become easy with this option I believe.

      http://help.sap.com/saphelp_gateway20sp04/helpdata/en/33/0e14f0590b48318ea38b3a06a92d17/frameset.htm

      Thanks

      Santosh

      Author's profile photo Rakshit Doshi
      Rakshit Doshi

      Can you please elaborate with the links from where to download and setup the schema for HANA and does android require any code to get the data...kindly update on this please

      Author's profile photo Former Member
      Former Member

      Thanks for telling us the RESTful API for SAP HANA. I like to see some codes, how do implement it i.e. getting the data to graph api.

      I think we can easily use RESTful API for SAP HANA for Hybrid mobile apps as well. We can use D3 and g.raphael for graphs. Using hybrid framework (Xcode (Objective-C) / Java + HTML5, CSS3, jQuery) we can develop for iOS, Android, WP7, Blackberry, WebOS, etc.

      Using AJAX in jQuery we can easily post and get data from SAP HANA Restful API to mobile apps.

      Thanks.

      Noli