Google introduced a revamped Recents interface with Lollipop in the hopes of making it easier for users to jump between tasks. But is Recents the best method of switching tasks? Let us know if you actually use the Recents button as a task switcher and why.
HttpClient Tutorial to Upload and Download with Your App
Developers wanting to interact with the Internet need to choose a package to do the heavy lifting for them. A very common route is to use the built-in HttpClient. The documentation is fairly complete, but it’s a daunting to get started if you’ve never used the package before.
Take a look at the HttpClient tutorial that JFrankie recently posted. I find his presentation very approachable for the beginner, yet he doesn’t hesitate to move on to the more complex subjects. The guide starts off with a few lines of code used to open a connection, and quickly covers the first gotcha. HttpClient shouldn’t be run in the UI thread, as it presents a blocking function (you don’t know how long it’s going to be before the server answers back). Android will throw an error automatically if you try to do this.
He goes on to wrap the code in an AsyncTask class. This lets it run in a separate thread, launching a method when its work is complete. Most likely you’re looking to download something, a topic which is well covered in the guide. JFrankie wraps up the post by explaining the steps necessary to upload using the HTTP multipart request protocol.
He publicized his article in a Reddit thread, where he also participated in a discussion of the memory leak potential of using AsyncTask. It’s some advice you may want to heed as you build your app around the HttpClient.
Want something on the XDA Portal? Send us a tip!
Many of you probably dual-boot your personal computers, be it to run Linux alongside Windows or because you have a Mac and hate OS X. On a computer platform, the process can be a life-saver for a variety of reasons, particularly software compatibility/integration. It’s not rare to see computer programmers with Linux partitions or Mac gamers that use bootcamp for their videogames. On computers, the process has gotten relatively simpler over time, with Microsoft and Apple typically supporting the notion....
Websites have typically been less desirable than native apps, due to being unoptimized for mobile screens, responsiveness issues or simply not being able to provide all the features you might desire. New web standards aim to change that, and Chrome 42 will bring several of them to you. Push Notifications You'll be able to receive notifications from supported websites even after you've closed the page. Naturally, you'll have to grant permission to websites to do so: have no worries about...