trinea / android-common Goto Github PK
View Code? Open in Web Editor NEWAndroid common lib, include ImageCache, HttpCache, DropDownListView, DownloadManager, Utils and so on
Home Page: http://p.codekk.com/
Android common lib, include ImageCache, HttpCache, DropDownListView, DownloadManager, Utils and so on
Home Page: http://p.codekk.com/
RT,Android 8.0无法调起安装,需要申请安装未知应用来源的权限
建议各工具类分开哦, 这样在一起有点太重量级了, 比如我只想使用图片缓存功能, 但是整个项目都要引入!
Hi,Trinea:
android/common/util/DownloadManagerPro.java中方法getBytesAndStatus 当要查询的文件是大文件时(比如2GB)总文件大小返回值会越界,返回负整数,建议返回值类型修改为long数组.
如果执行了checkRootPermission判断是否是root才执行业务逻辑 但是下面再执行以su运行的命令。就会很容易导致命令执行失败。
DropDownListView.在下拉时,header会突然整个显示出来,将listivew向下挤压,又很快地恢复到刚拉出一点的状态。这中间会有一次闪屏。另外,正常状态下,scrollbar不能达到最顶端。请确认。
ShellUtils.CommandResult result = ShellUtils.execCommand("screencap", true,true);
System.out.println(result.successMsg);
System.out.println(result.errorMsg);
System.out.println(result.result);
如果这样的话就永远挂起了,没有响应,我不希望截图保存到闪存,我想直接拿到输出,但是命令返回值只有string类型的
我下载了demo的apk,然后点击DownloadManagerDemo,过了一会提示我“美丽说 下载失败”,之后我就删除了这个apk,为何删除了还是隔一段时间提示我“美丽说 下载失败”...求指教!!!
如题,现在项目要切换成https链接,怎么校验证书?
代码片段:
dropDownListView = (DropDownListView)findViewById(R.id.list_view);
try {
dropDownListView.setOnBottomListener(new OnClickListener() {
@OverRide
public void onClick(View v) {
new GetDataTask(false).execute();
}
});
} catch (Exception e) {
e.printStackTrace();
}
情况:已debug跟踪过dropDownListView不是null
异常信息:
03-28 20:37:11.200 15372-15372/community.o2o.com.meimo W/System.err﹕ java.lang.NullPointerException
03-28 20:37:11.220 15372-15372/community.o2o.com.meimo W/System.err﹕ at cn.trinea.android.common.view.DropDownListView.setOnBottomListener(DropDownListView.java:351)
03-28 20:37:11.220 15372-15372/community.o2o.com.meimo W/System.err﹕ at community.o2o.com.meimo.view.SearchListActivity.onCreate(SearchListActivity.java:36)
03-28 20:37:11.220 15372-15372/community.o2o.com.meimo W/System.err﹕ at android.app.Activity.performCreate(Activity.java:5453)
03-28 20:37:11.220 15372-15372/community.o2o.com.meimo W/System.err﹕ at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1093)
03-28 20:37:11.220 15372-15372/community.o2o.com.meimo W/System.err﹕ at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2377)
03-28 20:37:11.220 15372-15372/community.o2o.com.meimo W/System.err﹕ at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2471)
03-28 20:37:11.225 15372-15372/community.o2o.com.meimo W/System.err﹕ at android.app.ActivityThread.access$900(ActivityThread.java:175)
03-28 20:37:11.225 15372-15372/community.o2o.com.meimo W/System.err﹕ at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1308)
03-28 20:37:11.225 15372-15372/community.o2o.com.meimo W/System.err﹕ at android.os.Handler.dispatchMessage(Handler.java:102)
03-28 20:37:11.225 15372-15372/community.o2o.com.meimo W/System.err﹕ at android.os.Looper.loop(Looper.java:146)
03-28 20:37:11.225 15372-15372/community.o2o.com.meimo W/System.err﹕ at android.app.ActivityThread.main(ActivityThread.java:5602)
03-28 20:37:11.225 15372-15372/community.o2o.com.meimo W/System.err﹕ at java.lang.reflect.Method.invokeNative(Native Method)
03-28 20:37:11.225 15372-15372/community.o2o.com.meimo W/System.err﹕ at java.lang.reflect.Method.invoke(Method.java:515)
03-28 20:37:11.230 15372-15372/community.o2o.com.meimo W/System.err﹕ at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1283)
03-28 20:37:11.230 15372-15372/community.o2o.com.meimo W/System.err﹕ at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1099)
03-28 20:37:11.230 15372-15372/community.o2o.com.meimo W/System.err﹕ at dalvik.system.NativeStart.main(Native Method)
比如缓存一个月的话 maxAge = 30 * 24 * 60 * 60 = 2592000
然后 maxAge * 1000 就超过了int的范围变成了负数,然后expireTime就永远在当前时间之前了.缓存就永远失败了.
232 行改成long应该就可以了吧? 否则267行那里就会导致 maxAge * 1000 变成 -1702967296
滚动条应该计算了listview header的高度,导致滑动到第一条的时候,滚动条不在最顶部
当ListView的dividerHeight属性值不为0时,先滚动列表到最底部,然后再快速下拉到ListView顶部,将会出现ListView上下抖动的情况。而只要去掉dividerHeight属性就没有此问题。
貌似PatchUtils里面有一段JNI调用,请问是不是少了文件?
错误信息:java.lang.SecurityException: Package null does not belong to 1000
求问一下,这是什么原因?静默安装是可以成功的,应用已经用系统签名,并且push到system/app目录下。
Hello,
great work. indeed it would be great if we have 2 versions of Utils.
i hope it makes clear. because sometimes a developer wants just one Utils in their project and they are ended up importing many files.
参数无效?
在执行ShellUtils.execCommand()时发现在控制台会有如下提示:
W/System.err: java.io.SyncFailedException: fsync failed: EINVAL (Invalid argument)
W/System.err: at java.io.FileDescriptor.sync(FileDescriptor.java:77)
W/System.err: at java.io.FileOutputStream.flush(FileOutputStream.java:194)
W/System.err: at java.io.FilterOutputStream.flush(FilterOutputStream.java:88)
W/System.err: at java.io.DataOutputStream.flush(DataOutputStream.java:63)
ImageSDCardCache initData,还有loadDataFromDb 测试了下,感觉没效果呀。
如果说缓存 有效,是不是在断网 的情况下,也应该显示图片呢。
红米Note2(已经Root)静默卸载app失败,错误日志是:uninstallSilent successMsg:, ErrorMsg:CANNOT LINK EXECUTABLE: could not load library "libc.so" needed by "/system/bin/sh"; caused by "libc.so" is 32-bit instead of 64-bit
差不多吧整个github都抄下来了,运行要下载一大堆东西,建议楼主发点自己写的有研究价值的东西,勿喷谢谢
是否打算增加系统截屏方面的功能,刚好我可以提供相应代码
代码好多都是老外那里抄来的,注释也不改,整理成了一坨
要用个简单的demo要导入一个庞大的工程 哎 这类人好多啊现在
for (String command : commands) {
if (command == null) {
continue;
}
// donnot use os.writeBytes(commmand), avoid chinese charset error
os.write(command.getBytes());
os.writeBytes(COMMAND_LINE_END);
os.flush();
}
当传入的commands数组过大,os write将近64M的字节时会出现错误
你好,SingletonUtils.java这个类我关注了好久,一直没有明白它是如何使用的,我的理解是为了单利代码的重复书写,但是具体的写法我不能明白。麻烦给讲解或者发段代码学习一下。谢谢!
是否打算增加系统截屏反面的功能,刚好我可以提供相应代码
java.lang.RuntimeException: Unable to start activity ComponentInfo{cn.trinea.android.demo/cn.trinea.android.demo.MainActivity}: android.view.InflateException: Binary XML file line #31: Error inflating class com.google.ads.AdView
ShellUtils类,执行过程中有可能卡死,怎么设置timeout
我自定义了base adapter ,但是显示不出内容,从打印结果看老是调用 getCount 没有调用getView.
研究了一下imagecache的code。demo app的用法是:
IMAGE_SD_CACHE.get(imageUrlList.get(position), holder.imageView);
一个建议,这个接口是不是不应该关心view呢,包括callback的接口。因为在callback的时候view和url的关系可能变化,或者view已经不可见了。如果用的人把ImageSDCardCache用成singleton的了,那么是不是可能造成view的内存泄漏呢。
可能我的理解有误,供大家讨论吧
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.