Skip to Content
Technical Articles

Export client usage from SAP Cloud Platform Mobile Services

Motivation

Do you develop mobile applications with SAP Cloud Platform SDK for iOS and Android and do you capture behavior events? Do you like the built-in analytical capabilities of SAP Cloud Platform Mobile Services but those are either not flexible enough or not sufficient?

In this blog post, I will help you to understand how to export client usage information in various ways.

Option 1: Export to File

You can download client usage (as well as client feedback) data into a file. This file is a comma-separated values (CSV) file.

An example of a downloaded client usage report is posted below.

Option 2: Export to System

You can export client usage data directly to a system of your choice.

The specified endpoint has to be capable to handle the predefined OData schema listed below.

<?xml version="1.0" encoding="utf-8"?>
<edmx:Edmx Version="1.0" xmlns:edmx="http://schemas.microsoft.com/ado/2007/06/edmx">
   <edmx:DataServices m:DataServiceVersion="2.0" xmlns:m="http://schemas.microsoft.com/ado/2007/08/dataservices/metadata">
      <Schema Namespace="com.sap.mobile.server.clientusage.export.odata.v1" xmlns="http://schemas.microsoft.com/ado/2008/09/edm">
         <EntityType Name="ClientUsage">
            <Key>
               <PropertyRef Name="InstanceId"/>
               <PropertyRef Name="ReportId"/>
               <PropertyRef Name="OrderInReport"/>
            </Key>
            <Property Name="InstanceId" Type="Edm.String" MaxLength="64" Nullable="false"/>
            <Property Name="ReportId" Type="Edm.String" MaxLength="256" Nullable="false"/>
            <Property Name="OrderInReport" Type="Edm.Int32" Nullable="false"/>
            <Property Name="Application" Type="Edm.String" MaxLength="256" Nullable="true"/>
            <Property Name="ApplicationVersion" Type="Edm.String" MaxLength="64" Nullable="true"/>
            <Property Name="Deviceid" Type="Edm.String" MaxLength="256" Nullable="true"/>
            <Property Name="DeviceModel" Type="Edm.String" MaxLength="256" Nullable="true"/>
            <Property Name="Platform" Type="Edm.String" MaxLength="256" Nullable="true"/>
            <Property Name="PlatformVersion" Type="Edm.String" MaxLength="256" Nullable="true"/>
            <Property Name="Appsessionid" Type="Edm.String" MaxLength="256" Nullable="true"/>
            <Property Name="Usersessionid" Type="Edm.String" MaxLength="256" Nullable="true"/>
            <Property Name="RecordId" Type="Edm.String" MaxLength="256" Nullable="true"/>
            <Property Name="Recordkey" Type="Edm.String" MaxLength="256" Nullable="true"/>
            <Property Name="RecordType" Type="Edm.String" MaxLength="256" Nullable="true"/>
            <Property Name="IType" Type="Edm.String" MaxLength="256" Nullable="true"/>
            <Property Name="IScreen" Type="Edm.String" MaxLength="256" Nullable="true"/>
            <Property Name="IView" Type="Edm.String" MaxLength="256" Nullable="true"/>
            <Property Name="IElement" Type="Edm.String" MaxLength="256" Nullable="true"/>
            <Property Name="IAction" Type="Edm.String" MaxLength="256" Nullable="true"/>
            <Property Name="IBehavior" Type="Edm.String" MaxLength="256" Nullable="true"/>
            <Property Name="IResult" Type="Edm.String" MaxLength="256" Nullable="true"/>
            <Property Name="ICase" Type="Edm.String" MaxLength="256" Nullable="true"/>
            <Property Name="ICategory" Type="Edm.String" MaxLength="256" Nullable="true"/>
            <Property Name="IUnit" Type="Edm.String" MaxLength="256" Nullable="true"/>
            <Property Name="IMeasurement" Type="Edm.String" MaxLength="256" Nullable="true"/>
            <Property Name="IValue" Type="Edm.String" MaxLength="256" Nullable="true"/>
            <Property Name="Timerstart" Type="Edm.DateTime" Nullable="true"/>
            <Property Name="Timerduration" Type="Edm.Decimal" Precision="22" Scale="10" Nullable="true"/>
            <Property Name="Recordtimestamp" Type="Edm.DateTime" Nullable="true"/>
            <Property Name="Extrajson" Type="Edm.String" Nullable="true"/>
            <Property Name="Created" Type="Edm.DateTime" Nullable="false"/>
            <Property Name="UserName" Type="Edm.String" MaxLength="256" Nullable="true"/>
            <Property Name="SpaceId" Type="Edm.String" MaxLength="128" Nullable="true"/>
         </EntityType>
         <EntityType Name="ClientFeedback">
            <Key>
               <PropertyRef Name="InstanceId"/>
               <PropertyRef Name="ReportId"/>
               <PropertyRef Name="OrderInReport"/>
            </Key>
            <Property Name="InstanceId" Type="Edm.String" MaxLength="64" Nullable="false"/>
            <Property Name="ReportId" Type="Edm.String" MaxLength="256" Nullable="false"/>
            <Property Name="OrderInReport" Type="Edm.Int32" Nullable="false"/>
            <Property Name="Recordtimestamp" Type="Edm.DateTime" Nullable="false"/>
            <Property Name="Application" Type="Edm.String" MaxLength="256" Nullable="true"/>
            <Property Name="ApplicationVersion" Type="Edm.String" MaxLength="64" Nullable="true"/>
            <Property Name="Platform" Type="Edm.String" MaxLength="256" Nullable="true"/>
            <Property Name="PlatformVersion" Type="Edm.String" MaxLength="256" Nullable="true"/>
            <Property Name="Deviceid" Type="Edm.String" MaxLength="256" Nullable="true"/>
            <Property Name="DeviceModel" Type="Edm.String" MaxLength="256" Nullable="true"/>
            <Property Name="Context" Type="Edm.String" MaxLength="256" Nullable="true"/>
            <Property Name="Score" Type="Edm.Decimal" Precision="2" Scale="0" Nullable="true"/>
            <Property Name="Comment" Type="Edm.String" MaxLength="256" Nullable="true"/>
            <Property Name="Created" Type="Edm.DateTime" Nullable="true"/>
            <Property Name="UserName" Type="Edm.String" MaxLength="256" Nullable="true"/>
            <Property Name="SpaceId" Type="Edm.String" MaxLength="128" Nullable="true"/>
         </EntityType>
         <EntityContainer Name="ClientUsageService" m:IsDefaultEntityContainer="true">
            <EntitySet Name="ClientUsage" EntityType="com.sap.mobile.server.clientusage.export.odata.v1.ClientUsage"/>
            <EntitySet Name="ClientFeedback" EntityType="com.sap.mobile.server.clientusage.export.odata.v1.ClientFeedback"/>
         </EntityContainer>
      </Schema>
   </edmx:DataServices>
</edmx:Edmx>

Option 3: Send data straight from client

You don’t have to upload the captured client usage information from your apps to SAP Cloud Platform Mobile Services in the first place. On the client-side custom reporters and uploaders can be implemented to support different communication protocols, data structures, and servers.

Detailed information can be found in the respective API reference of the SDK. Here for SAP Cloud Platform SDK for iOS

What Next?

In a future blog post, I will show you how to use the exported client usage information and create custom, powerful data visualization with a BI tool.

Be the first to leave a comment
You must be Logged on to comment or reply to a post.