Mike Szczys · May 28, 2013 at 07:00 am

Weather App by Example Teaches JSON, HTTP, and API Use

Developers who are just getting started can leap through the learning curve by reading code written by more experienced programmers. It becomes even more useful if you can read an explanation of what each code chunk does, like with this weather app tutorial. Francesco Angola, who also wrote that guide on using Httpclient, has done a great job of explaining how to use a website API, parse a JSON string, and present the results to the user.

Francesco starts by exploring the data available from the Open Weather Map API. Don’t be confused by that web page title. The goal here is to gather text data on the current weather conditions, not to display on an onscreen map. Entering the URL in a browser returns a JSON string, whose format he uses to craft a parser method with the help of the JSONObject and JSONArray classes. I consider this to be the core of the guide. The parser lays out a roadmap for how the data object will be stored. This technique is easily adapted anytime you’re working with the JSON format. From here, he uses HttpClient to grab the string that feeds the parser. The guide concludes by creating a bare bones activity that displays weather conditions on screen.

Head over to his blog for the full tutorial.

[Via Reddit]


_________
Want something on the XDA Portal? Send us a tip!
GermainZ · Mar 4, 2015 at 07:09 pm · no comments

A Look at the Telegram+ Situation

Most of this article doesn't only apply to Telegram+ -- it just happens to be an example that got a lot of coverage elsewhere, with many authors or commentators putting the full blame on Google, Telegram, the Telegram+ developer or even WhatsApp Inc (eh?). In this article, we'll try to look at the different aspects to provide a clear view of what actually happened, and what can (and hopefully will) improve with regards to developers in general and the Play...

XDA NEWS
Aamir Siddiqui · Mar 4, 2015 at 12:11 pm · 2 comments

Multi Boot: The Fall of Nandroid?

Ever since custom recoveries and roms became popular, nandroid backups have been the fall back method for all android enthusiasts, irrespective of their confidence levels. They allow easy backup and restore in case things go wrong, which happens invariably when a modification is being tested. With that being said, how relevant are Nandroid Backups to this day? Back in 2011, when the world of Android was being awed by the likes of the Samsung Galaxy S2, a little modification made its appearance...

XDA NEWS
Emil Kako · Mar 4, 2015 at 11:49 am · 1 comment

HTC One M8 Owners: Upgrade to the M9, or Skip?

While HTC's latest flagship brings many new features, the aesthetic design of the device remains largely untouched in comparison to its predecessor. Many Android enthusiasts throughout the community were expecting a large redesign of one of the most beautiful handsets ever released, but what we got is something more along the lines of an 'HTC One M8S". So this begs the question, is the M9 worth the upgrade if you already own the M8? Current HTC One M8 users chime in and let us know your thoughts.

DISCUSS
Share This