Does Mobilefirst provide a provision to access web services directly?

瘦欲@ 提交于 2019-12-11 01:50:23

问题


I am developing a native android app on MobileFirst platform. Does MobileFirst provide any code to connect to a web service instead of going through adapters? This is basically only for Native Android development and not for Hybrid app.


回答1:


The MobileFirst SDK only provides what is required to work with features provided by MobileFirst, such as connecting to various backends using Adapters with the added benefit of the MobileFirst security framework, and other features.

If you have a need to connect to backends not via MobileFirst, use other common client-side utilities to achieve that.




回答2:


I used the following code and it worked.

WLResourceRequest request = new WLResourceRequest("Actual server path here", GET); request.addHeader(new BasicHeader("IfAnyHeader", "here")); request.send(new ResponseListener());




回答3:


If you are using native Android, you could use volley (or similar) to call external web services or REST apis.

http://developer.android.com/training/volley/index.html

Nothing to do with MobileFirst though, all totally standard Android native coding.



来源:https://stackoverflow.com/questions/35160925/does-mobilefirst-provide-a-provision-to-access-web-services-directly

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