目前,我在我的android应用程序中使用HttpClient/HttpResponse调用将数据传输和接收到wordpress站点,并且工作正常。我在网站上使用插件来处理请求。谷歌正试图逐步淘汰那些http协议,并建议使用volley进行网络连接。因此,我试图进行转换,但是到服务器的查询post参数会被拒绝。
使用这里的代码作为起点:
private String WORDPRESS_API_ENDPOINT = "http://example.com/api/mobileapp/get_posts?id=123&title=test"; // example u
有时,Volley会在我的应用程序启动时随机崩溃,它会在应用程序类中崩溃,用户将无法再次打开应用程序,直到他们进入设置并清除应用程序数据
java.lang.OutOfMemoryError
at com.android.volley.toolbox.DiskBasedCache.streamToBytes(DiskBasedCache.java:316)
at com.android.volley.toolbox.DiskBasedCache.readString(DiskBasedCache.java:526)
at com.android.volley.toolbox.DiskBased
我有一个项目正在使用volley库。我有一个MyApplication类:
public class MyApplication extends Application {
public static final String TAG = MyApplication.class
.getSimpleName();
private RequestQueue mRequestQueue;
private static MyApplication mInstance;
@Override
public void onCreate(