Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to connect to the server on mobile application?

I am new to mobile applications. I am basically from a web development platform. I am just playing around mobile frameworks like App Framework, LungoJS, Jquery Mobile, kendo etc to gain some knowledge in this vertical.

The app I am developing is still in UI level. All I need is to fetch data from the server and populate in my app.

I need some ideas to establish server communication between the smart device and the server. My questions are

  1. What kind of server needed for mobile applications ? A cloud or a regular web server is enough ?
  2. What are the ways to connect the app with the server ? ( on cross platform mobile development )
  3. What is the secure way to communication with the server ?
like image 464
deadshot Avatar asked May 26 '14 09:05

deadshot


People also ask

What is mobile application server?

The MAS is modular, flexible, and provides an open API for 3rd party service creation. Users can thus utilize a variety of access technologies (CDPD, cellular, 802.11, SMS, etc.) and delivery mechanisms (HTML, WML, VoiceXML, etc.) while application developers are spared the details of this heterogeneity.

Does a mobile app have a server?

Everything you access on the internet uses a backend server in some way to deliver content to you. Whether it's a webpage, a mobile app, or a streaming service—it all has a backend server running processes to ensure that content is being delivered.


2 Answers

What kind of server needed for mobile applications ? A cloud or a regular web server is enough ?

Because you are creating a hybrid mobile application you can use any type of server side technology, it doesn't matter is it a classic web server technology (using Java, PHP or .NET) or some kind of cloud technology like Parse.com.

You also don't need to create anything from scratch. Best course of action would be to use some kind of micro RESTFul framework(like PHP Falcon or Java Play Framework). Read more about them here.

But, there's always a but. You can't use server side technology for classic content generation, you only need to use it to send data to your hybrid application. I will explain this later.

There's also an alternative to RESTFul services, you can create a webservice, again using Java, PHP or .NET.

What are the ways to connect the app with the server ? ( on cross platform mobile development )

You would use AJAX as a technology (in case of RESTFul), rest depends on you. You would probably do it in JSON format (or JSONP if you are doing cross-domain calls, but you don't need to think about JSONP when creating a hybrid application).

If you intend to use a web service then you would use a SOAP connection and communicate via XML format.

No matter which server side technology you use you will always use AJAX on a client side.

Now let me tell you why you should not generate your content on server side. Basically nothing can prevent you from doing that, you can generate your complete page on web server and just show it in PhoneGap app, it would still be a hybrid app. But, if you try to put this app in Apple store you will get yourself rejected.

What is the secure way to communication with the server ?

Security of course depends on server side technology. Every framework has its own kind of security handling, but all of them relay on HTTPS so you should not worry too much.

From the client side you can always encrypt JSON/XML data and send them using POST.

Examples:

If you want to use jQuery Mobile then take a look at this tutorial. It will show you basics of client - server side communication.

like image 184
Gajotres Avatar answered Sep 21 '22 06:09

Gajotres


Since you are new to mobile application, ill try to give short answers

1) What kind of server needed for mobile applications ? A cloud or a regular web server is enough ?

A regular web server is good.

2) What are the ways to connect the app with the server ?

via web-services

3) What is the secure way to communication with the server ?

Use HTTPS webservices (SOAP, REST), HTTPS secures the transmission.

Above is a basic explanation for your quick help, I would recommend you to go through the documentation, and review some sample codes

This will really help you Sample

like image 41
Sarim Sidd Avatar answered Sep 21 '22 06:09

Sarim Sidd