Rack Brains

Together We Grow

It’s all about Volley – Part 2

In Part 1 you saw introduction and features of volley. Now enough of theory let’s be practical 😀

You saw how to add volley as library in Android Studio now lets see how to configure it.
1) Adding Volley as module in build.gradle
continuing from video you must add Volley project module in dependencies.

dependencies {
    compile project(':volley')
}

Now you are ready to use classes provided by Volley framework. So let’s move forward.

Read More

It’s all about Volley – Part 1

Volley
noun
    1. burst of bullets, arrows, or other projectiles discharged at one time
    2. path of an object after strike or kick before it touches the ground

Why Volley?

Volley is a networking library developed by Google which makes network communication really fast. Almost all applications need to communicate with server and populate data in application. But we already have HttpClient and HttpUrlConnection classes. Umm yes we do, but today’s applications needs lots of network calls with loads of metadata and images. If we use these classes, then you will be focusing more on network requests logic instead of business logic. To achieve good performance and to get more time on logical things, Volley is there for the rescue.

What Volley offers?

Volley offers almost everything from JSON to RAW text and images. Volley provides different request classes for network communication and get the data in the form of JSONObject,JSONArray,Bitmap or String. You can create your own custom requests as well.

GREAT – For network operations that populates UI.
FINE – For background RPCs.
TERRIBLE – For large payloads(e.g Streaming)

Read More

Using RecyclerView

Almost all Android applications does need a list to show some data. Till Android Kitkat(API Level 19) we all used ListView and faced loads of challenges with handling recycling of views. So now we have a RecyclerView which helps recycling of views in better way.
RecyclerView is present in support library so we can use it easily with previous android versions as well.

What is RecyclerView?

RecyclerView is a just like a ListView but its very flexible and more feature rich than ListView. It provides you the way to display an array of data in small window. Major difference between ListView and RecyclerView is RecyclerView extends ViewGroup whereas ListView extends AbsListView.

Components of RecyclerView

Now that we know what RecyclerView is, let’s take a look at its components which are essential to make use of RecyclerView.

RecyclerView

Read More

Powered by WordPress & Theme by Anders Norén