Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Frontend-backend communication for a mobile app

I am pretty new to stuff related to server and backend services and I want to develop a mobile app with a backend part. I want this backend to serve an ios app, an android app as well as a website. My concerns today are how does the frontend part communicate with the backend part :

  • does it work the same way a website works ? (Http request to the server ?)
  • how does happen the exchange of datas between the frontend and the backend ?
  • which are the common solutions to my problem ?
  • is there an efficient way to desing this backend to serve mobile apps as well as a website ?
  • is parse (https://parse.com/) a good starting point ?

Thanks

like image 809
Ali Baba Avatar asked Jul 27 '14 08:07

Ali Baba


1 Answers

Looking at your questions in turn:

  • does it work the same way a website works ? (Http request to the server ?)

There are many options, but probably the most common, or fashionable, at the moment is to use a RESTFUL interface: http://en.wikipedia.org/wiki/Representational_state_transfer

Previously, a SOAP based web service might have been the most common choice: http://en.wikipedia.org/wiki/SOAP

See here for some discussion on why you might use REST rather than the SOAP now: Why would one use REST instead of SOAP based services?

  • how does happen the exchange of datas between the frontend and the backend ?

Assuming REST, HTTP is used to transport messages and application data is typically included in XML or JSON forms

  • which are the common solutions to my problem ?

I think this is covered by the other parts of the question/answer.

  • is there an efficient way to desing this backend to serve mobile apps as well as a website ?

Thats very dependent on your particular server application, especially its size and architecture. If the server application is broken down into components or parts, and the parts that generate the 'views' or the 'HTML' pages for the web app are distinct and well separated from the 'backend' parts of your server application, AND your application is of a type that the functionality is largely the same whether the end user is using a web site or a mobile and it is just the way the view are generated for the different devices that differs, then an efficient design would be one that keeps as much of the backend common as possible. If the use of the application is very different when used by a mobile client this may not make sense. More generally, an efficient design would keep as much functionality as possible common between the Mobile and Web applications.

It would definitely be worth becoming familiar with the 'Model View Controller' architectural pattern as most of the server side frameworks, as well as many of the Javascript Web client frameworks and even the iOS and (to a lesser extent) Android frameworks use these concepts:

http://en.wikipedia.org/wiki/Model–view–controller

One important considerations whether you need 'push' or notification like functionality on your mobile app. If so you may want to look at some of the common solutions to understand if they meet your needs - probably easiest to start with Apple and Google's offerings to get an understanding, but there are lots of other solutions available also:

https://developer.apple.com/library/ios/documentation/NetworkingInternet/Conceptual/RemoteNotificationsPG/Chapters/ApplePushService.html

http://developer.android.com/google/gcm/index.html

  • is parse (https://parse.com/) a good starting point ?

I am not familiar with this service but you might be better looking at a simple REST based approach first and see if it meets your needs.

like image 56
Mick Avatar answered Nov 04 '22 03:11

Mick