Will Verduzco · Jun 24, 2013 at 03:00 pm

Intro Guide to Android Client-Server Communication

As our mobile devices become increasingly connected, client-server communications are also becoming increasingly necessary. Thankfully, a new guide has emerged that helps users setup a RESTful web API.

The new guide comes from XDA Forum Member Alkonic, and covers topics including setting up a database and PHP scrip, testing your new database server, and finally how to access this from Android. The guide is aimed towards relatively seasoned developers who have a working dev environment and have already written apps, but lack experience with MySQL or PHP.

What do budding cloud-enabled developers need to get started? Not much: an Android device to test with and a computer running on the same network, an Apache/MySQL/PHP server such as WAMP for Windows, and Postman Rest Client for Chrome. Thankfully the Alkonic also breaks summarizes the steps for those new to client-server communication:

  1. The client makes a request using a HTTP POST to a server
  2. The PHP script queries the MYSQL server
  3. The PHP script gets the SQL data
  4. The PHP script puts the data into an array and assigns keys for the values. The script then outputs the data as a JSON array. JSON (JavaScript Object Notation) is a standard for data exchange, and formats the data in a way both humans and computers can easily read.
  5. The app parses the JSON and displays the data.

To learn more, head over to the guide thread.


_________
Want something on the XDA Portal? Send us a tip!
Jimmy McGee · Mar 4, 2015 at 06:00 am · no comments

Pixie Dust – XDA Game Time!

There are some excellent ‘AAA’ tier games by huge development houses that offer fun, and, most of the time, in-app purchases. There is no doubt that some of these games are great. However, at XDA we like to keep an eye on the little guy. Some of the more successful Android developers have started out as the little guy. Today we celebrate another simple game developed by an XDA member. XDA Senior Member Rolf Smit offers up a 2D sandbox...

XDA NEWS
Mario Tomás Serrafero · Mar 3, 2015 at 04:29 pm · 1 comment

Five New Forums for Latest Phones, Tablet and Smartwatch

The Galaxy S6 Edge, Huawei Watch, Xperia Z4 Tablet, Moto E 2015 and Xperia M4 Aqua all have gotten new forums here at XDA. If you want the latest and greatest in hardware as of now, the Galaxy S6 Edge's top-tier processor, memory, and camera will most likely fulfill your everyday needs with blazing speed, and extra screen-space to boot. Huawei seems to have nailed the smartwatch with their new Huawei Watch, a classy-looking but also durable and powerful Android Wear...

XDA NEWS
Mario Tomás Serrafero · Mar 3, 2015 at 04:00 pm · no comments

Cross-Platform Encrypted Messaging with Signal 2.0

Privacy and security are two increasingly important factors in today's globalized world, and with the surge of internet spying by government agencies and third parties, wiretaps are an everyday thing that don't just concern James Bond anymore. Encryption made its way to the semi-mainstream messaging world with the Telegram platform, but while millions flocked to it, it is still clear that convenience beats privacy for most of smartphone users. After all, with the huge user bases boasted by Whatsapp and the...

XDA NEWS
Share This