developing synchronized mobile apps with sap mobile platform
DESCRIPTION
Watch TechEd Replay: http://www.sapvirtualevents.com/teched/sessiondetails.aspx?sid=3391 Synchronized mobile application enables process workers to work in mission-critical environments and have access to the needed data on their mobile devices anywhere, at any time. We will take attendees through the various steps of the development process for a synchronized mobile application as well as show data modeling of the mobile business objects and code generation of the native synchronization layers.TRANSCRIPT
Venugopal. N
MOB102
Developing Synchronized Mobile Applications with Sybase Unwired Platform
© 2012 SAP AG. All rights reserved. 2
Disclaimer
This presentation outlines our general product direction and should not be relied on in making a
purchase decision. This presentation is not subject to your license agreement or any other agreement
with SAP. SAP has no obligation to pursue any course of business outlined in this presentation or to
develop or release any functionality mentioned in this presentation. This presentation and SAP's
strategy and possible future developments are subject to change and may be changed by SAP at any
time for any reason without notice. This document is provided without a warranty of any kind, either
express or implied, including but not limited to, the implied warranties of merchantability, fitness for a
particular purpose, or non-infringement. SAP assumes no responsibility for errors or omissions in this
document, except if such damages were caused by SAP intentionally or grossly negligent.
© 2012 SAP AG. All rights reserved. 3
Agenda
SAP Mobility Platform
Overview
Synchronized Mobile Applications
What is it?
Mobility Considerations
Synchronized apps from SAP
Developing Synchronized Mobile Applications
• The MBO concept
• Create and Configure MBOs
© 2012 SAP AG. All rights reserved. 4
SAP mobile platform
SAP, Partner, and Custom Apps
SAP Mobile Platform
Presentation Frameworks
SAP Afaria
Third Party App Dev Tools SAP App Dev Tools
Native Apps Hybrid Container Apps HTML5 Apps SMS Apps
Application Services
Foundation Services
Notification Authentication oData Proxy App Lifecycle Managment
Data Sync & Caching …
App Catalog
Application
Management
Device
Management
This presentation and SAP‘s strategy and possible future developments are subject to change and may be changed by SAP at any time for any reason without notice. This document is provided without a warranty of any
kind, either express or implied, including but not limited to, the implied warranties of merchantability, fitness for a particular purpose, or non-infringement
SAP Business Suite Third Party Apps Databases Sybase 365
SAP NetWeaver
Gateway
Synchronized Mobile Applications
© 2012 SAP AG. All rights reserved. 6
What is a Synchronized Application?
Provides information needed to the end-user even when not connected, based on a set of defined rules
Effectively utilizes network connectivity to ensure reliable data availability even in challenging network environments
Ensures efficient data provisioning to the devices in case of large scale data realignment scenarios (changing organizational structures, territory realignments)
Leverages local device resources to ensure high performance
© 2012 SAP AG. All rights reserved. 7
Key Considerations When Making Data Mobile
Conflict Detection and Resolution
Creation of Associated Entities while Offline
Error Handling in Async communication
Delta Data Determination between Device and Backend
Lifecycle of Distributed Data / Data Models
© 2012 SAP AG. All rights reserved. 8
SAP Mobile Applications
SAP CRM Sales
SAP Field Service
SAP Retail Execution
SAP EAM Work Order
SAP Employee Productivity Apps Human Resources SAP Employee Lookup
SAP Leave Request
SAP Time Capture
SAP HR Approvals
Procurement SAP Shopping Cart Approvals
SAP SRM Supplier Search
SAP Quality Issue
Finance SAP Travel Receipt Capture
SAP Travel Report
SAP Travel Expense Approvals
SAP Payment Approvals
Sales SAP Sales Order Notification
SAP Material Availability
SAP Customers and Contacts
SAP Customer Financial Factsheet
SAP Order Status
Synchronized Apps Online Apps
Developing Synchronized Mobile Applications
© 2012 SAP AG. All rights reserved. 10
The synchronization architecture is based on a Cache DB that resides on the SUP Server, and
replicates and/or messages updates to the Client DB.
Synchronization Approach – Cache-based
Enterprise
System
Data
Repository
Operations Client
DB
Load Operations (with
parameters) to retrieve
data from EIS
Invoke the corresponding
mapped EIS Operations
Operation Replay: operations
executed in Client DB are
replayed on Cache DB
Operations defined in the MBO are
generated in Object API class files
Cache Device
Operations are filtered by
Synchronization
Parameters
SUP
Server
Cache
DB
Fill Filter
© 2012 SAP AG. All rights reserved. 11
Introduction to Modeling in SUP
The mobile platform allows you to
define a mobile data model
deploy the model to an SUP server
keep the model in sync between devices, SUP server, and EIS (Enterprise Information System).
What is available?
Design tools for creating a model, and (optionally) building UI components
Server components for managing the model and integrating with the backend EIS
Client stack for maintaining the client-side aspect of the model, and supporting the application
A ‘pipe’ for delivering data and maintaining client-server synchronization
Management and administration tools
© 2012 SAP AG. All rights reserved. 12
The key to SUP is the concept of a data model: this represents the essence of what is being
mobilized.
Central to this data model are MBOs – Mobile Business Objects.
An MBO is basically a tabular representation of some entity that you want represented on the
device.
Each MBO is designed to interact with an Enterprise Information System (EIS), and provides a
standardised view of this interaction.
Mobile Business Objects
© 2012 SAP AG. All rights reserved. 13
MBOs define a set of
attributes, and one or more
operations.
Device applications don’t need
to worry about the EIS
integration, and only need to be
concerned about this
‘standardised’ MBO model.
Mobile Business Objects
Enterprise System Device Representation
Subset Personalize Mobilize
© 2012 SAP AG. All rights reserved. 14
Mobile Business Objects
MBO’s in SUP 2.x are the data interface to two development API’s:
Native Object API
HTML5/JavaScript Container API
Develop
Mobile
Business
Objects
Deploy Mobile
Business
Objects to
Unwired Server
Deploy and
Test in
Simulator
Deploy and
Test on
Device
Generate
Native Object
Code
Generate
HTML5/JavaS
cript Code
Develop
Native
Application
Develop
Hybrid
Application
SUP Development Task Flow
© 2012 SAP AG. All rights reserved. 15
MBO-based Apps Development
The behavior of the MBO, and the development practices are different for each API.
Native Object API: MBO configures server for synchronization, client DB & objects, and
generates query methods in Native Object API
HTML5/JS Container API: MBO configures server cache, creates HTML5 storage key-
value structure, and generates request methods in JavaScript API
Develop
Mobile
Business
Objects
Deploy Mobile
Business
Objects to
Unwired Server
Deploy and
Test in
Simulator
Deploy and
Test on
Device
Generate
Native Object
Code
Generate
HTML5/JavaS
cript Code
Develop
Native
Application
Develop
Hybrid
Application
SUP Development Task Flow
© 2012 SAP AG. All rights reserved. 16
Native Object API MBO
Data
Source
SUP
Server
Cache
DB
Synchronization
Cache Refresh
Client
DB
Client
DB
Client
DB
The synchronization architecture is based on a Cache DB that resides on the SUP Server, and
replicates and/or messages updates to the Client DB
© 2012 SAP AG. All rights reserved. 17
Native Object API MBO
Data
Source SUP
Server
Cache
DB
Client
DB
Cache content
(data filtering)
Cache DB
Operations
Cache Refresh
frequency Synchronization
Parameters
Synchronization
frequency
Client DB schema
Object Class files
Query & Operation
methods
The MBO provides configuration for all aspects of the architecture
© 2012 SAP AG. All rights reserved. 18
Native Object API MBO
MBO Properties include:
Attributes
• Data Source, Type, Connection Settings
Operations
• Bind to Existing Operations, or Add New
Relationships
• Mappings, Complex Types
Object Queries
• Query methods generated in Object Classes
Synchronization Settings
• Rules, Partitions
© 2012 SAP AG. All rights reserved. 19
Native Object API MBO: Data Schema
The MBO maps EIS columns as attributes of an Object
When the client code files are generated, they include the Class files with the attributes and types; the Client
DB creates tables for the Objects at runtime
When the MBO is deployed to the SUP Server, the Cache DB creates tables for the Objects, and a table for
maintaining synch-parameter partitions
Enterprise
System
Data
Repository
Operations Cache
DB
Client
DB
© 2012 SAP AG. All rights reserved. 20
Native Object API MBO: Operations
Operations Properties include:
Data Source
• Stored as a Connection Profile
Parameters
• Name, Type, Nullability, Required
• Mapping: Variable (Personalization Key) mapping, rules for updating
on device, old-value rules
Roles
• Rules for Logical and Physical roles
Cache Update Policy
• On Demand, Scheduled, DCN
Synchronization Settings
© 2012 SAP AG. All rights reserved. 21
Native Object API MBO: Operations
Operations are staged from EIS to Cache, Cache to Client, and vis versa
Enterprise
System
Data
Repository
Operation
s
Client
DB
Load Operations (with
parameters) to retrieve
data from EIS
Invoke the corresponding
mapped EIS Operations
Operation Replay: operations
executed in Client DB are
replayed on Cache DB
Operations defined in the MBO are
generated in Object API class files
Cache Device
Operations are filtered by
Synchronization
Parameters
SUP
Server
Cache
DB
Fill Filter
© 2012 SAP AG. All rights reserved. 22
Example: Synchronization Parameter
Customer ID Name Address City State
1 Intel 1 Intel Drive Santa Clara CA 2 Cisco 1 Cisco Way San Jose CA 3 Ultra 1 Ultra Lane Santa Clara UT 4 AMD 1 AMD Ave Santa Clara CA 5 Oracle 1 Oracle Lane Redwood Shores CA 6 Qualcomm 1 Qualcomm Way San Diego CA 7 HP 1 HP Drive Santa Clara CA
Definition: SELECT * FROM Customer Data Source Type: SampleDB (SQL Anywhere) database Fill: Data is retrieved by executing the Load Operation (SELECT …)
Filter: This MBO has one synchronization parameter [city] Mobile application sets the synchronization parameter prior to performing synchronization to ‘Santa Clara’
Customer ID Name Address City State 1 Intel 1 Intel Drive Santa Clara CA 3 Ultra 1 Ultra Lane Santa Clara UT 4 AMD 1 AMD Ave Santa Clara CA 7 HP 1 HP Drive Santa Clara CA
Ca
ch
e D
B
Cli
en
t D
B
© 2012 SAP AG. All rights reserved. 23
Example: Load and Synchronization Parameters
Definition: SELECT * FROM Customer WHERE State = ? Data Source Type: SampleDB database Fill: Data is retrieved by executing the Load Operation with the load parameter set to ‘CA’
Filter: This MBO has one synchronization parameter [city] Mobile application sets the synchronization parameter prior to performing synchronization to ‘Santa Clara’
Customer ID Name Address City State 1 Intel 1 Intel Drive Santa Clara CA 3 Ultra 1 Ultra Lane Santa Clara UT 4 AMD 1 AMD Ave Santa Clara CA 7 HP 1 HP Drive Santa Clara CA
Customer ID Name Address City State
1 Intel 1 Intel Drive Santa Clara CA
2 Cisco 1 Cisco Way San Jose CA
4 AMD 1 AMD Ave Santa Clara CA
5 Oracle 1 Oracle Lane Redwood Shores CA
6 Qualcomm 1 Qualcomm Way San Diego CA
7 HP 1 HP Drive Santa Clara CA
Ca
ch
e D
B
Cli
en
t D
B
© 2012 SAP AG. All rights reserved. 24
Development Task Flow
MBO Definition is the first step of developing mobile applications with the Native Object API
Developers will also use the Eclipse tooling to deploy the MBO to SUP Server, and to generate
the Object code (Client API)
We will discuss stages 1-3 for the Native Object API task flow
Develop
Mobile
Business
Objects
Deploy Mobile
Business
Objects to
Unwired Server
Deploy and
Test in
Simulator
Deploy and
Test on
Device
Generate
Native Object
Code
Generate
HTML5/JavaS
cript Code
Develop
Native
Application
Develop
Hybrid
Application
SUP Development Task Flow
© 2012 SAP AG. All rights reserved. 25
Develop Mobile Business Objects
SUP provides an Eclipse plugin (WorkSpace) with a set of connector wizards for connection to
standard data sources:
SAP ECC (RFC, BAPI)
JDBC (Oracle, DB2, SQL Anywhere, SQL Server)
Web Services (SOAP, REST)
Develop
Mobile
Business
Objects
Deploy Mobile
Business
Objects to
Unwired Server
Deploy and
Test in
Simulator
Deploy and
Test on
Device
SUP Native Object API Development Task Flow
1
Develop
Native
Application
Generate
Native Object
Code
© 2012 SAP AG. All rights reserved. 26
Develop Mobile Business Objects
Once the connection to the data source is made, the Eclipse Explorer allows the developer to
navigate the data source schema /or services
Search ECC modules for BAPI’s
View database tables
View service definitions
Develop
Mobile
Business
Objects
Deploy Mobile
Business
Objects to
Unwired Server
Deploy and
Test in
Simulator
Deploy and
Test on
Device
SUP Native Object API Development Task Flow
Develop
Native
Application
Generate
Native Object
Code
1
© 2012 SAP AG. All rights reserved. 27
Develop Mobile Business Objects
Developers can select from the exposed services, and drag-and-drop the service to the ‘MBO
Diagram’ canvas to create the MBO
Develop
Mobile
Business
Objects
Deploy Mobile
Business
Objects to
Unwired Server
Deploy and
Test in
Simulator
Deploy and
Test on
Device
SUP Native Object API Development Task Flow
Develop
Native
Application
Generate
Native Object
Code
1
© 2012 SAP AG. All rights reserved. 28
Develop Mobile Business Objects
For Services/BAPIs, a wizard is provided which identifies inputs/outputs, and allows
developers to select only the parameters relevant to the use case
For example, a BAPI which creates a workflow
notification may take 3 mandatory inputs, 6 optional
inputs, and return 110 attributes, of which only 6 are
relevant to the mobile UI.
The unnecessary attributes can be left out of the MBO
Develop
Mobile
Business
Objects
Deploy Mobile
Business
Objects to
Unwired Server
Deploy and
Test in
Simulator
Deploy and
Test on
Device
SUP Native Object API Development Task Flow
Develop
Native
Application
Generate
Native Object
Code
1
© 2012 SAP AG. All rights reserved. 29
Develop Mobile Business Objects
For all data sources, the wizard provides ‘preview’ execution to test the connection and
parameter behavior
Develop
Mobile
Business
Objects
Deploy Mobile
Business
Objects to
Unwired Server
Deploy and
Test in
Simulator
Deploy and
Test on
Device
SUP Native Object API Development Task Flow
Develop
Native
Application
Generate
Native Object
Code
1
© 2012 SAP AG. All rights reserved. 30
Relationships and Structures can be designed in the MBO Diagram
Relationships are defined between MBOs by linking
attributes and parameters in one MBO to attributes and
parameters in another MBO
• One to Many, One to One, Many to One
• Composite (N/A for Many to One)
• Bi-Directional
Develop Mobile Business Objects
Develop
Mobile
Business
Objects
Deploy Mobile
Business
Objects to
Unwired Server
Deploy and
Test in
Simulator
Deploy and
Test on
Device
SUP Native Object API Development Task Flow
Develop
Native
Application
Generate
Native Object
Code
1
© 2012 SAP AG. All rights reserved. 31
Develop Mobile Business Objects
MBO configurations: Personalization Keys, Synchronization Groups, Cache Groups, etc. are
defined in the Eclipse tooling in the Properties and WorkSpace Navigator windows.
Develop
Mobile
Business
Objects
Deploy Mobile
Business
Objects to
Unwired Server
Deploy and
Test in
Simulator
Deploy and
Test on
Device
SUP Native Object API Development Task Flow
Develop
Native
Application
Generate
Native Object
Code
1
© 2012 SAP AG. All rights reserved. 32
Deploy Mobile Business Objects
Related MBO’s are grouped within a package for deployment to SUP Server
Data belonging to the MBO’s within the package is staged on the Unwired Platform for
synchronization. Staged data is loaded via Load Operations
Packages can be versioned, and multiple versions of a package can be running
simultaneously, with duplication costs
Packages can be modified in a variety of modes during development (update, replace, etc.),
but a production package should not be modified
Develop
Mobile
Business
Objects
Deploy Mobile
Business
Objects to
Unwired Server
Deploy and
Test in
Simulator
Deploy and
Test on
Device
SUP Native Object API Development Task Flow
Develop
Native
Application
Generate
Native Object
Code
2
© 2012 SAP AG. All rights reserved. 33
Generate Native Object Code
Use the Eclipse tooling to generate the Object Code for your target platform(s)
Supported languages include: Objective-C, C#, and Java (ME for BlackBerry)
Select the synchronization type. In SUP 2.0.x, C# and Java support replication-based, and
iOS devices use messaging-based.
Select output setting: Page Size, name/namespace/prefix, metadata options
In addition to the generated code, access the Client API libraries from the install dir
Develop
Mobile
Business
Objects
Deploy Mobile
Business
Objects to
Unwired Server
Deploy and
Test in
Simulator
Deploy and
Test on
Device
SUP Native Object API Development Task Flow
Develop
Native
Application
Generate
Native Object
Code
3
© 2012 SAP AG. All rights reserved. 34
Further Information on Mobile
SAP Public Web
http://wiki.sdn.sap.com/wiki/display/mobile/
http://scn.sap.com/community/mobile
SAP Education and Certification Opportunities
www.sap.com/education
Watch SAP TechEd Online
www.sapteched.com/online
Feedback Please complete your session evaluation for MOB102.
Thanks for attending this SAP TechEd session.
© 2012 SAP AG. All rights reserved. 36
No part of this publication may be reproduced or transmitted in any form or for any purpose without the express
permission of SAP AG. The information contained herein may be changed without prior notice.
Some software products marketed by SAP AG and its distributors contain proprietary software components of
other software vendors.
Microsoft, Windows, Excel, Outlook, PowerPoint, Silverlight, and Visual Studio are registered trademarks of
Microsoft Corporation.
IBM, DB2, DB2 Universal Database, System i, System i5, System p, System p5, System x, System z, System
z10, z10, z/VM, z/OS, OS/390, zEnterprise, PowerVM, Power Architecture, Power Systems, POWER7,
POWER6+, POWER6, POWER, PowerHA, pureScale, PowerPC, BladeCenter, System Storage, Storwize,
XIV, GPFS, HACMP, RETAIN, DB2 Connect, RACF, Redbooks, OS/2, AIX, Intelligent Miner, WebSphere,
Tivoli, Informix, and Smarter Planet are trademarks or registered trademarks of IBM Corporation.
Linux is the registered trademark of Linus Torvalds in the United States and other countries.
Adobe, the Adobe logo, Acrobat, PostScript, and Reader are trademarks or registered trademarks of Adobe
Systems Incorporated in the United States and other countries.
Oracle and Java are registered trademarks of Oracle and its affiliates.
UNIX, X/Open, OSF/1, and Motif are registered trademarks of the Open Group.
Citrix, ICA, Program Neighborhood, MetaFrame, WinFrame, VideoFrame, and MultiWin are trademarks or
registered trademarks of Citrix Systems Inc.
HTML, XML, XHTML, and W3C are trademarks or registered trademarks of W3C®, World Wide Web
Consortium, Massachusetts Institute of Technology.
Apple, App Store, iBooks, iPad, iPhone, iPhoto, iPod, iTunes, Multi-Touch, Objective-C, Retina, Safari, Siri,
and Xcode are trademarks or registered trademarks of Apple Inc.
IOS is a registered trademark of Cisco Systems Inc.
RIM, BlackBerry, BBM, BlackBerry Curve, BlackBerry Bold, BlackBerry Pearl, BlackBerry Torch, BlackBerry
Storm, BlackBerry Storm2, BlackBerry PlayBook, and BlackBerry App World are trademarks or registered
trademarks of Research in Motion Limited.
© 2012 SAP AG. All rights reserved.
Google App Engine, Google Apps, Google Checkout, Google Data API, Google Maps, Google Mobile Ads,
Google Mobile Updater, Google Mobile, Google Store, Google Sync, Google Updater, Google Voice,
Google Mail, Gmail, YouTube, Dalvik and Android are trademarks or registered trademarks of Google Inc.
INTERMEC is a registered trademark of Intermec Technologies Corporation.
Wi-Fi is a registered trademark of Wi-Fi Alliance.
Bluetooth is a registered trademark of Bluetooth SIG Inc.
Motorola is a registered trademark of Motorola Trademark Holdings LLC.
Computop is a registered trademark of Computop Wirtschaftsinformatik GmbH.
SAP, R/3, SAP NetWeaver, Duet, PartnerEdge, ByDesign, SAP BusinessObjects Explorer, StreamWork,
SAP HANA, and other SAP products and services mentioned herein as well as their respective logos are
trademarks or registered trademarks of SAP AG in Germany and other countries.
Business Objects and the Business Objects logo, BusinessObjects, Crystal Reports, Crystal Decisions, Web
Intelligence, Xcelsius, and other Business Objects products and services mentioned herein as well as their
respective logos are trademarks or registered trademarks of Business Objects Software Ltd. Business Objects
is an SAP company.
Sybase and Adaptive Server, iAnywhere, Sybase 365, SQL Anywhere, and other Sybase products and services
mentioned herein as well as their respective logos are trademarks or registered trademarks of Sybase Inc.
Sybase is an SAP company.
Crossgate, m@gic EDDY, B2B 360°, and B2B 360° Services are registered trademarks of Crossgate AG
in Germany and other countries. Crossgate is an SAP company.
All other product and service names mentioned are the trademarks of their respective companies. Data
contained in this document serves informational purposes only. National product specifications may vary.
The information in this document is proprietary to SAP. No part of this document may be reproduced, copied,
or transmitted in any form or for any purpose without the express prior written permission of SAP AG.