Mobile App Development - Pulling data from web service / web page

Is there any good examples to explain how should we build the data pulling section in mobile app development? I heard about the word asynchronous often but what is it actually?

I need something that explain the concept rather than pure programming examples (but good to know if it's also provided)

Any clues?

Thank you.
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

David FavorLinux/LXD/WordPress/Hosting SavantCommented:
Likely people have avoided answering your question, as the answer requires detail + will be lengthy.

Maybe a good starting place will be to search YouTube or Udemy or Experts-Exchange for an example/tutorial of what your trying to accomplish.

You'll be searching for things like AJAX.

I'd suggest you start a simple PHP UI + AJAX + PHP API.

Then work out best way to connect your App to the PHP API you develop.

This has the added benefit of always providing you with a PHP GUI to debug the PHP API your App calls.

A tricky part of App development is splitting your App up in to pieces (GUI + API + etc) which can easily be debugged, so if your App stops working, you can quickly determine which part of your App requires attention.
Scott Fell, EE MVEDeveloper & EE ModeratorCommented:
When you have a traditional web site, the data and web pages typically live on servers where you control security.  You will use server side code like PHP, ASP.NET, NODE or another language that processes on the server and that is typically how you access your data.  

You may have a site that pulls data from a source you do not have control of such as web service for processing credit cards or results from a real estate IDX to display homes that meat a certain criteria or show facebook posts.  In a situation like this, you are calling the other party's API from either your server side code or client side (javascript).  How this is done depends on the type of data you are sending. If you use server side scripting, it is difficult for others to see the data you are sending where javascript is on the front end and anybody can view.

When you send a request to the server and land on another page that produces the results, this is a direct POST or GET.  When you request data from your main page to the server (or api), then wait for the data to be returned from the server and display it on your page, this is an asynchronous call.

Again, all your pages sit on your web server and you control the security. If you need to make a change to your home page, you only update the one page on the server and anybody that views the page will see the update.

On a mobile device, your pages sit on somebody's device that you do not control.  If you update your home page on the app, you push the update to the app store and the app store pushes out the update to the users.  This is based on a pure native app of course. Since your pages on a device that you do not control, you can not simply have a database connection string in your app because the user could decompile your app and find your private passwords and connection information to your database and that would not be good. You do not control the security of the app or pages if you will.

The way you access data from your app is through an API that you create on your server. This part can get more complex but you are just asking for the general idea right now. It would be common to use an asynchronous call to your api and return data to the app without having to go to another page.

There are app services that can really help you out instead of trying to reinvent the wheel.    Check out these resources

Making a native app can be a lot more complex than creating a website with similar features in part of because what I just mentioned. Another option is to create a responsive site and place the site in a web view.  Both IOS and Android have this feature. 

A web view is an app that loads a web page. If you create a responsive site that can conform to any screen size, you can place the site in a web view and to the user it will be hard for most people to know the difference between a web view app and a native app.  Just know that pressing a button on a native app will have a faster reaction time than a site loaded in your web view. However, given how fast you can make a site compared to a native app, it is a good place to start and get going.  Once in place you can start on your native app.

The issue you will have with a native app is learning what is required for both. Many of the apps you use probably have teams of people that work on one or the other.

For creating responsive sites check out   /

There is a lot to digest here.  Let us know what you have questions on.

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Scott Fell, EE MVEDeveloper & EE ModeratorCommented:
Made an edit to the link for web views
Determine the Perfect Price for Your IT Services

Do you wonder if your IT business is truly profitable or if you should raise your prices? Learn how to calculate your overhead burden with our free interactive tool and use it to determine the right price for your IT services. Download your free eBook now!

Shalom CarmelCTOCommented:
This is a classic example of client/server architecture.

You have a mobile app that runs on a mobile device. You realize that your mobile app has to communicate with another computer. Your mobile app is is now a client and the other computer is now the server.
The important thing now is to set the protocol of data exchange between the client and the server. There are many options, you can even create your own protocols if you want to, but I recommend that you stick to the most common and wildly popular REST protocol.
The REST protocol actually has 3 layers.
* The client and server communicate over HTTP/HTTPS.
* The client and server use HTTP based verbs (GET/POST/DELETE) and HTTP based content to pass information. This includes things like query string parameters, authentication headers, cookies etc..
* The client and server decide on how the content sent from the client and the content received back are structured. JSON is very common, but so are XML, SOAP, form encoded strings, and even plain text.

In your case, the client side is your app. The server side can be written in Java, or PHP, or .NET, or Ruby, or Node.js, or any other web server framework.
The following article explains how it is done from the client side, by showing an example code of android consuming (calling) an external web service.
trowaAuthor Commented:
Hi experts,

That's a lot of information. I shall try to digest and get back to you all.

Thank you!
trowaAuthor Commented:
Thank you!
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Smartphone Programming

From novice to tech pro — start learning today.