tags:

views:

346

answers:

1

I am developing Android Twitter application. I downloaded TwitterClient Demo deom net. But there is a class file "android.net.http.RequestQueue" that is not available in sDK component in android.jar. Please advise on the same.

+1  A: 

It depends from where you have downloaded that Twitter demo example:

alt text

android.net.http.RequestQueue is not an official part of the Android API, so it might go away or change in a future release.
You can tell by the {@hide} in the class-level JavaDoc comment in RequestQueue.java.

So if the recent APIs don't have this class at all anymore, you can fall back on HttpURLConnection, as in this thread.

It seems safer to use the good ol' HttpURLConnection for HTTP calls then.
I suppose the RequestQueue was offered to save us the effort of spawning a separate thread before making the HTTP calls.

See the two approaches illustrated in this tutorial here.

VonC