SAP offline mobile solution overview

不问归期 提交于 2019-12-18 03:51:07

Created by Wang, Jerry, last modified on Aug 04, 2016

The offline enabled Fiori app is implemented as a prepackaged Cordova application built for the selected mobile platforms (currently iOS and Android platforms are supported). Apache Cordova is a set of device APIs that allow a mobile app developer to access native device function, such as the camera or accelerometer from JavaScript.

A prepackaged Cordova application contains SAP UI5 libraries with all the necessary Fiori controls and selected Cordova plugins extended with a subset of Kapsel plugins to provide access to the native device features for the JavaScript based Fiori SAP UI5 application. Kapsel is a set of SAP plugins for Apache Cordova. The Kapsel offline OData plugins contain the features for the offline enablement with the necessary local database that will store all the data required for the operation of the app. For more information about the Cordova plugins, see Kapsel Development

Kapsel – a set of SAP plugins for Apache Cordova to develop hybrid applications. The Kapsel plugins enable you to access SAP Mobile Platform features, such as application lifecycle management, logon and single sign-on functionality, and push notifications.

Kapsel is a set of SAP® plugins for Apache Cordova 3.5.
Apache Cordova provides a suite of APIs you can use to access native capabilities. The Cordova container provides JavaScript libraries that give you consistent APIs you can call the same way on any supported device. The Cordova container is simply a holder in which any APIs and extensions are implemented as plugins. Apache Cordova includes a command line interface for managing Cordova applications and the application development process.

Apache Cordova

Apache Cordova官方网站: http://cordova.apache.org/
Apache Cordova是PhoneGap贡献给Apache后的一款开源的移动开发框架,是从PhoneGap中抽出的核心代码,是驱动PhoneGap的核心引擎。在2010年10月,Apache Cordova成为Apache Software Foundation(ASF)的顶级项目。
Cordova只是一个Webview的架子,,在UI方面他不会管你页面是什么样子,也不会提供给你任何UI方面的功能,所以UI方面还要借助于jQuery Mobile、Sencha Touch、App Framework(jQMoby)、KendoUI Mobile、Adobe Topcoat、jQTouch、Ionic Framework、Onsen UI等等。
Cordova不提供UI组件和MV*框架,只提供能够调用Native API的接口和可执行的运行环境。它的功能十分强大,通过系列的插件,可以使用JavaScript访问原生的设备功能,如摄像头、麦克风、GPS等。

PhoneGap

PhoneGap is an HTML5 application platform that allows developers to author native applications using web technologies and provides access from
a WebKit WebView to native code. The paper made mention that PhoneGap makes use of a Java/JavaScript bridge in order to allow HTML/JavaScript
applications direct access to native code. There are many ways to attack a WebKit WebView; however the control that can be leveraged usually
does not provide the opportunity to interact with Java code. So this makes for a very interesting attack vector.
PhoneGap does not use a JavascriptInterface. Checking out the latest build from SVN and searching the source for the method
addJavascriptInterface confirmed this. - because of one known issue of Android
$ svn checkout https://svn.apache.org/repos/asf/incubator/callback/phonegap-android/trunk/
$ grep -r -n -i --include=*.java addJavascriptInterface *

In the com/phonegap/DroidGap.java source file there are three methods that are overridden – onJsAlert(), onJsConfirm() and onJsPrompt().
PhoneGap defines a callback/listener within the WebKit WebView that is notified whenever the JavaScript prompt() method is called (from JavaScript). In their callback method they check the parameters for an encoded task, execute it if found (or just return false if not) and then pass the result back to JavaScript via the JsPromptResult() as the onJsPrompt() function allows a string to be returned via the result object.

The following is what is sent when the API navigator.network.connection.type is called from JavaScript.

prompt(’[]’,‘gap:[“NetworkStatus”,“getConnectionInfo”,“NetworkStatus1”,true]’);

要获取更多Jerry的原创文章,请关注公众号"汪子熙":
公众号截图

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!