Skip to main content

Posts

Showing posts from February, 2017

Volley Library Example - Android Tutorial

What is Volley library exactly for? Android volley is a networking library was introduced to make networking calls much easier, faster without writing tons of code. By default all the volley network calls works asynchronously, so we don’t have to worry about using asynctask anymore. Advantages of using Volley: Volley automatically schedule all network requests. It means that Volley will be taking care of all the network requests your app executes for fetching response or image from web. Volley provides transparent disk and memory caching. Volley provides powerful cancellation request API. It means that you can cancel a single request or you can set blocks or scopes of requests to cancel. Volley provides powerful customization abilities. Volley provides Debugging and tracing tools. How to add Volley Library? Open build.gradle located under your app module and add below dependencies. compile ' com.mcxiaoke.volley:library:1.0.19 ' After addin
Android Internet Connection Using HTTP Client(GET) - Android Tutorial In most of the android applications it is essential that app may need to connect to internet and make some HTTP requests. In this article i’ll be demonstrating about making simple HTTP Requests in android. Objectives: How to send HTTP GET request to a web server and display the response? How to check network connection? How to use AsyncTask to perform network operations on a separate thread? Below are the code snippets to handle HTTP requests. How to add HTTP Client? Open  build.gradle  located under your  app  module and add below dependencies. After adding the dependencies,  compile 'org.apache.httpcomponents:httpcore:4.4.1' compile 'org.apache.httpcomponents:httpclient:4.5' and in the same add the following  android { compileSdkVersion 23 buildToolsVersion "23.0.2" useLibrary 'org.apache.http.legacy' - this is to use this library within y
Recycler View and Card View (Material Design)  - Android Tutorial RecyclerView and  CardView  are major element introduced in  Material Design . RecyclerView is a  flexible view for providing a limited window into a large data set. Using CardView you can represent the information in a card manner with a drop shadow (elevation) and corner radius which looks consistent across the platform. CardView extends the FrameLayout and it is supported way back to Android 2.x. You can achieve good looking UI when CardView is combined with RecyclerView.  How to Add RecyclerView & CardView? Open  build.gradle  located under your  app  module and add below dependencies. After adding the dependencies, goto  Build ⇒ Rebuild Project  to download required libraries or  Sync the project . build.gradle dependencies {      compile fileTree(dir: 'libs' , include : [ '*.jar' ])      testCompile 'junit:junit:4.12'      compile 'com.android.support:appc