volley

Volley slow and causing memory leak

匿名 (未验证) 提交于 2019-12-03 01:49:02
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: In my project, I am using volley to download a JSON stream which I parse and show in a listview. I use the following method to load my data: private void loadEventData(int year, final int month) { // get volley request queue requestQueue = cpcApplication.getRequestQueue(getActivity()); String url = "****************?year=" + year + "&month=" + month; pd = ProgressDialog.show(getActivity(), "Loading Events", "Retrieving Data from Server"); pd.setCancelable(true); JsonObjectRequest jr = new JsonObjectRequest(Request.Method.GET, url, null, new

Android Volley give me an outOfMemory exception

匿名 (未验证) 提交于 2019-12-03 01:48:02
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I am using volley to showing images in horizontal swipe view from the server, but my images are quite large that's way i am getting an exception of out of memory Below is my volley class: public class Volley{ private RequestQueue mRequestQueue; private ImageLoader mImageLoader; public Volley(Context ctx) { Log.v("Volley", "Volley onCreate"); mRequestQueue = com.android.volley.toolbox.Volley.newRequestQueue(ctx); final int maxMemory = (int) (Runtime.getRuntime().maxMemory() / 1024); final int cacheSize = maxMemory / 8; ImageLoader.ImageCache

Does Android Volley support SSL?

匿名 (未验证) 提交于 2019-12-03 01:39:01
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: Does anyone know whether Volley supports SSl in Android? Is there is any way to support SSL via Volley? 回答1: You can refer to my working sample code. Hope this helps! public class MainActivity extends AppCompatActivity { private TextView mTextView; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); mTextView = (TextView) findViewById(R.id.textView); String url = "https://192.168.1.100/testvolley"; HurlStack hurlStack = new HurlStack() { @Override

android Volley library NegativeArraySizeException

匿名 (未验证) 提交于 2019-12-03 01:34:02
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I'm getting this NegativeArraySizeException from Volley library. This error started after I changed Volley android-library-module to a maven dependencies like compile 'com.android.volley:volley:1.0.0' I've this singleton pattern and I change the addToRequestQueue method to avoid double request bug with following link : public <T> void addToRequestQueue(Request<T> req) { req.setRetryPolicy(new DefaultRetryPolicy( 0, DefaultRetryPolicy.DEFAULT_MAX_RETRIES, DefaultRetryPolicy.DEFAULT_BACKOFF_MULT)); getRequestQueue().add(req); } I see that

Error:Cannot configure the 'publishing' extension after it has been accessed

匿名 (未验证) 提交于 2019-12-03 01:25:01
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 由 翻译 强力驱动 问题: Error:Cannot configure the 'publishing' extension after it has been accessed. I am getting this error after updating my android studio. this is my app.gradle apply plugin : 'com.android.application' android { compileSdkVersion 23 buildToolsVersion '23.0.2' defaultConfig { minSdkVersion 14 targetSdkVersion 23 versionCode 1 versionName "1.0" vectorDrawables . useSupportLibrary = true generatedDensities = [] } aaptOptions { additionalParameters "--no-version-vectors" } buildTypes { release { minifyEnabled false proguardFiles

Volley JsonObjectRequest Post request not working

匿名 (未验证) 提交于 2019-12-03 01:10:02
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 由 翻译 强力驱动 问题: I am using android Volley for making a request. So I use this code. I don't understand one thing. I check in my server that params is always null. I consider that getParams() not working. What should I do to solve this issue. RequestQueue queue = MyVolley . getRequestQueue (); JsonObjectRequest jsObjRequest = new JsonObjectRequest ( Request . Method . POST , SPHERE_URL , null , new Response . Listener () { @Override public void onResponse ( JSONObject response ) { System . out . println ( response ); hideProgressDialog (); } }, new

NoClassDefFoundError when using Android Volley

匿名 (未验证) 提交于 2019-12-03 01:03:01
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I am trying to make a network request using android volley library: StringRequest jsObjRequest = new StringRequest(Request.Method.GET, Network.getFullUrl("/Account/Login"), new Listener<String>() { @Override public void onResponse(String response) { // TODO Auto-generated method stub } }, new ErrorListener() { @Override public void onErrorResponse(VolleyError error) { // TODO Auto-generated method stub } }); Network.getInstance(this).addToRequestQueue(jsObjRequest); I have included the library in the build path under Projects. And it

Android volley, how to pass post parameters dynamically

匿名 (未验证) 提交于 2019-12-03 00:52:01
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I'm new to google's Volley network library (and also to Android !), and I'm trying to pass POST arguments in a dynamic way ! For now I am overiding the : getParams() method : And returning the params in an hard coded manner. @Override protected Map<String, String> getParams() { Map<String, String> params = new HashMap<String, String>(); params.put("login", "my_login"); params.put("password", "my_password"); return params; } I would like to pass variables instead of "hard coded" strings... First I tried to put my Map of params as a member of

android中网络操作使用总结(http)

隐身守侯 提交于 2019-12-01 18:35:55
Android是作为智能手机的操作系统,我们开发的应用,大多数也都需要连接网络,通过网络发送数据、获取数据,因此作为一个应用开发者必须熟悉怎么进行网络访问与连接。通常android中进行网络连接一般是使用scoket或者http,http是最多的情况,这里,我来总结下,怎么进行http网络访问操作。 android是采用java语言进行开发的,android的包中包含java的URLConnection和apache 的httpclient,因此我们可以使用这两个工具进行网络连接和操作。同时,为了控制是否允许程序连接网络,我们开发应用时,需要在Manifest文件中配置申请网络连接的权限,代码如下。 <uses-permission android:name="android.permission.INTERNET"/> 使用URLConnection连接网络 URLConnection为java.net包中提供的网络访问,支持http,https,ftp等,进行http连接时,使用HttpURLConnection即可,示例代码如下: URL url = new URL("http://www.android.com/"); HttpURLConnection urlConnection = (HttpURLConnection) url.openConnection();

浅谈——Android学习之路

半腔热情 提交于 2019-11-28 17:03:31
电脑–推荐 Mac   首先声明我不是果粉,个人 Windows,Linux,Mac OX 系统均用过, 只能说 Windows 上面的开发工具简直难以恭维,尤其命令行超级难用,而 Linux 自己必须得花不少时间在折腾中,更是不适合新手了,Max OS 是我认为迄今为止最好用的系统,没有之一, 所以如果你不差钱的话,强烈建议入手一台 Mac,推荐 Pro 系列, 当然它的价格确实比较昂贵,如果暂时入手有困难,推荐以后手头宽裕的时候再入手吧,会带给你质的体验。(Google 的工程师们都在用 Mac,应该比较有说服力吧) 手机–推荐 Nexus 5   做 Android 开发最难以忍受的就是那龟速的模拟器,强烈推荐入手我 Google 的 Nexus 系列,原生 rom,性价比超高,有条件的推荐再入手一台小米或三星之类的,不是因为他们有多好用,而是因为目前市场上这两个品牌的手机份额最大,实际开发中可能需要 进行适配与测试,总之你需要有台 Android 手机。你可能还需要知道魅族手机有个 SmartBar 的东东,虽然我认为确实很 SB。最后你实在还是要用模拟器的话,那么姑且就给你推荐一款比较快速的模拟器吧—-Genymotion, 具体的见我这篇博客 一个强大的 Android 模拟器 Genymotion 开发环境 Eclipse ADT   Google