How post params to volley request and get list of Json array?
<p>In my android application I use volley library to get list of feeds from my server and show them in list view in application.
Now I wanna post one parameter to volley request method to get just first 10 posts from server and when ever user scroll down send new parameter  to get second 10 post from server.</p>

<p>I don't know how post paramas to volley request so for solve the problem I use sendpage() method to save requested page in server and read from it what page user want. Actually it work but I know that is not true implement.</p>

<p>So my question is how send this parameter(it just a number) with request to server to get data?</p>

<p>This is my Volley request:</p>

<pre><code> public void requestData(String uri) {


        swipeRefreshLayout.setRefreshing(true);
        StringRequest request = new StringRequest(uri,

                new Response.Listener&lt;String&gt;() {

                    @Override
                    public void onResponse(String response) {
                        //Changed your code here
                        postList = PostJSONParser.parseFeed(response);
                        updateDisplay();

                        offlineList = PostJSONParser.parseFeed(response);
                        for (Post post : offlineList){
                            dataSource.create(post);
                        }
                        adapter.notifyDataSetChanged();
                        swipeRefreshLayout.setRefreshing(false);
                    }

                },

                new Response.ErrorListener() {

                    @Override
                    public void onErrorResponse(VolleyError ex) {
                        Toast.makeText(MainActivity.this, ex.getMessage(), Toast.LENGTH_LONG).show();

                        swipeRefreshLayout.setRefreshing(false);
                    }
                });

        RequestQueue queue = Volley.newRequestQueue(this);
        queue.add(request);
    } 
</code></pre>

<p>This is my updateDisplay() Method:</p>

<pre><code> protected void updateDisplay() {
         adapter = new MyCustommAdapter(MainActivity.this, R.layout.list_item, postList);


        int index = myList.getFirstVisiblePosition();
        View v = myList.getChildAt(0);
        int top = (v == null) ? 0 : v.getTop();

        myList.setAdapter(adapter);
        adapter.notifyDataSetChanged();
        myList.setSelectionFromTop(index, top);


    }
</code></pre>

<p>this is for scroll changing:</p>

<pre><code> public class EndlessScrollListener implements AbsListView.OnScrollListener {

        private int visibleThreshold = 5;


        @Override
        public void onScroll(AbsListView view, int firstVisibleItem, int visibleItemCount, int totalItemCount) {
        }

        @Override
        public void onScrollStateChanged(AbsListView view, int scrollState) {


            // private int currentPage = 0;


            if (scrollState == SCROLL_STATE_IDLE) {
                if (myList.getLastVisiblePosition() &gt;= myList.getCount() - visibleThreshold) {
                    cpage++;
                    new sendpage(cpage).execute();
                    if (isOnline()) {
                        requestData2("http://192.168.1.3/android_login_api/include/get_post.php");
                    } else {
                        Toast.makeText(MainActivity.this, "Network isn't available", Toast.LENGTH_LONG).show();
                    }
                    updateDisplay();
                   // adapter.notifyDataSetChanged();




                }
            }
        }
    }
</code></pre>

<p>And this is my get_post.php file:</p>

<pre><code>&lt;?php
    //Create Database connection
    error_reporting(E_ALL ^ E_DEPRECATED);
    include 'conf.php';


    $page = "select page from page";
    $resultpage= mysql_query($page);
    while ($row = mysql_fetch_assoc($resultpage)) {
    $pagei = $row['page'];
}

    $sql="select * from new_post order by ID DESC limit ".getpage($pagei);
    $result= mysql_query($sql);


    function getpage($p){
    $p--;
    return ($p*10).",10";
    }

    //Create an array
    $json_response = array();

    while ($row = mysql_fetch_array($result, MYSQL_ASSOC)) {
        $row_array['id'] = $row['id'];

        $row_array['title'] = $row['title'];


         $fg = strip_tags($row['content']);
          $gt= str_replace("","",$fg);
          $ff = iconv(mb_detect_encoding($gt, mb_detect_order(), true), "UTF-8", $gt);
           $string = htmlentities($ff, null, 'utf-8');
            $string = str_replace("&amp;nbsp;", "", $string);
            $content = html_entity_decode($string);

        $row_array['content'] = $content;
        $row_array['created_at'] = $row['created_at'];
        $row_array['url_image'] = $row['url_image'];


        //push the values in the array
        array_push($json_response,$row_array);
    }
    array_walk_recursive($json_response, function(&amp;$val) {
    $val = utf8_encode($val);
});
    echo json_encode($json_response, JSON_UNESCAPED_SLASHES);

 print "ok";

?&gt;
</code></pre>