日韩性视频-久久久蜜桃-www中文字幕-在线中文字幕av-亚洲欧美一区二区三区四区-撸久久-香蕉视频一区-久久无码精品丰满人妻-国产高潮av-激情福利社-日韩av网址大全-国产精品久久999-日本五十路在线-性欧美在线-久久99精品波多结衣一区-男女午夜免费视频-黑人极品ⅴideos精品欧美棵-人人妻人人澡人人爽精品欧美一区-日韩一区在线看-欧美a级在线免费观看

歡迎訪問 生活随笔!

生活随笔

當(dāng)前位置: 首頁 > 人文社科 > 生活经验 >内容正文

生活经验

android -volley-请求数据

發(fā)布時(shí)間:2023/11/27 生活经验 36 豆豆
生活随笔 收集整理的這篇文章主要介紹了 android -volley-请求数据 小編覺得挺不錯(cuò)的,現(xiàn)在分享給大家,幫大家做個(gè)參考.
    

     private List<gson.DataBean>arrGson;//請求的數(shù)據(jù)
    //請求數(shù)據(jù)的方法
public void initData()
{
RequestQueue mQueue = Volley.newRequestQueue(getApplicationContext());
String url ="http://www.fashions88.com/you/HBooks88/GetBooks88Data.php?&Type=NewBook";
StringRequest stringRequest_get = new StringRequest(url, new Response.Listener<String>() {
@Override
public void onResponse(String response) {
Log.d("TAG", response);
Gson gsons = new Gson();
gson gs = gsons.fromJson(response,gson.class);
arrGson = gs.getData();
// for (gson.DataBean beans : gs.getData()) {
// Log.d("data", beans.getName());
// }
}
}, new Response.ErrorListener() {
@Override
public void onErrorResponse(VolleyError error) {
Log.e("TAG", error.getMessage(), error);
}
});
mQueue.add(stringRequest_get);
}

//
模型
package bluewebprinter.pericles.net.bluewebprinter;

import java.util.List;

/**
* Created by you on 2017/3/28.
* http://www.fashions88.com/you/HBooks88/GetBooks88Data.php?&Type=NewBook
* http://www.fashions88.com/you/HBooks88/GetBooks88Data.php?&Type=Other
*/

public class gson {

private List<DataBean> data;

public List<DataBean> getData() {
return data;
}

public void setData(List<DataBean> data) {
this.data = data;
}

public static class DataBean {
/**
* Name : 綜合能力測驗(yàn)復(fù)習(xí)指導(dǎo)
* Author : 本書編寫組 編
* USPrice : 6.83
* PhotoPath : http://img33.dangdang.com/70/31/20691763-1_o.jpg
* Book_No : 9787010076812
* Publisher : 人民出版社
* Saved_PhotoPath : 20091015/9787010076812.jpg
* Publish_Date_T : 22099る
* SCDName : 政治
*/

private String Name;
private String Author;
private String USPrice;
private String PhotoPath;
private String Book_No;
private String Publisher;
private String Saved_PhotoPath;
private String Publish_Date_T;
private String SCDName;

public String getName() {
return Name;
}

public void setName(String Name) {
this.Name = Name;
}

public String getAuthor() {
return Author;
}

public void setAuthor(String Author) {
this.Author = Author;
}

public String getUSPrice() {
return USPrice;
}

public void setUSPrice(String USPrice) {
this.USPrice = USPrice;
}

public String getPhotoPath() {
return PhotoPath;
}

public void setPhotoPath(String PhotoPath) {
this.PhotoPath = PhotoPath;
}

public String getBook_No() {
return Book_No;
}

public void setBook_No(String Book_No) {
this.Book_No = Book_No;
}

public String getPublisher() {
return Publisher;
}

public void setPublisher(String Publisher) {
this.Publisher = Publisher;
}

public String getSaved_PhotoPath() {
return Saved_PhotoPath;
}

public void setSaved_PhotoPath(String Saved_PhotoPath) {
this.Saved_PhotoPath = Saved_PhotoPath;
}

public String getPublish_Date_T() {
return Publish_Date_T;
}

public void setPublish_Date_T(String Publish_Date_T) {
this.Publish_Date_T = Publish_Date_T;
}

public String getSCDName() {
return SCDName;
}

public void setSCDName(String SCDName) {
this.SCDName = SCDName;
}
}
}

轉(zhuǎn)載于:https://www.cnblogs.com/shenlaiyaoshi/p/6635681.html

總結(jié)

以上是生活随笔為你收集整理的android -volley-请求数据的全部內(nèi)容,希望文章能夠幫你解決所遇到的問題。

如果覺得生活随笔網(wǎng)站內(nèi)容還不錯(cuò),歡迎將生活随笔推薦給好友。