wyouflf / xutils3 Goto Github PK
View Code? Open in Web Editor NEWAndroid orm, bitmap, http, view inject...
Home Page: https://gitee.com/wyouflf/xUtils3
License: Other
Android orm, bitmap, http, view inject...
Home Page: https://gitee.com/wyouflf/xUtils3
License: Other
所有QQ群都已经满了
x.http().get(requestParams, new Callback.CommonCallback() ,使用这个方法时会报错:
java.lang.NoClassDefFoundError: org/xutils/http/request/HttpRequest
为什么用了xutil3之后,百度地图在有的机子上运行不了啊,百度地图初始化就报错,我的机子是5.0系统的,在4.X系统的机子没有问题。
换成新的版本后, 事件注入直接没用了,什么情况啊?
调用Cancelable的cancel后,CommonCallback.onCancelled没有调用,走到onError了
Could not find method java.net.HttpURLConnection.setFixedLengthStreamingMode, referenced from method org.xutils.http.request.HttpRequest.sendRequest
VFY: unable to resolve virtual method 35050: Ljava/net/HttpURLConnection;.setFixedLengthStreamingMode (J)V
VFY: replacing opcode 0x6e at 0x0219
Fatal signal 11 (SIGSEGV) at 0x00000000 (code=1)
然后app就挂掉了,但是却没有任何其他的错误输出,app闪退时也不弹窗提示“很抱歉,xx已停止运行”,反正app界面就突然消失了
能不能设置一个无响应超时, 就是服务器无响应超过这个时间就主动抛除服务器无响应异常
建议参数类型改为context,现在是application,感觉不方便
http://192.168.1.11:8080/test/servlet/list
http://192.168.1.11:8080/test/login
这两个接口应该共享cookie,但是在数据库中存储的path为 /test/ 查询的时候path却是查找 /test,导致两次的cookie不一致
无法支持数组类型的参数
断点续传策略需要服务器配合吗?比如上传一半失败了,下次可以继续上传?
因为用ViewUtils注入的时候,加入注入内容有误,或者找不到。他的提示很不友好,很不容易定位到有问题的某个属性。
下面是我自己修改的代码,望有帮助。
View findView = finder.findViewById(viewInject.value());
if (findView != null) {
field.setAccessible(true);
try {
field.set(object, findView);
} catch (Throwable e) {
String modifier = Modifier.toString(field.getModifiers());
String genericString[] = field.toGenericString().split(" ");
String type = genericString[1];
String name = field.getName();
String injectViewName = findView.getClass().toString().replaceFirst("class", "");
LogUtils.e(modifier + " " + type + " " + name + " 将要注入" + injectViewName);
}
} else {
String modifier = Modifier.toString(field.getModifiers());
String genericString[] = field.toGenericString().split(" ");
String type = genericString[1];
String name = field.getName();
LogUtils.e(modifier + " " + type + " " + name + " 注入id无效");
}
11-29 15:33:43.449 7130-7130/com.tigeroid E/x_log:ImageLoader.onError(L:409): org.xutils.ex.FileLockedException: /storage/emulated/0/Android/data/com.tigeroid/cache/xUtils_img/8ce22f4362f505df8535f7e3110519f9
11-29 15:33:43.449 7130-7130/com.tigeroid E/x_log:ImageLoader.onError(L:409): at org.xutils.cache.LruDiskCache.createDiskCacheFile(LruDiskCache.java:164)
11-29 15:33:43.449 7130-7130/com.tigeroid E/x_log:ImageLoader.onError(L:409): at org.xutils.http.loader.FileLoader.initDiskCacheFile(FileLoader.java:263)
11-29 15:33:43.449 7130-7130/com.tigeroid E/x_log:ImageLoader.onError(L:409): at org.xutils.http.loader.FileLoader.load(FileLoader.java:176)
11-29 15:33:43.449 7130-7130/com.tigeroid E/x_log:ImageLoader.onError(L:409): at org.xutils.http.loader.FileLoader.load(FileLoader.java:41)
11-29 15:33:43.449 7130-7130/com.tigeroid E/x_log:ImageLoader.onError(L:409): at org.xutils.http.request.UriRequest.loadResult(UriRequest.java:81)
11-29 15:33:43.449 7130-7130/com.tigeroid E/x_log:ImageLoader.onError(L:409): at org.xutils.http.request.HttpRequest.loadResult(HttpRequest.java:222)
11-29 15:33:43.449 7130-7130/com.tigeroid E/x_log:ImageLoader.onError(L:409): at org.xutils.http.HttpTask$RequestWorker.run(HttpTask.java:506)
记得2.6版本中是通过configCookieStore来处理cookie的,新版中的cookie持久化是需要自己做吗?谢谢!
11-26 09:57:12.436: W/x_log:ImageDecoder.saveThumbCache(L:508)(7486): Unsupported Bitmap configuration. Currently only RGBA_8888 and RGB_565 are supported
11-26 09:57:12.436: W/x_log:ImageDecoder.saveThumbCache(L:508)(7486): java.lang.RuntimeException: Unsupported Bitmap configuration. Currently only RGBA_8888 and RGB_565 are supported
11-26 09:57:12.436: W/x_log:ImageDecoder.saveThumbCache(L:508)(7486): at android.backport.webp.WebPFactory.nativeEncodeBitmap(Native Method)
11-26 09:57:12.436: W/x_log:ImageDecoder.saveThumbCache(L:508)(7486): at org.xutils.image.ImageDecoder.saveThumbCache(ImageDecoder.java:501)
11-26 09:57:12.436: W/x_log:ImageDecoder.saveThumbCache(L:508)(7486): at org.xutils.image.ImageDecoder.access$0(ImageDecoder.java:491)
11-26 09:57:12.436: W/x_log:ImageDecoder.saveThumbCache(L:508)(7486): at org.xutils.image.ImageDecoder$1.run(ImageDecoder.java:131)
11-26 09:57:12.436: W/x_log:ImageDecoder.saveThumbCache(L:508)(7486): at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1112)
11-26 09:57:12.436: W/x_log:ImageDecoder.saveThumbCache(L:508)(7486): at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:587)
11-26 09:57:12.436: W/x_log:ImageDecoder.saveThumbCache(L:508)(7486): at java.lang.Thread.run(Thread.java:818)
11-26 09:57:12.501: W/x_log:ImageDecoder.saveThumbCache(L:508)(7486): Unsupported Bitmap configuration. Currently only RGBA_8888 and RGB_565 are supported
11-26 09:57:12.501: W/x_log:ImageDecoder.saveThumbCache(L:508)(7486): java.lang.RuntimeException: Unsupported Bitmap configuration. Currently only RGBA_8888 and RGB_565 are supported
11-26 09:57:12.501: W/x_log:ImageDecoder.saveThumbCache(L:508)(7486): at android.backport.webp.WebPFactory.nativeEncodeBitmap(Native Method)
11-26 09:57:12.501: W/x_log:ImageDecoder.saveThumbCache(L:508)(7486): at org.xutils.image.ImageDecoder.saveThumbCache(ImageDecoder.java:501)
11-26 09:57:12.501: W/x_log:ImageDecoder.saveThumbCache(L:508)(7486): at org.xutils.image.ImageDecoder.access$0(ImageDecoder.java:491)
11-26 09:57:12.501: W/x_log:ImageDecoder.saveThumbCache(L:508)(7486): at org.xutils.image.ImageDecoder$1.run(ImageDecoder.java:131)
11-26 09:57:12.501: W/x_log:ImageDecoder.saveThumbCache(L:508)(7486): at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1112)
11-26 09:57:12.501: W/x_log:ImageDecoder.saveThumbCache(L:508)(7486): at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:587)
11-26 09:57:12.501: W/x_log:ImageDecoder.saveThumbCache(L:508)(7486): at java.lang.Thread.run(Thread.java:818)
调用 params.addBodyParameter无法上传文件给服务器
例如有个button,我要在代码里动态的设置OnClickListener,但是现在点击事件的方法必须是private的,和View.OnClickListener public不一致,必须要搞两套。有什么办法能解决这个问题么?最好是能像xutils之前版本一样,能公用一个点击方法
1)如加载一个有分页的列表,每个item最多有5张或者6张图片
2)当加载20页或者30页后发现图片不能加载,重启应用也不能加载图片,只有清楚数据或者重新安装应用才能正常恢复。图片加载这个模块感觉就失去功能了,难道有设置了限制导致的?
java.lang.NoClassDefFoundError: android/backport/webp/WebPFactory
界面切换时需要将上一个页面的所有线程终止掉,没有批量终止线程池线程的功能
xUtils3和之前的2.x版本差异太大了吧,很多包名都改了,和之前的使用方式有很大的差别,不能沿用之前的方式吗?https://github.com/wyouflf/xUtils 中说“xUtils 2.x对Android 6.0兼容不是很好”,到底是哪些模块、功能兼容有问题呢?
这个和OKHttp相比,应该没有优势吧!
请问:
1.setCancelFast的作用是什么?
2.setCancelFast设为true,设置线程池的max size为1,当A下载任务在执行中,B下载任务等待中,cancel B任务时,并不会立即执行B任务回调,等到A任务执行完后或cancel A任务后才回调,如何优化?
补充:
取消下载时,cancel会调用两次
E/x_log:DownloadManager.stopDownload(L:156): stopDownload
E/x_log:DownloadCallback.cancel(L:106): cancel
E/x_log:DownloadCallback.cancel(L:106): cancel
I/Choreographer: Skipped 42 frames! The application may be doing too much work on its main thread.
列表中上拉加载更多时,更是卡得不行,这次使用的机器是nexus4,5.1.1的系统,3.1.8版本
摩托罗拉 ME865 Android 4.04 下载案例执行【db.saveBindingId(downloadInfo);】报错。
org.xutils.sample A/libc: Fatal signal 11 (SIGSEGV) at 0x00000000 (code=1)
希望数据库能进行加密处理,保证数据安全
dbutils是否支持类嵌套?
class A{
int a1
String stra
}
class B{
A a
int b
String strb
}
这样直接保存B的对象可以吗?
能否添加到maven仓库。
很多时候网络请求会引起空指针等异常,希望能在关闭activity的时候同时取消当前页面的请求
同一个下载任务 点了开始下载 等一下再点停止下载 然后再点开始 有几率出来 HTTP 400
Bad request
code: 400, msg: Bad request, result: null
看到您的libs里有so文件,请问支持64位机型吗
访问网络支持gzip 压缩吗
Hello,
我在gradle中添加依赖后,按照README的提示进行初始化,找不到x所在的包,是人品问题么。。。
示例代码
RequestParams params=new RequestParams("http://www.baidu.com");
try {
String response= x.http().getSync(params,String.class);
System.out.println(response);
} catch (Throwable throwable) {
throwable.printStackTrace();
}
异步就不会!
java.lang.NullPointerException
11-28 22:17:22.738 22125-22125/org.xutils.sample W/System.err: at com.android.okhttp.internal.http.HttpEngine.readResponse(HttpEngine.java:632)
11-28 22:17:22.738 22125-22125/org.xutils.sample W/System.err: at com.android.okhttp.internal.http.HttpURLConnectionImpl.execute(HttpURLConnectionImpl.java:347)
11-28 22:17:22.738 22125-22125/org.xutils.sample W/System.err: at com.android.okhttp.internal.http.HttpURLConnectionImpl.getResponse(HttpURLConnectionImpl.java:296)
11-28 22:17:22.738 22125-22125/org.xutils.sample W/System.err: at com.android.okhttp.internal.http.HttpURLConnectionImpl.getResponseCode(HttpURLConnectionImpl.java:503)
11-28 22:17:22.738 22125-22125/org.xutils.sample W/System.err: at org.xutils.http.request.HttpRequest.getResponseCode(HttpRequest.java:307)
11-28 22:17:22.738 22125-22125/org.xutils.sample W/System.err: at org.xutils.http.HttpTask.doBackground(HttpTask.java:271)
11-28 22:17:22.738 22125-22125/org.xutils.sample W/System.err: at org.xutils.common.task.TaskControllerImpl.startSync(TaskControllerImpl.java:63)
11-28 22:17:22.742 22125-22125/org.xutils.sample W/System.err: at org.xutils.http.HttpManagerImpl.requestSync(HttpManagerImpl.java:109)
11-28 22:17:22.742 22125-22125/org.xutils.sample W/System.err: at org.xutils.http.HttpManagerImpl.getSync(HttpManagerImpl.java:96)
Could you please add project description in English?
能不能根据作用把工具分开呢
例如我已经使用了一个图片框架
不需要里面的图片框架了
但是你这里面还引入了一些so文件,并且文件还蛮大的
现在还有很多2.3的用户
我看源码里面,将回调设置成了弱引用,而弱引用随时可能被gc回收,所以可能导致接收不到回调信息?在下载大文件时,下载一段时间前台就接受不到回调信息了。小文件还好,我改成强引用就行了,请问为啥设计成弱引用呢?新人求教
private WeakReference viewHolderRef;
Http请求怎样设置超时?读超时这类的?还是默认已经设置好了? catch (Throwable throwable)我要怎么来严格区分哪些错误是服务器错误,哪些错误是网络错误?
没有params.setCacheMaxAge(1000 * 60)
http://material-design.storage.googleapis.com/publish/material_v_4/material_ext_publish/0B6Okdz75tqQsQ0l4MWpTMmJCTm8/style_imagery_integration_hero1.png
org.xutils.ex.FileLockedException: /storage/emulated/0/Android/data/com.xhl.windowofword/cache/xUtils_img/7590aef6920e0732bf7526b5afc18c15
at org.xutils.cache.LruDiskCache.createDiskCacheFile(LruDiskCache.java:164)
at org.xutils.http.loader.FileLoader.initDiskCacheFile(FileLoader.java:263)
at org.xutils.http.loader.FileLoader.load(FileLoader.java:176)
at org.xutils.http.loader.FileLoader.load(FileLoader.java:41)
at org.xutils.http.request.UriRequest.loadResult(UriRequest.java:81)
at org.xutils.http.request.HttpRequest.loadResult(HttpRequest.java:222)
at org.xutils.http.HttpTask$RequestWorker.run(HttpTask.java:506)
11-24 19:43:28.230 24229-24446/? W/dalvikvm: Exception Ljava/lang/RuntimeException; thrown while initializing Lorg/xutils/http/cookie/DbCookieStore;
11-24 19:43:28.230 24229-24446/? W/dalvikvm: Exception Ljava/lang/ExceptionInInitializerError; thrown while initializing Lorg/xutils/http/request/HttpRequest;
11-24 19:43:28.255 24229-24229/? I/hehe: onErrornull
11-24 19:43:28.255 24229-24229/? I/hehe: onFinished
在Library项目中,R.id.XXX已经不是final修饰,所以在Library项目中似乎使用不了这个工具。这个问题有解吗?
fileParams现在是hashmap,会导致顺序错乱,和上传顺序不一致,建议改为LinkedHashMap
Session 超时,重登陆不能重登陆,cookie管理这个版本有更改吗?
11-25 03:49:30.706 6798-6798/org.xutils.sample E/x_log:ImageLoader.onError(L:409): http://wap.baidu.com/static/img/r/image/2014-04-18/a250be0f0af4d9dd116b4bf1f37dc5c6.jpg
java.io.EOFException
at libcore.io.Streams.readAsciiLine(Streams.java:203)
at libcore.net.http.HttpEngine.readResponseHeaders(HttpEngine.java:573)
at libcore.net.http.HttpEngine.readResponse(HttpEngine.java:821)
at libcore.net.http.HttpURLConnectionImpl.getResponse(HttpURLConnectionImpl.java:283)
at libcore.net.http.HttpURLConnectionImpl.getResponseCode(HttpURLConnectionImpl.java:495)
at org.xutils.http.request.HttpRequest.sendRequest(HttpRequest.java:187)
at org.xutils.http.loader.FileLoader.load(FileLoader.java:212)
at org.xutils.http.loader.FileLoader.load(FileLoader.java:40)
at org.xutils.http.request.UriRequest.loadResult(UriRequest.java:81)
at org.xutils.http.request.HttpRequest.loadResult(HttpRequest.java:222)
at org.xutils.http.HttpTask$RequestWorker.run(HttpTask.java:503)
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.