Again because of so many queries I am writing this android feed example tutorial. Recently I published Android Custom ListView with Images using RecyclerView and Volley. And in feedback many people asked that how to add more item on scroll to the list.
If you are having about 1000 or more items then downloading it once from the server would take a lots of time. And downloading all items at once is not a good idea.
That is why we should create a feed. So in this tutorial we will display some items and on scroll the items will be downloaded and added.
Android Feed – Video
You can see this video to know what actually we will be creating in this tutorial.
Now if you want to learn how to create this then lets begin our project.
Creating Server Side Database and Scripts for our Android Feed
- Data will come from server. And for this demonstration I am using Hostinger’s free hosting as my server.
- The first thing you need is a database from where you will fetch the data.
- This is my database you can create the same database or you can also change your database according to your need.

- As you can see I have 9 records in my table. I will show 3 records at once and when will user reach bottom by scrolling I will load 3 more records.
- Now the first thing we need is a script to connect to the database. Create a script named dbConnect.php and write the following code.
1 2 3 4 5 6 7 8 9 | <?php define('HOST','mysql.hostinger.in'); define('USER','u502452270_andro'); define('PASS','belal_123'); define('DB','u502452270_andro'); $con = mysqli_connect(HOST,USER,PASS,DB) or die('Unable to Connect'); |
- No need to explain the above given code. We have used it in almost every tutorial I published.
- Now we will create the main script that will give us the data for our feed. Create a new script feed.php and write the following code.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 | <?php //Getting the page number which is to be displayed $page = $_GET['page']; //Initially we show the data from 1st row that means the 0th row $start = 0; //Limit is 3 that means we will show 3 items at once $limit = 3; //Importing the database connection require_once('dbConnect.php'); //Counting the total item available in the database $total = mysqli_num_rows(mysqli_query($con, "SELECT id from feed ")); //We can go atmost to page number total/limit $page_limit = $total/$limit; //If the page number is more than the limit we cannot show anything if($page<=$page_limit){ //Calculating start for every given page number $start = ($page - 1) * $limit; //SQL query to fetch data of a range $sql = "SELECT * from feed limit $start, $limit"; //Getting result $result = mysqli_query($con,$sql); //Adding results to an array $res = array(); while($row = mysqli_fetch_array($result)){ array_push($res, array( "name"=>$row['name'], "publisher"=>$row['publisher'], "image"=>$row['image']) ); } //Displaying the array in json format echo json_encode($res); }else{ echo "over"; } |
- While executing this script I have to pass a get variable. So for my case the URL is
http://www.simplifiedcoding.16mb.com/feed/feed.php?page=1
- If you would go to the above URL you will get a JSON string as follows.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 | [ { "name":"Antman", "publisher":"Marvel", "image":"http:\/\/simplifiedcoding.16mb.com\/feed\/antman.jpg" }, { "name":"Batman", "publisher":"DC", "image":"http:\/\/simplifiedcoding.16mb.com\/feed\/batman.jpg" }, { "name":"Captain America", "publisher":"Marvel", "image":"http:\/\/simplifiedcoding.16mb.com\/feed\/captainamerica.jpg" } ] |
- We will change the page=2, page=3 to get the next items. If you would go to the above URL you will get 3 values for our android feed. You can also use my URL for this project. But it would be good if you create your own.
- Now we will move ahead to android part.
Creating an Android Feed Project
- Create a new android project in android studio. I have named this android feed project as MyFeed.
- Now the first thing you should do is add the following dependencies to your build.gradle file and sync the project.
1 2 3 4 5 6 7 8 9 10 | dependencies { compile fileTree(dir: 'libs', include: ['*.jar']) testCompile 'junit:junit:4.12' compile 'com.android.support:appcompat-v7:23.1.1' compile 'com.mcxiaoke.volley:library-aar:1.0.0' compile 'com.android.support:recyclerview-v7:+' compile 'com.android.support:cardview-v7:+' } |
- So here we have added volley, recyclerview and cardview. Now add internet permission to your manifest file.
1 2 3 | <uses-permission android:name="android.permission.INTERNET"/> |
- First we will create a class to declare some important constants. So create a class named Config.java and write the following code.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 | package net.simplifiedcoding.myfeed; /** * Created by Belal on 12/5/2015. */ public class Config { //Data URL public static final String DATA_URL = "http://simplifiedcoding.16mb.com/feed/feed.php?page="; //JSON TAGS public static final String TAG_IMAGE_URL = "image"; public static final String TAG_NAME = "name"; public static final String TAG_PUBLISHER = "publisher"; } |
- To load the images I am using NetworkImageView. And for this we need to create a Custom Volley Request. So we will use the same code we used in Google Login Tutorial to Load Profile Picture.
- Create a new class named CustomVolleyRequest.java and write the following code.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 | package net.simplifiedcoding.myfeed; import android.content.Context; import android.graphics.Bitmap; import android.support.v4.util.LruCache; import com.android.volley.Cache; import com.android.volley.Network; import com.android.volley.RequestQueue; import com.android.volley.toolbox.BasicNetwork; import com.android.volley.toolbox.DiskBasedCache; import com.android.volley.toolbox.HurlStack; import com.android.volley.toolbox.ImageLoader; /** * Created by Belal on 12/5/2015. */ public class CustomVolleyRequest { private static CustomVolleyRequest customVolleyRequest; private static Context context; private RequestQueue requestQueue; private ImageLoader imageLoader; private CustomVolleyRequest(Context context) { this.context = context; this.requestQueue = getRequestQueue(); imageLoader = new ImageLoader(requestQueue, new ImageLoader.ImageCache() { private final LruCache<String, Bitmap> cache = new LruCache<String, Bitmap>(20); @Override public Bitmap getBitmap(String url) { return cache.get(url); } @Override public void putBitmap(String url, Bitmap bitmap) { cache.put(url, bitmap); } }); } public static synchronized CustomVolleyRequest getInstance(Context context) { if (customVolleyRequest == null) { customVolleyRequest = new CustomVolleyRequest(context); } return customVolleyRequest; } public RequestQueue getRequestQueue() { if (requestQueue == null) { Cache cache = new DiskBasedCache(context.getCacheDir(), 10 * 1024 * 1024); Network network = new BasicNetwork(new HurlStack()); requestQueue = new RequestQueue(cache, network); requestQueue.start(); } return requestQueue; } public ImageLoader getImageLoader() { return imageLoader; } } |
- Inside activity_main.xml create a RecyclerView and a ProgressBar to show our android feed.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 | <?xml version="1.0" encoding="utf-8"?> <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent" android:layout_height="match_parent" android:padding="@dimen/activity_vertical_margin"> <android.support.v7.widget.RecyclerView android:id="@+id/recyclerView" android:layout_width="match_parent" android:layout_height="match_parent" android:layout_centerInParent="true" /> <ProgressBar android:id="@+id/progressBar1" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_centerInParent="true" /> </RelativeLayout> |
- Now we need to create layout for our list. The list I have created looks like

- For our list we need to create the above layout. So inside the layout folder create a .xml file named superheroes_list.xml and write the following code to create the above given layout.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 | <?xml version="1.0" encoding="utf-8"?> <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent" android:layout_height="match_parent"> <android.support.v7.widget.CardView android:layout_width="match_parent" android:layout_height="wrap_content"> <LinearLayout android:padding="@dimen/activity_horizontal_margin" android:orientation="vertical" android:layout_width="match_parent" android:layout_height="match_parent" > <com.android.volley.toolbox.NetworkImageView android:layout_width="wrap_content" android:layout_height="wrap_content" android:id="@+id/imageViewHero" /> <TableLayout android:layout_width="match_parent" android:layout_height="wrap_content"> <TableRow> <TextView android:text="Name" android:paddingRight="10dp" android:layout_width="wrap_content" android:layout_height="wrap_content" /> <TextView android:id="@+id/textViewName" android:textStyle="bold" android:layout_width="wrap_content" android:layout_height="wrap_content" /> </TableRow> <TableRow> <TextView android:text="Publisher" android:paddingRight="10dp" android:layout_width="wrap_content" android:layout_height="wrap_content" /> <TextView android:id="@+id/textViewPublisher" android:textStyle="bold" android:layout_width="wrap_content" android:layout_height="wrap_content" /> </TableRow> </TableLayout> </LinearLayout> </android.support.v7.widget.CardView> </RelativeLayout> |
- Now to store the list items we will create a class. So create a class named SuperHero.java and write the following code.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 | package net.simplifiedcoding.myfeed; /** * Created by Belal on 12/5/2015. */ public class SuperHero { //Data Variables private String imageUrl; private String name; private String publisher; //Getters and Setters public String getImageUrl() { return imageUrl; } public void setImageUrl(String imageUrl) { this.imageUrl = imageUrl; } public String getName() { return name; } public void setName(String name) { this.name = name; } public String getPublisher() { return publisher; } public void setPublisher(String publisher) { this.publisher = publisher; } } |
- To display the items in RecyclerView we need an adapter. So create one more class named CardAdapter.java and write the following code.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 | package net.simplifiedcoding.myfeed; import android.content.Context; import android.media.Image; import android.support.v7.widget.RecyclerView; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; import android.widget.ProgressBar; import android.widget.TextView; import com.android.volley.toolbox.ImageLoader; import com.android.volley.toolbox.NetworkImageView; import org.w3c.dom.Text; import java.util.ArrayList; import java.util.List; /** * Created by Belal on 11/9/2015. */ public class CardAdapter extends RecyclerView.Adapter<CardAdapter.ViewHolder> { //Imageloader to load image private ImageLoader imageLoader; private Context context; //List to store all superheroes List<SuperHero> superHeroes; //Constructor of this class public CardAdapter(List<SuperHero> superHeroes, Context context){ super(); //Getting all superheroes this.superHeroes = superHeroes; this.context = context; } @Override public ViewHolder onCreateViewHolder(ViewGroup parent, int viewType) { View v = LayoutInflater.from(parent.getContext()) .inflate(R.layout.superheroes_list, parent, false); ViewHolder viewHolder = new ViewHolder(v); return viewHolder; } @Override public void onBindViewHolder(ViewHolder holder, int position) { //Getting the particular item from the list SuperHero superHero = superHeroes.get(position); //Loading image from url imageLoader = CustomVolleyRequest.getInstance(context).getImageLoader(); imageLoader.get(superHero.getImageUrl(), ImageLoader.getImageListener(holder.imageView, R.drawable.image, android.R.drawable.ic_dialog_alert)); //Showing data on the views holder.imageView.setImageUrl(superHero.getImageUrl(), imageLoader); holder.textViewName.setText(superHero.getName()); holder.textViewPublisher.setText(superHero.getPublisher()); } @Override public int getItemCount() { return superHeroes.size(); } class ViewHolder extends RecyclerView.ViewHolder{ //Views public NetworkImageView imageView; public TextView textViewName; public TextView textViewPublisher; //Initializing Views public ViewHolder(View itemView) { super(itemView); imageView = (NetworkImageView) itemView.findViewById(R.id.imageViewHero); textViewName = (TextView) itemView.findViewById(R.id.textViewName); textViewPublisher = (TextView) itemView.findViewById(R.id.textViewPublisher); } } } |
- Finally come to MainActivity.java and write the following code.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 | package net.simplifiedcoding.myfeed; import android.support.v7.app.AppCompatActivity; import android.os.Bundle; import android.support.v7.widget.LinearLayoutManager; import android.support.v7.widget.RecyclerView; import android.view.View; import android.widget.ProgressBar; import android.widget.Toast; import com.android.volley.RequestQueue; import com.android.volley.Response; import com.android.volley.VolleyError; import com.android.volley.toolbox.JsonArrayRequest; import com.android.volley.toolbox.Volley; import org.json.JSONArray; import org.json.JSONException; import org.json.JSONObject; import java.util.ArrayList; import java.util.List; public class MainActivity extends AppCompatActivity implements RecyclerView.OnScrollChangeListener { //Creating a List of superheroes private List<SuperHero> listSuperHeroes; //Creating Views private RecyclerView recyclerView; private RecyclerView.LayoutManager layoutManager; private RecyclerView.Adapter adapter; //Volley Request Queue private RequestQueue requestQueue; //The request counter to send ?page=1, ?page=2 requests private int requestCount = 1; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); //Initializing Views recyclerView = (RecyclerView) findViewById(R.id.recyclerView); recyclerView.setHasFixedSize(true); layoutManager = new LinearLayoutManager(this); recyclerView.setLayoutManager(layoutManager); //Initializing our superheroes list listSuperHeroes = new ArrayList<>(); requestQueue = Volley.newRequestQueue(this); //Calling method to get data to fetch data getData(); //Adding an scroll change listener to recyclerview recyclerView.setOnScrollChangeListener(this); //initializing our adapter adapter = new CardAdapter(listSuperHeroes, this); //Adding adapter to recyclerview recyclerView.setAdapter(adapter); } //Request to get json from server we are passing an integer here //This integer will used to specify the page number for the request ?page = requestcount //This method would return a JsonArrayRequest that will be added to the request queue private JsonArrayRequest getDataFromServer(int requestCount) { //Initializing ProgressBar final ProgressBar progressBar = (ProgressBar) findViewById(R.id.progressBar1); //Displaying Progressbar progressBar.setVisibility(View.VISIBLE); setProgressBarIndeterminateVisibility(true); //JsonArrayRequest of volley JsonArrayRequest jsonArrayRequest = new JsonArrayRequest(Config.DATA_URL + String.valueOf(requestCount), new Response.Listener<JSONArray>() { @Override public void onResponse(JSONArray response) { //Calling method parseData to parse the json response parseData(response); //Hiding the progressbar progressBar.setVisibility(View.GONE); } }, new Response.ErrorListener() { @Override public void onErrorResponse(VolleyError error) { progressBar.setVisibility(View.GONE); //If an error occurs that means end of the list has reached Toast.makeText(MainActivity.this, "No More Items Available", Toast.LENGTH_SHORT).show(); } }); //Returning the request return jsonArrayRequest; } //This method will get data from the web api private void getData() { //Adding the method to the queue by calling the method getDataFromServer requestQueue.add(getDataFromServer(requestCount)); //Incrementing the request counter requestCount++; } //This method will parse json data private void parseData(JSONArray array) { for (int i = 0; i < array.length(); i++) { //Creating the superhero object SuperHero superHero = new SuperHero(); JSONObject json = null; try { //Getting json json = array.getJSONObject(i); //Adding data to the superhero object superHero.setImageUrl(json.getString(Config.TAG_IMAGE_URL)); superHero.setName(json.getString(Config.TAG_NAME)); superHero.setPublisher(json.getString(Config.TAG_PUBLISHER)); } catch (JSONException e) { e.printStackTrace(); } //Adding the superhero object to the list listSuperHeroes.add(superHero); } //Notifying the adapter that data has been added or changed adapter.notifyDataSetChanged(); } //This method would check that the recyclerview scroll has reached the bottom or not private boolean isLastItemDisplaying(RecyclerView recyclerView) { if (recyclerView.getAdapter().getItemCount() != 0) { int lastVisibleItemPosition = ((LinearLayoutManager) recyclerView.getLayoutManager()).findLastCompletelyVisibleItemPosition(); if (lastVisibleItemPosition != RecyclerView.NO_POSITION && lastVisibleItemPosition == recyclerView.getAdapter().getItemCount() - 1) return true; } return false; } //Overriden method to detect scrolling @Override public void onScrollChange(View v, int scrollX, int scrollY, int oldScrollX, int oldScrollY) { //Ifscrolled at last then if (isLastItemDisplaying(recyclerView)) { //Calling the method getdata again getData(); } } } |
- Now run your application and you will see the following output.

- Bingo! Our android feed application is working fine. If you are having troubles or getting errors; you can get my project from GitHub Repository from below.
So thats all for this android feed tutorial friends. Please support us and give your feedback with your comments. Thank You 🙂

Hi, my name is Belal Khan and I am a Google Developers Expert (GDE) for Android. The passion of teaching made me create this blog. If you are an Android Developer, or you are learning about Android Development, then I can help you a lot with Simplified Coding.
Thanks for the tutorial! How can i make this work on minsdk < 23
It will work on sdk 21 as well (y)
RecyclerView.OnScrollChangeListener
This will work only on SDK 23? how to make it work on SDK lower, need 19 for 4.4.4
I guess it will work >= sdk 21.. you will see a red line if your min sdk is 21 but it will work
And yes for lower versions you have to use OnScrollListener
Hi Belal,
very nice tutorial 😉
Please, is the condition API 23?
If not, I have a problem elsewhere.
If yes, how to achieve this for minimum API 19?? Or just 21, 22 for Lollipop…
It will work for lollipop (y) I have tested
Great tutorial mate.
for api less than 21/23, following Belal’s earlier comment I used RecyclerView.OnScrollListener such that on my MainActivity’s onCreate it looked like this:
if (Build.VERSION.SDK_INT < Build.VERSION_CODES.LOLLIPOP) {
recyclerView.addOnScrollListener(new RecyclerView.OnScrollListener() {
@Override
public void onScrolled(RecyclerView recyclerView, int dx, int dy) {
super.onScrolled(recyclerView, dx, dy);
//Ifscrolled at last then
if (isLastItemDisplaying(recyclerView)) {
//Calling the method getdata again
getData();
}
}
});
} else {
recyclerView.setOnScrollChangeListener( new RecyclerView.OnScrollChangeListener() {
@Override
public void onScrollChange(View v, int scrollX, int scrollY, int oldScrollX, int oldScrollY) {
//Ifscrolled at last then
if (isLastItemDisplaying(recyclerView)) {
//Calling the method getdata again
getData();
}
}
});
}
Worked for me under API 16 :).
Thanks buddy.. (y) great help for other readers.. As I am having my semester exams so not able to do things quickly nowdays
mate, do you have a github or something where I can see the code for that
I try to follow your instruction but it not work. I see the red line under OnScrollChangeListener. can you share your MainActivity file?
You get it from github repository I have given the link in post.. I guess you have to update your sdk..
Hi , will you please provide me the code that can work on API 18.
Hello!
How would you delete an item from this view such that it would also be deleted from database as well?
Remove the item from the SuperHero Array list and then notify the changes to adapter
Can U give in detail how to handle ItemOnClick selection (to perform) some task based on the ItemSelected (position) for lower API (ex 17,18,19)?
Busy with my semester exams I will post a new tutorial to fulfill all the new queries (y) ASAP
plz give the source code for viewing images in list view from server
This is what I am doing in this tutorial.. 🙂
thanks for helping me sir…
but this program not run in lower versions !!
and can we delay the progress bar?
this project i can’t run in Android 4.4 Kikat version. i already set the minSdkVersion 19 , but it still cannot work in Android 4.4 Kikat version. It will show the app has been stopped when i run the project. how solve it? thanks
Bro. How to make it work for the devices less than API 18
Response will be appreciated
thankyou
I am encountering a problem in this method, see I have employed this method to display the status and posts feed for a social app that I am developing and the problem I am facing is the FOR LOOP while parsing json array is causing to display atleast two items at the most. It is not displaying anything if the database contains only one set of items for json array (Probably for the 0 index of the array). I have trid playing with for loop for a while but to no avail. Can you suggest anything? Much thanks.
Just change the PHP code from $page_limit = ($total/$limit) to $page_limit = ($total/$limit) + 1;
Folks, I am having a problem with the CardAdapter.java file. It says “cannot resolve symbol image”
For the following code: “imageView, R.drawable.image”
Can someone help?
Hey I got the same problem, could you fix it?
Thanks.
Belal, please disregard my previous inquiry, I forgot to put a picture in the drawable folder. Man you are great – you are helping me in my carrer. Than you and be bless
Thanks buddy (y) keep visiting
Folks – how can I add an onClicklistener to the RecyclerView, where a position can be identified?
Belal,
I am still having a lot of problem with adding an onClicklistener. I added to the CardAdapter.java file. But I am having the following error:
“Non-static field ‘name’ can not be referenced from static context”.
How would you solve this? Any help would be appreciated.
hi is this possible in a tab fragment? how?
I am using latest sdk eclipse but still can’t get the result. please help me. I try to follow your instruction but it not work. I see the red line under OnScrollChangeListener.
Hii thanks for the tutorial it working fine but im having an problem if there are 10 elements it shows three pages and displays only 9 elements but not showing last tenth element . any fix for it ????
This tutorial has been really helpful to me so I thought I should contribute my solution to those using lower SDK. Don’t implement the RecyclerView.OnScrollChangeListener
1. REPLACE recyclerView.setOnScrollChangeListener(this); with recyclerView.addOnScrollListener(rVOnScrollListener);
2. CREATE THE METHOD rVOnScrollListener() LIKE THIS
private RecyclerView.OnScrollListener rVOnScrollListener = new RecyclerView.OnScrollListener(){
@Override
public void onScrollStateChanged(RecyclerView recyclerView,
int newState) {
super.onScrollStateChanged(recyclerView, newState);
}
@Override
public void onScrolled(RecyclerView recyclerView, int dx, int dy) {
super.onScrolled(recyclerView, dx, dy);
if (isLastItemDisplaying(myRecyclerView)) {
//Calling the method getdata again
getData();
}
}
};
I HOPE THIS HELPS SOMEONE.
Here what for “myRecyclerView” assigned?
Opz how silly me 🙁 It refers to RecyclerView. I add your steps to my code and then it works correctly.Thank you so much Belal Khan and Albert Mp3Naija.COM.
Thank you for your contributions, I have the following concerns know how could Select one of the items and go to another activity and where you should place the required code.
I appreciate your help.
Thanks a lot
thanq soo much
Big tutorial an Extrem NICE i like and i need it.
But my problems is i use Fragments.
how can i use the onCreat step for my onCreateView
ist dificult for me to construckt this for fragments.
mybe a simpel step i can use it.
thx for Help
and sorry for my english
java.lang.NoClassDefFoundError: Class not found using the boot class loader; no stack available
i am getting this error and at implements RecyclerView.OnScrollChangeListener i am getting error that class require min sdk23 current is 16.
How to resolve it Belal?
i got the java.lang.NoClassDefFoundError too, if anyone can solve it would be super nice of you
Hi, thx for good tutorial.
In your tutorial, if you have 11 datas in table in database you can get only 3 pages without 2 data.
When you input one more data, then all data come out.
How can I load all data although only 1 or 2 data is left.
Information:Gradle tasks [:app:generateDebugSources, :app:generateDebugAndroidTestSources, :app:assembleDebug]
:app:preBuild UP-TO-DATE
:app:preDebugBuild UP-TO-DATE
:app:checkDebugManifest
:app:preReleaseBuild UP-TO-DATE
:volley:compileLint
:volley:copyReleaseLint UP-TO-DATE
:volley:mergeReleaseProguardFiles UP-TO-DATE
:volley:preBuild UP-TO-DATE
:volley:preReleaseBuild UP-TO-DATE
:volley:checkReleaseManifest
:volley:prepareReleaseDependencies
:volley:compileReleaseAidl UP-TO-DATE
:volley:compileReleaseRenderscript UP-TO-DATE
:volley:generateReleaseBuildConfig UP-TO-DATE
:volley:generateReleaseAssets UP-TO-DATE
:volley:mergeReleaseAssets UP-TO-DATE
:volley:generateReleaseResValues UP-TO-DATE
:volley:generateReleaseResources UP-TO-DATE
:volley:packageReleaseResources UP-TO-DATE
:volley:processReleaseManifest UP-TO-DATE
:volley:processReleaseResources UP-TO-DATE
:volley:generateReleaseSources UP-TO-DATE
:volley:processReleaseJavaRes UP-TO-DATE
:volley:compileReleaseJavaWithJavac UP-TO-DATE
:volley:packageReleaseJar UP-TO-DATE
:volley:compileReleaseNdk UP-TO-DATE
:volley:packageReleaseJniLibs UP-TO-DATE
:volley:packageReleaseLocalJar UP-TO-DATE
:volley:packageReleaseRenderscript UP-TO-DATE
:volley:bundleRelease UP-TO-DATE
:app:prepareComAndroidSupportAppcompatV72311Library UP-TO-DATE
:app:prepareComAndroidSupportCardviewV72311Library UP-TO-DATE
:app:prepareComAndroidSupportDesign2311Library UP-TO-DATE
:app:prepareComAndroidSupportRecyclerviewV72311Library UP-TO-DATE
:app:prepareComAndroidSupportSupportV42311Library UP-TO-DATE
:app:prepareComMcxiaokeVolleyLibraryAar100Library UP-TO-DATE
:app:prepareListviewwwVolleyUnspecifiedLibrary UP-TO-DATE
:app:prepareDebugDependencies
:app:compileDebugAidl UP-TO-DATE
:app:compileDebugRenderscript UP-TO-DATE
:app:generateDebugBuildConfig UP-TO-DATE
:app:generateDebugAssets UP-TO-DATE
:app:mergeDebugAssets UP-TO-DATE
:app:generateDebugResValues UP-TO-DATE
:app:generateDebugResources UP-TO-DATE
:app:mergeDebugResources UP-TO-DATE
:app:processDebugManifest UP-TO-DATE
:app:processDebugResources UP-TO-DATE
:app:generateDebugSources UP-TO-DATE
:app:preDebugAndroidTestBuild UP-TO-DATE
:app:prepareDebugAndroidTestDependencies
:app:compileDebugAndroidTestAidl UP-TO-DATE
:app:processDebugAndroidTestManifest UP-TO-DATE
:app:compileDebugAndroidTestRenderscript UP-TO-DATE
:app:generateDebugAndroidTestBuildConfig UP-TO-DATE
:app:generateDebugAndroidTestAssets UP-TO-DATE
:app:mergeDebugAndroidTestAssets UP-TO-DATE
:app:generateDebugAndroidTestResValues UP-TO-DATE
:app:generateDebugAndroidTestResources UP-TO-DATE
:app:mergeDebugAndroidTestResources UP-TO-DATE
:app:processDebugAndroidTestResources UP-TO-DATE
:app:generateDebugAndroidTestSources UP-TO-DATE
:app:processDebugJavaRes UP-TO-DATE
:app:compileDebugJavaWithJavac UP-TO-DATE
:app:compileDebugNdk UP-TO-DATE
:app:compileDebugSources UP-TO-DATE
:app:preDexDebug UP-TO-DATE
:app:dexDebug
UNEXPECTED TOP-LEVEL EXCEPTION:
com.android.dex.DexException: Multiple dex files define Lcom/android/volley/VolleyError;
at com.android.dx.merge.DexMerger.readSortableTypes(DexMerger.java:579)
at com.android.dx.merge.DexMerger.getSortedTypes(DexMerger.java:535)
at com.android.dx.merge.DexMerger.mergeClassDefs(DexMerger.java:517)
at com.android.dx.merge.DexMerger.mergeDexes(DexMerger.java:164)
at com.android.dx.merge.DexMerger.merge(DexMerger.java:188)
at com.android.dx.command.dexer.Main.mergeLibraryDexBuffers(Main.java:504)
at com.android.dx.command.dexer.Main.runMonoDex(Main.java:334)
at com.android.dx.command.dexer.Main.run(Main.java:277)
at com.android.dx.command.dexer.Main.main(Main.java:245)
at com.android.dx.command.Main.main(Main.java:106)
Error:Execution failed for task ‘:app:dexDebug’.
> com.android.ide.common.process.ProcessException: org.gradle.process.internal.ExecException: Process ‘command ‘C:\Program Files\Java\jdk1.7.0_79\bin\java.exe” finished with non-zero exit value 2
Information:BUILD FAILED
Information:Total time: 3.894 secs
Information:1 error
Information:0 warnings
Information:See complete output in console
WHAT IS THIS PLEASE SAY BRO
What a great tutorial ! Unfortunate datas won’t show and the progress bar keep running over and over on my screen… any idea ?
it is not working in android 4.4 plzzz say how to fixx
how to add onItemClick here? Can you please help me.
Hi Belal. Can we replace PHP with Python as a scripting language?
If so, could you tell me how?
Thanks!
Please , make a tutorial which explain how to remove data from recyclerView and database using JSON and Volley
Hello: I would like this to be called from a button as it should do, I appreciate your help, thank you.
Great tutorial bro. but I just want to suggest you in feed.php you use if($page<=$page_limit) which is give error if the page url is odd number cause the rest json value will not appear. instead of that you can use this
if (!$page $page_limit)
Great tutorial bro. but I just want to suggest you in feed.php you use $pagelimit= $total/$limit which is give error if the page url is odd number cause the value will not round example 5:3= 1,666 which is if the page 2 it will not pass the if($page<=$page_limit) . instead of that you can use this $page_limit = round($total/$limit, 0, PHP_ROUND_HALF_UP); so the value will be round number
Your answer didn’t work for me if I had to display a certain amount of items instead of a number of items dividable by 3.
To fix it simply use the ceil function on the number, so change ” $page_limit = $total/$limit; ” to ” $page_limit = ceil($total/$limit); ”
For example, your solution worked if I had to display 5-8-11-… items but not if there were 7-10-13-… items
Using ceil works for both amount of items, so it’s a little bit better to use 🙂
hi, how can i manipulate the feed.php script to display the last row first instead of the first?
change $total = mysqli_num_rows(mysqli_query($con, “SELECT id from feed “)); to $total = mysqli_num_rows(mysqli_query($con, “SELECT id from feed ORDER BY id DESC “));
Scratch that,
change “$sql = “SELECT * from feed limit $start, $limit”;” to “$sql = “SELECT * from feed limit $start, $limit ORDER BY id DESC”;”
how can i use this code in fragment ?? please help
Write me if u needed I get it
Whit this example, can I use a click listener, that when i click in a item open a new activity, and how ?
Thanks!! and sorry for my english…
The same Question :p Help us please !!!
Belal Khan
Please help do custom listview plus images and text with volley and with a pagination or load more feature
PLease can you do one for time table( how do I display data into a time table format)
How to refresh the data if I add new data to JSOn Server
Hello, Please how do i implement this same code on a fragment activity?
Here is my code:
public class AllpostsFragment extends Fragment implements RecyclerView.OnScrollChangeListener {
public AllpostsFragment() {
// Required empty public constructor
}
//Creating a List of superheroes
private List postlists;
//Creating Views
private RecyclerView recyclerView;
private RecyclerView.LayoutManager layoutManager;
private RecyclerView.Adapter adapter;
//Volley Request Queue
private RequestQueue requestQueue;
//The request counter to send ?page=1, ?page=2 requests
private int requestCount = 1;
public static AllpostsFragment newInstance() {
AllpostsFragment fragment = new AllpostsFragment();
fragment.setRetainInstance(true);
return fragment;
}
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
}
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container,
Bundle savedInstanceState) {
View rootView = inflater.inflate(R.layout.fragment_allposts, container, false);
}
@Override
public void onViewCreated(LayoutInflater inflater, View view, Bundle savedInstanceState) {
super.onViewCreated(view, savedInstanceState);
// Inflate the layout for this fragment
View rootView = inflater.inflate(R.layout.fragment_allposts, container, false);
//Initializing Views
RecyclerView recyclerView = (RecyclerView) rootView.findViewById(R.id.recyclerView);
recyclerView.setHasFixedSize(true);
LinearLayoutManager llm = new LinearLayoutManager(getActivity());
llm.setOrientation(LinearLayoutManager.VERTICAL);
//if (listitems.size() > 0 & recyclerView != null) {
// recyclerView.setAdapter(new MyAdapter(listitems));
//
//recyclerView.setLayoutManager(llm);
//Initializing our superheroes list
postlists = new ArrayList();
requestQueue = Volley.newRequestQueue(this);
//Calling method to get data to fetch data
getData();
//Adding an scroll change listener to recyclerview
recyclerView.setOnScrollChangeListener(this);
//initializing our adapter
adapter = new CardAdapter(postlists, this);
//Adding adapter to recyclerview
recyclerView.setAdapter(adapter);
}
//Request to get json from server we are passing an integer here
//This integer will used to specify the page number for the request ?page = requestcount
//This method would return a JsonArrayRequest that will be added to the request queue
private JsonArrayRequest getDataFromServer(int requestCount) {
//Initializing ProgressBar
final ProgressBar progressBar = (ProgressBar) findViewById(R.id.progressBar1);
//Displaying Progressbar
progressBar.setVisibility(View.VISIBLE);
// setProgressBarIndeterminateVisibility(true);
//JsonArrayRequest of volley
JsonArrayRequest jsonArrayRequest = new JsonArrayRequest(Config.DATA_URL + String.valueOf(requestCount),
new Response.Listener() {
@Override
public void onResponse(JSONArray response) {
//Calling method parseData to parse the json response
parseData(response);
//Hiding the progressbar
progressBar.setVisibility(View.GONE);
}
},
new Response.ErrorListener() {
@Override
public void onErrorResponse(VolleyError error) {
progressBar.setVisibility(View.GONE);
//If an error occurs that means end of the list has reached
//Toast.makeText(AllpostsFragment.this,”No More Items Available”, Toast.LENGTH_SHORT).show();
}
});
//Returning the request
return jsonArrayRequest;
}
//This method will get data from the web api
private void getData() {
//Adding the method to the queue by calling the method getDataFromServer
requestQueue.add(getDataFromServer(requestCount));
//Incrementing the request counter
requestCount++;
}
//This method will parse json data
private void parseData(JSONArray array) {
for (int i = 0; i < array.length(); i++) {
//Creating the superhero object
Posts_list postlist = new Posts_list();
JSONObject json = null;
try {
//Getting json
json = array.getJSONObject(i);
//Adding data to the superhero object
postlist.setImageUrl(json.getString(Config.TAG_IMAGE_URL));
postlist.setTitle(json.getString(Config.TAG_NAME));
postlist.setPostedby(json.getString(Config.TAG_POSTEDBY));
} catch (JSONException e) {
e.printStackTrace();
}
//Adding the superhero object to the list
postlists.add(postlist);
}
//Notifying the adapter that data has been added or changed
adapter.notifyDataSetChanged();
}
//This method would check that the recyclerview scroll has reached the bottom or not
private boolean isLastItemDisplaying(RecyclerView recyclerView) {
if (recyclerView.getAdapter().getItemCount() != 0) {
int lastVisibleItemPosition = ((LinearLayoutManager) recyclerView.getLayoutManager()).findLastCompletelyVisibleItemPosition();
if (lastVisibleItemPosition != RecyclerView.NO_POSITION && lastVisibleItemPosition == recyclerView.getAdapter().getItemCount() – 1)
return true;
}
return false;
}
//Overriden method to detect scrolling
@Override
public void onScrollChange(View v, int scrollX, int scrollY, int oldScrollX, int oldScrollY) {
//Ifscrolled at last then
if (isLastItemDisplaying(recyclerView)) {
//Calling the method getdata again
getData();
}
}
}
Hi. So when I run the code I get a message saying E/Surface: getSlotFromBufferLocked: unknown buffer 0xa9f03c70. The app launches but the feed and progress bar do not show at all. Its just a blank white screen. I’m confused as to what could be causing this problem. Any suggestions?
Hi Belal,
It was very great tutorial.
When I click on any image it should display the image and details on new Activity, Can you please help me with it.
How could I do that?
hello
Thank you from your training. I got a full run
But it’s a problem:
When I want to give replies to a request filter end are added to the list
Hi sir this tutorial is great it those work for me so far, but i just want to know how can i add current user to the uploaded image in the feed wall, please could you give me a solution whenever you have some spare time?…
thanks.
Be careful in superheroes_list.xml Change:
To:
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="wrap_content"
How can we refresh the feed by pulling from the top?
Hi guys.
I get this error when trying to execute my project
java.lang.RuntimeException: Unable to start activity ComponentInfo{com.example.myapplication2/com.example.myapplication2.MainActivity}: java.lang.NullPointerException: Attempt to invoke virtual method ‘int java.lang.String.hashCode()’ on a null object reference.
The code in my Main Activity and other classes is as above in the tutorial and so are my layouts
Could you please assist me on how to solve this.
Any help would be greatly appreciated.
Thank you
It didn’t work. Sometimes app crashes or it executes saying No More Items Available. My PHP script is working fine but the app isn’t running I directly imported the app from github.
I am trying to use this for Android Kitkat Api 19 but i having same error.
Even i had go through all the helps even from Comments section. Please tell me how to use in Kitkat.
Error : Caused by: java.lang.ClassNotFoundException: Didn’t find class “XXX” on path: “XXX”
i have only one page json how can i use this?
Hi Belal !
I have a problen on my CardAdapter.java with this line :
imageLoader.get(superHero.getImageUrl(), ImageLoader.getImageListener(holder.imageView, R.drawable.image, android.R.drawable.ic_dialog_alert));
R.drawable.image : the word image is in red and I don’t know why…
Thank you !
Hey I got the same problem, could you fix it?
Thanks.
I got the same problem.
If any one know the solution please help me
same issue
Hi Belal, thanks for the tutorial,please do one on itemOnClick, may be an extension of this one,where by if you click an item, you open it and can perform additional actions
your images are not on the same server?
I do not understand this part , the image link
Can U give in detail how to impliment ItemOnClick selection to perform some task based on the ItemSelected (position)?i need it plz tell me as soon as possible.
can you give an idea how to implement Recycler view inside fragment with json parsing data
hey dude, awesome tutorial.
i’m a little bit stuck/confused
i don’t know where to the dbConnect.php & feed.php scripts go
some insight would be great.
thanks in advance ^_^
hey comrade i want to ask you a question how i make this feed refresh every time i enter a new query to the database
this program read and refresh the data that are already entered before the initiation of the android app feed,apk if i entered new data it doesn’t appear unless i restart the whole application please helpout a comrade
try using swipetorefresh layout. thats all i can ever think of 🙂
How to make the recyclerview can click and change activity? thanks
on feed.php change
else{
echo “over”;
}
into
else
{
$nextLimit = $total – ($limit * ($page – 1));
$nextStart = ($page – 1) * $limit;
if($nextLimit$row2[‘name’],
“publisher”=>$row2[‘publisher’],
“image”=>$row2[‘image’])
);
}
echo json_encode($res2);
}
}
the result will be if the number of rows is not divisible by the limit. on the last page it will show all that is not shown.
for example if you have 10 rows in database and the limit is 3, on feed.php?page=4 it will not show anything but if u use this code it will show the last remaining row on feed.php?page=4
Hope it helps
x code copy above this is the one
else
{
$nextLimit = $total – ($limit * ($page – 1));
$nextStart = ($page – 1) * $limit;
if($nextLimit$row2[‘name’],
“publisher”=>$row2[‘publisher’],
“image”=>$row2[‘image’])
);
}
echo json_encode($res2);
}
}
nah the comment box is somehow deleting some of my post. email me for the code
How can we use this code in minSdkVersion 15 and targetSdkVersion 24?
Thanks for awesome tutorial……………
Please tell me one thing May i use this code in Fragment in the place of Activity
I want to use this code in fragment in place of MainActivity Please tell me how
i got some error to using this code in fragment
Again Thanks For the Great Tutorial Sir please tell me one thing
how to view item details in next page and it is also dymamic…….
PLEASE PLEASE PLEASE HELP
how to add………..this code
mysqli_set_charset($conn, ‘utf8’);
in PHP
Consider if i have 4,5,7,8….. items in database then how should i show all data.First few page is loading properly but in last page one i am getting error.How should i resolve this?
Help Me….!!!
Excellent coding..
Below is my contribution to support lower android versions.
Complete extract of MainActivity
package net.simplifiedcoding.myfeed;
import android.os.Build;
import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import android.support.v7.widget.LinearLayoutManager;
import android.support.v7.widget.RecyclerView;
import android.view.View;
import android.widget.ProgressBar;
import android.widget.Toast;
import com.android.volley.RequestQueue;
import com.android.volley.Response;
import com.android.volley.VolleyError;
import com.android.volley.toolbox.JsonArrayRequest;
import com.android.volley.toolbox.Volley;
import org.json.JSONArray;
import org.json.JSONException;
import org.json.JSONObject;
import java.util.ArrayList;
import java.util.List;
public class MainActivity extends AppCompatActivity {
//Creating a List of superheroes
private List listSuperHeroes;
//Creating Views
private RecyclerView recyclerView;
private RecyclerView.LayoutManager layoutManager;
private RecyclerView.Adapter adapter;
//Volley Request Queue
private RequestQueue requestQueue;
//The request counter to send ?page=1, ?page=2 requests
private int requestCount = 1;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
//Initializing Views
recyclerView = (RecyclerView) findViewById(R.id.recyclerView);
recyclerView.setHasFixedSize(true);
layoutManager = new LinearLayoutManager(this);
recyclerView.setLayoutManager(layoutManager);
//Initializing our superheroes list
listSuperHeroes = new ArrayList();
requestQueue = Volley.newRequestQueue(this);
//Calling method to get data to fetch data
getData();
//Adding an scroll change listener to recyclerview
//recyclerView.setOnScrollChangeListener(this);
if (Build.VERSION.SDK_INT < Build.VERSION_CODES.LOLLIPOP) {
recyclerView.addOnScrollListener(new RecyclerView.OnScrollListener() {
@Override
public void onScrolled(RecyclerView recyclerView, int dx, int dy) {
super.onScrolled(recyclerView, dx, dy);
//Ifscrolled at last then
if (isLastItemDisplaying(recyclerView)) {
//Calling the method getdata again
getData();
}
}
});
} else {
recyclerView.setOnScrollChangeListener(new RecyclerView.OnScrollChangeListener() {
@Override
public void onScrollChange(View v, int scrollX, int scrollY, int oldScrollX, int oldScrollY) {
//Ifscrolled at last then
if (isLastItemDisplaying(recyclerView)) {
//Calling the method getdata again
getData();
}
}
});
}
//initializing our adapter
adapter = new CardAdapter(listSuperHeroes, this);
//Adding adapter to recyclerview
recyclerView.setAdapter(adapter);
}
//Request to get json from server we are passing an integer here
//This integer will used to specify the page number for the request ?page = requestcount
//This method would return a JsonArrayRequest that will be added to the request queue
private JsonArrayRequest getDataFromServer(int requestCount) {
//Initializing ProgressBar
final ProgressBar progressBar = (ProgressBar) findViewById(R.id.progressBar1);
//Displaying Progressbar
progressBar.setVisibility(View.VISIBLE);
setProgressBarIndeterminateVisibility(true);
//JsonArrayRequest of volley
JsonArrayRequest jsonArrayRequest = new JsonArrayRequest(Config.DATA_URL + String.valueOf(requestCount),
new Response.Listener() {
@Override
public void onResponse(JSONArray response) {
//Calling method parseData to parse the json response
parseData(response);
//Hiding the progressbar
progressBar.setVisibility(View.GONE);
}
},
new Response.ErrorListener() {
@Override
public void onErrorResponse(VolleyError error) {
progressBar.setVisibility(View.GONE);
//If an error occurs that means end of the list has reached
Toast.makeText(MainActivity.this, “No More Items Available”, Toast.LENGTH_SHORT).show();
}
});
//Returning the request
return jsonArrayRequest;
}
//This method will get data from the web api
private void getData() {
//Adding the method to the queue by calling the method getDataFromServer
requestQueue.add(getDataFromServer(requestCount));
//Incrementing the request counter
requestCount++;
}
//This method will parse json data
private void parseData(JSONArray array) {
for (int i = 0; i < array.length(); i++) {
//Creating the superhero object
SuperHero superHero = new SuperHero();
JSONObject json = null;
try {
//Getting json
json = array.getJSONObject(i);
//Adding data to the superhero object
superHero.setImageUrl(json.getString(Config.TAG_IMAGE_URL));
superHero.setName(json.getString(Config.TAG_NAME));
superHero.setPublisher(json.getString(Config.TAG_PUBLISHER));
} catch (JSONException e) {
e.printStackTrace();
}
//Adding the superhero object to the list
listSuperHeroes.add(superHero);
}
//Notifying the adapter that data has been added or changed
adapter.notifyDataSetChanged();
}
//This method would check that the recyclerview scroll has reached the bottom or not
private boolean isLastItemDisplaying(RecyclerView recyclerView) {
if (recyclerView.getAdapter().getItemCount() != 0) {
int lastVisibleItemPosition = ((LinearLayoutManager) recyclerView.getLayoutManager()).findLastCompletelyVisibleItemPosition();
if (lastVisibleItemPosition != RecyclerView.NO_POSITION && lastVisibleItemPosition == recyclerView.getAdapter().getItemCount() – 1)
return true;
}
return false;
}
}
If images are repeating on fast scroll, then add below overrides in CardAdapter.java
@Override
public long getItemId(int position) {
return position;
}
@Override
public int getItemViewType(int position) {
return position;
}
Thank You Man, You Just Saved My Life.
hii pls i ma having an error from the PHP and I followed the tutorial well. it says :-
error: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near ‘-3, 3’ at line 1
pls help out
Man, thank you for this tutorial! I was able to make it work following your steps. But now I need this implementation in fragment, not in activity. Can you please direct me somehow?
I extended it as a separate fragment class as
public class FrontPage extends Fragment implements RecyclerView.OnScrollChangeListener{ … }
functions from OnCreate I put in OnCreateView, and so on, but it still do not work..
Can not resolve progressbar at:
final ProgressBar progressBar = (ProgressBar) root.findViewById(R.id.progressBar1);
where root is view object defined in oncreateview..
Can you please help me?
If the $total < $limit… app doesn't show anything. Please help me. How resolve this problem?
Hi
Do you know create layout table , Consists of two pages , The first page will be displayed table , and second page will be for add , delete and update ??
Dear sir,
Many thnks for our tutorial
BTW, mine is listview, not a recycler view,
and would you guide me how to implement it to listview?
Thanks!!!!
Please implement on Fragment , Please !
In pagination https://www.simplifiedcoding.net/android-feed-example-using-php-mysql-volley/ is perfect but
[
{
“feed_id”: “11”,
“regi_id”: “33”,
“regi_name”: “Ankita Trevedi”,
“regi_image”: “http://webbleu.biz/project/p2p/upload/user_image/IMG-20170111-WA0002_14841590408371495451492.jpg”,
“feed_content”: “Website designing logo”,
“feed_images”: [
{
“image”: “http://webbleu.biz/project/p2p/upload/feed/1495539788_International-valentine’s day (26)_&_d73b8f9c-ddb4-41d6-9009-e1beb481fac1.jpg”
}
]
},
{
“feed_id”: “10”,
“regi_id”: “33”,
“regi_name”: “Ankita Trevedi”,
“regi_image”: “http://webbleu.biz/project/p2p/upload/user_image/IMG-20170111-WA0002_14841590408371495451492.jpg”,
“feed_content”: “Pizza time start now”,
“feed_images”: [
{
“image”: “http://webbleu.biz/project/p2p/upload/feed/1495539749_International-pizza_&_0b1cf675-e6bd-4ee9-a45b-202af0886e36.jpg”
}
]
}
] in this api pagination is not working….pl help me
pls give php file for this example…..
how can i covert the json file into php file pls help me
The whole source code is given in the post. What you are looking for?
On running, this is the error: Could not find class ‘android.graphics.drawable.RippleDrawable’, referenced from method android.support.v7.widget.AppCompatImageHelper.hasOverlappingRendering. App does not crash but shows a progressdialog then displays ‘no more items to show’.
hi belal, what type and what collation of image on database?
because I can’t load image from my database, but I can read name and publisher from my database.
Hi
Thanks for the awesome tutorial
Can you help me to convert this to layout based response
eg: if post type is image include on layout
if video include video layout
if text include text layout
pls help me
Error:Execution failed for task ‘:app:transformClassesWithJarMergingForDebug’.
> com.android.build.api.transform.TransformException: java.util.zip.ZipException: duplicate entry: android/support/v4/content/res/TypedArrayUtils.class
Hello i have this error and i cant find solution. Please help me.
hi…….I need create MCQ app use volley with Pagination
need to data view group radio button
can you give to me simple example
how to do this
There is an error in the code.
First page – 3 data’s.
Second Page – 3 data’s
Third Page – 2 data’s.
The issue is, data will be displayed perfectly for First and the second page. However, no data will be displayed for third page, until the page contains a count of 3 data’s in it.
with retrofit?