Android Volley Tutorial

Goal

Connect to MySQL database and operate on Android phones

My Tools

Volley

  • HTTP client library published by Goolgle

  • Improved some old ways like:

    • HttpClient : was removed at Android 6.0
    • HttpURLConnection : need to use and handle the thread
  • Provides three requests for loading data:

    • StringRequest
    • JsonObjectRequest
    • ImageRequest
  • Provides Cache for improving performance

    • However, in a large of data transmission, the performance of volley is very bad

Gradle

compile 'com.mcxiaoke.volley:library:1.0.19'

Permission for AndroidManifest.xml

<uses-permission android:name="android.permission.INTERNET" />

For more details