SAP OData offline store在Android平臺的技術實現
I am studying Kapsel OData offline plugin recently. In SAP help the source code of OData.js is provided:
The source code clearly conveys the idea documented in SAP help: “When an offline store is first opened, it synchronizes with the OData producer. OData requests made against this plugin use the available open offline stores.“.
And I am curious how this offline store is opened in the real application. So I use a CRM Fiori offline application to have a look.
(1) In offline project folder there is a config.xml, which defines the entry point for offline application access, the index.html file.
(2) Open this index.html, there is a script file “createStores.js”:
This file has constructed an object sap.smp.registration:
There is a public method setup exposed which accepts an array for offline store collection and call a private method _setupStore one by one. Once the asynchronous setup process is done successfully, callback success is called.
In implementation of _setupStore, the sap.OData.createOfflineStore(properties) and sap.OData.applyHttpClient() mentioned in sap help could be found.
(3) back to index.html, there is a file contentplace.js:
In this file, offline store will be opened in line 14, and application specific initialization is called in callback function defined in line 5.
(4) finally, the createContentPlaceFunction is called in index.html in line 196:
(5) Now check how OfflineStore open is implemented in Android platform via Java:
In line 215, offline store instance is created and a listener is registered, since open operation is done asynchronously:
And open operation is started here:
Check in ODataOfflineStore class, a new thread is created to perform open action:
In run method, the call is delegated back to ODataOfflineStore.openStoreSync:
The core open operation is done in this.store.open:
If open is done successfully, the listener registered in ODataOfflineStore instance will be notified with ODataOfflineStoreOpen state:
The core implementation of open method in Store class is implemented natively and could not be visible in Java stack:
要獲取更多Jerry的原創文章,請關注公眾號"汪子熙":
來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/24475491/viewspace-2724090/,如需轉載,請註明出處,否則將追究法律責任。
相關文章
- 在SAP雲平臺的CloudFoundry環境下消費ABAP On-Premise OData服務CloudREM
- SAP ABAP OData 服務的 $count 操作實現
- 使用SAP雲平臺的destination消費Internet上的OData service
- SAP Gateway Service Builder 裡的 OData 服務實現方式GatewayUI
- OData服務在SAP CRM,Cloud for Customer和S/4HANA上的實現比較Cloud
- SAP Emarsys 的前後臺技術棧
- Android技術棧(三)依賴注入技術的探討與實現Android依賴注入
- SAP 業務技術平臺(BTP) 上的 Business Rules Service 使用介紹
- Android技術分享| 【你畫我猜】Android 快速實現Android
- 在 Python 中實現 COMET 技術Python
- 如何用 SAP BTP 平臺上的圖形建模器建立一個 OData 服務
- 在 iOS 平臺實現Ping 和 tracerouteiOS
- 【聊技術】在Android中實現自適應文字大小顯示Android
- SAP 業務技術平臺(BTP) Workflow(工作流)功能介紹
- 構建實時資料整合平臺時,在技術選型上的考量點
- 基於Android平臺實現人臉識別Android
- BAAS平臺_區塊鏈baas平臺技術_區塊鏈技術開發區塊鏈
- 跨平臺技術演進
- 基於kubernetes自研容器管理平臺的技術實踐
- Flutter實現Android、iOS跨平臺經驗總結FlutterAndroidiOS
- 如何設計實時資料平臺(技術篇)
- 實時&離線皮膚渲染技術(Real-time&Offline Skin Rendering)
- 實現在安卓平臺下的即時通訊安卓
- DataPipeline丨構建實時資料整合平臺時,在技術選型上的考量點API
- 【轉載】SAP 系統中STO+VC 技術實現
- Android技術分享|【自定義View】實現Material Design的Loading效果AndroidViewMaterial Design
- OS X平臺的Dylib劫持技術(下)
- OS X平臺的Dylib劫持技術(上)
- VMware Fusion Pro 13:強大虛擬化技術,實現高效多平臺相容
- SAP 電商雲 Spartacus UI 實現的 ngrx-router-store.js 的 serializerUIJS
- 開源元件DoraemonKit之Android版本技術實現(二)元件Android
- 開源元件DoraemonKit之Android版本技術實現(一)元件Android
- 微服務平臺技術架構微服務架構
- C# 跨平臺UI 技術C#UI
- 在SAP雲平臺的API portal裡建立和管理APIAPI
- 音影片編解碼技術在直播平臺中是如何運用的?
- 在雲環境中實現成功的現代資料分析平臺
- 美團容器平臺架構及容器技術實踐架構