Retrofit – A type-safe HTTP client for Android and Java

Introduction Retrofit turns your HTTP API into a Java interface. public interface GitHubService { @GET(“users/{user}/repos”) Call<List<Repo>> listRepos(@Path(“user”) String user); } The Retrofit class generates an implementation of the GitHubService interface. Retrofit retrofit = new Retrofit.Builder() .baseUrl(“https://api.github.com/”) .build(); GitHubService service = retrofit.create(GitHubService.class); Each Call from the created GitHubService can make a synchronous or asynchronous HTTP request […]

Read More

Transferring Data Without Draining the Battery

In this class you will learn to minimize the battery life impact of downloads and network connections, particularly in relation to the wireless radio. This class demonstrates the best practices for scheduling and executing downloads using techniques such as caching, polling, and prefetching. You will learn how the power-use profile of the wireless radio can […]

Read More

JSON – parsing and using in Android

JSON is very light weight, structured, easy to parse and much human readable. JSON is best alternative to XML when your android app needs to interchange data with your server. If your app consuming XML data, you can always refer to Android XML Parsing Tutorial. In this tutorial we are going to learn how to […]

Read More

XML – parsing and using in Android

Extensible Markup Language (XML) is a set of rules for encoding documents in machine-readable form. XML is a popular format for sharing data on the internet. Websites that frequently update their content, such as news sites or blogs, often provide an XML feed so that external programs can keep abreast of content changes. Uploading and […]

Read More

Volley – Google’s Networking framework

Volley is an HTTP library that makes networking for Android apps easier and most importantly, faster. Volley is available through the open AOSP repository. Volley offers the following benefits: Automatic scheduling of network requests. Multiple concurrent network connections. Transparent disk and memory response caching with standard HTTP cache coherence. Support for request prioritization. Cancellation request […]

Read More

Managing Network Usage

This lesson describes how to write applications that have fine-grained control over their usage of network resources. If your application performs a lot of network operations, you should provide user settings that allow users to control your app’s data habits, such as how often your app syncs data, whether to perform uploads/downloads only when on […]

Read More

Connecting to a Network

This lesson shows you how to implement a simple application that connects to the network. It explains some of the best practices you should follow in creating even the simplest network-connected app. Note that to perform the network operations described in this lesson, your application manifest must include the following permissions: <uses-permission android:name=”android.permission.INTERNET” /> <uses-permission […]

Read More