使用 REST Api 的移动应用程序开发计划是个好主意吗? [英] Mobile App Development Plan with REST Api is Good Idea?

查看:22
本文介绍了使用 REST Api 的移动应用程序开发计划是个好主意吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我是移动原生应用开发的新手.

I'm new to mobile native app development.

但我熟悉网络应用开发.

But I'm familiar with web app development.

我打算先开发iPhone Native App,然后再开发Android Native App.

I was going to develop iPhone Native App first and then develop Android Native App after that.

为了最大限度地减少工作,我的计划是为我的应用开发 REST API.

To minimize work, my plan was to develop REST APIs for my apps.

API 服务器将处理数据库 CRUD 和会话,以便 Native App 调用

API server is going to handle database CRUD and session so that Native App would call

以抽象方式来自数据库的数据.

data from database in abstract manner.

这样我的 iOS、Android 和其他原生应用就可以使用那些 REST API

so that my iOS, Android and etc native apps just use those REST APIs

读取和写入照片、文本、LatLng 等

to read and write photos, text, LatLng etc.

我不确定这是开发原生应用的推荐方式.

I'm not sure this is a recommended way to develop native apps.

也许与原生应用和数据库直接通信会有更好的性能,但我担心在所有其他原生应用版本中开发逻辑.

Perhaps direct communication with native app and database would have better performance but I'm worried on developing logics in every other native app version.

推荐答案

是的,这是 Android 中的好方法和推荐方法.尽管 KSAOP2 可在某些 android 应用程序中运行,但 android 中没有对 SOAP 的官方支持.要实现客户端使用restful web svc,您需要在单独的线程中进行.Android 4.x 不支持主线程中的网络连接.

Yes, it is good and recommended approach in Android. There is no official support for SOAP in android, though KSAOP2 works in some android apps. To implement client to consume restful web svc, you need to do it in a separate thread. Android 4.x does not support network connections in main thread.

iOS:如果 webapplciation 提供 RESTful webservice 或者你可以使用 SOAP,它可能是很好的基础.在 SOAP 中连接到网络 url 消耗更多内存.

iOS: it may be good based if the webapplciation provides RESTful webservice or you can use SOAP. Connecting to network url in SOAP consumes more memory.

RESTful 方法是除 SOAP 之外普遍接受的网络服务.

RESTful approach is universal accepted webservice besides SOAP.

这篇关于使用 REST Api 的移动应用程序开发计划是个好主意吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆