Android TutorialsNo Comments

default thumbnail
132 views.

This new widget is a big step for displaying data in Material Design because the ListView and GridView are one of the most commonly used UI widgets. In RecyclerView android provides a lot of new features which are not present in existing ListView or GridView.

Important Note:

In Android, RecyclerView provides an ability to implement the horizontal, vertical and Expandable List. It is mainly used when we have data collections whose elements can change at runtime based on user action or any network events. For using this widget we have to specify the Adapter and Layout Manager.

Webservice:

URL:

http://androindian.com/apps/my_apps/api.php

Req: {“action”:”get_all_apps”}

Response:

{
“response”: “success”,
“results”: 11,
“data”: [
{
“id”: “1”,
“app_name”: “Best Wishes”,
“pic”: “http://androindian.com/app_images/best-wishes.png”,
“url”: “https://play.google.com/store/apps/details?id=androiindians.messages”
},
}

This Recycler using retrofit

Pleae add below gradle in project

activitymain.xml

MainActivity.Java

Create an interface  Appslist.java

Then Create one more class for object response on name of UserResponse.class

Then for array response need one more create class on name Datum.java

then Create Custom Adapter for Recyclerview

then create one more xml file for view on name of rowlayout.xml

Finally add Internet permission in manifest file

OutPut

Screenshot_1535547104

Be the first to post a comment.

Add a comment