
android
文章平均质量分 67
Pizza_Lawson
这个作者很懒,什么都没留下…
展开
-
android studio 不报错,不爆红,没有lint警告,但有代码提示
https://blog.youkuaiyun.com/mp624183768/article/details/109262993原创 2020-11-09 10:48:17 · 1493 阅读 · 0 评论 -
native 调用播放点击声音
int index; MediaPlayer* mp = new MediaPlayer(); const char *url = "/system/etc/automotive/evs/KeypressStandard.ogg"; int fd = open(url,O_RDONLY); if (mp->setDataSource(fd,0,0x7...原创 2019-12-30 16:51:37 · 336 阅读 · 0 评论 -
Android P 图形显示系统(五) 上层Client和SurfaceFlinger的交互
这篇写得不错,native层的服务直接控制和绘制界面都可以使用这种方式,只是有个权限问题没有说,最近几个版本的android系统要获得SurfaceFlinger的客户端都需要对应的selinux的权限。https://www.jianshu.com/p/8e7a9a0b5726...原创 2019-12-12 10:57:16 · 383 阅读 · 0 评论 -
linux struct input_event结构体详解
本文链接:https://blog.youkuaiyun.com/lemontree1945/article/details/78864681原创 2019-10-12 14:17:44 · 705 阅读 · 0 评论 -
Butter Knife
介绍ButterKnife通过@InjectView和视图的ID注解的变量去找到并自动转换为你布局上相应的布局视图。class ExampleActivity extends Activity { @InjectView(R.id.title) TextView title; @InjectView(R.id.subtitle) TextView subtitle;翻译 2014-11-03 08:16:01 · 812 阅读 · 0 评论 -
RxJava的使用基础教学 一
反应性代码的最基本单元是被观察对象和订阅者。一个被观察对象放出数据,一个订阅者消费这些数据。关于数据的释放有一种模式。一个被观察对象可能释放任意个数的数据(包括零个),然后它会在成功完成后终止,或者由于遇到错误而终止。对每个订阅者,被观察对象会调用Subscriber.onNext()很多次,然后调用Subscriber.onComplete()或Subscriber.onError()。这看翻译 2014-11-03 08:25:12 · 1405 阅读 · 0 评论 -
RxJava的使用基础教学 二
首先需要介绍Observable.from(),它的作用是传入一个数据集合执行多次直到集合全部释放出来,例如:Observable.from(urls).subscribe(url -> System.out.println(url));然后,介绍Observable.flatMap(),// Returns a List of website URLs based on a te翻译 2014-11-03 08:25:58 · 1556 阅读 · 0 评论 -
开源项目U2020 ------ Jack Wharton
github地址:https://github.com/JakeWharton/u2020原创 2014-11-03 08:20:32 · 3224 阅读 · 0 评论 -
架构学习
1 思考共通类,包括:静态常量----------静态常量在实际运用中会用到很多,需要进行统一管理。基础控件----------需要为它们进行风格统一,颜色、字体、大小等等。自定义控件-------自定义控件的设计。Dialog--------------dialog需要封装,根据实际情况的不同会产生不同的dialog,比如位置,大小,风格,展示的title、con原创 2014-11-03 08:33:04 · 545 阅读 · 0 评论 -
Retrofit
基本使用方式Retrofit将REST API转变成Java接口,RestAdapter类创建一个GitHubService接口的实现public interface GitHubService { @GET("/users/{user}/repos") List listRepos(@Path("user") String user);}RestAdapter翻译 2014-11-03 08:10:38 · 787 阅读 · 0 评论 -
OkHttp
概览HTTP是现在很多应用的网络连接方式, 通过它我们可以交换数据和媒体。有效的使用HTTP会使你的应用加载更快节约带宽。OKHTTP是一个HTTP客户端,优化点是:1 支持SPDY,允许所有同一主机的请求分享一个socket。2 连接池减少请求延迟(如果SPDY无效)3 透明的GZIP(压缩格式)缩小下载大小4 回应的缓存完全避免网络重复请求当网络出现问题的时翻译 2014-11-03 08:11:58 · 1059 阅读 · 0 评论 -
Cursor和CursorAdapter中的观察者模式机制
转载请注明出处:http://blog.youkuaiyun.com/droyon/article/details/9360099转载 2014-11-03 08:30:12 · 720 阅读 · 0 评论 -
Dagger(该篇为dagger1,即square公司出Jack Wharton领导的开源框架)
介绍应用当中最好的类是那些实现的类,例如:BarcodeDecoder(条形码解析器),KoopaPhysicsEngine(引擎类),AudioStreamer(音频流),这些类都有其依赖的类,可能是BarcodeCameraFinder,DefaultPhysicsEngine或HttpStreamer。相比较而言,最糟糕的是那些既占用空间却并不做多少事的类,例如:BarcodeDec翻译 2014-11-03 08:12:38 · 1193 阅读 · 0 评论 -
关于cannot perform this action after onsaveinstancestate的解决办法
今天遇到了这个问题, 报错信息是:cannot perform this action after onsaveinstancestate。百度了一下,都说将commit替换成commitAllowingStateLoss就可以了。(我的问题在于在onResume()方法内使用fragment的commit)这样替换的确解决了问题,但是后来仔细研究了下才发现事情没这么简单。抛出异常的原因翻译 2014-11-03 08:26:48 · 1181 阅读 · 0 评论 -
Parcelable 序列化
public class LickageObject implements Parcelable { String name; String value; public LickageObject() { } public LickageObject(Parcel source) { name = source原创 2014-11-03 08:34:11 · 493 阅读 · 0 评论 -
android TextView 的垂直滚动
http://www.cnblogs.com/nuliniaoboke/archive/2012/10/24/2736992.html转载 2014-11-07 20:24:00 · 476 阅读 · 0 评论 -
(项目遇到的textview排版问题的亲测解决方案)
package com.lencee.coral.ui.widget;import android.annotation.TargetApi;import android.content.Context;import android.graphics.Canvas;import android.os.Build;import android.text.TextPaint;import原创 2014-11-07 18:54:48 · 767 阅读 · 0 评论 -
Top 7 Tips for RxJava on Android
Top 7 Tips for RxJava on AndroidTOPICSAndroid, Functional Programming, RxJavaLast November I found myself at Futurice in London starting a challenging project that seemed to be the转载 2015-01-26 17:16:30 · 1101 阅读 · 0 评论 -
Functional Reactive Programming on Android With RxJava
Shameless plug: if after reading this article, you want to know more, come hear me talk at DroidCon UK 2013!If you are an application developer, there are two inconvenient truths:Modern ap转载 2015-01-27 09:29:06 · 1081 阅读 · 0 评论 -
使用Github Pages搭建博客
http://toughcoder.net/blog/2014/10/16/blogging-like-a-hacker-with-github-pages/转载 2015-01-27 16:00:44 · 426 阅读 · 0 评论 -
The RxJava Android Module
The rxjava-android module contains Android-specific bindings for RxJava. It adds a number of classes to RxJava to assist in writing reactive components in Android applications.It provides a Sche转载 2015-01-26 15:43:55 · 777 阅读 · 0 评论 -
keystore creation
SigningBy default, there is a debug configuration that is setup to use a debug keystore, with a known password and a default key with a known password.The debug keystore is located in $HOME/.and转载 2015-02-01 01:54:25 · 495 阅读 · 0 评论 -
3D语音天气球(源码分享)——创建可旋转的3D球
http://blog.youkuaiyun.com/a396901990/article/details/41653365转载 2014-12-08 08:45:08 · 803 阅读 · 0 评论 -
Event-driven programming for Android
https://medium.com/google-developer-experts/event-driven-programming-for-android-part-ii-b1e05698e440https://medium.com/google-developer-experts/event-driven-programming-for-android-part-i-f5ea4a3c4转载 2015-02-01 00:31:09 · 619 阅读 · 0 评论 -
Android Tips Round-Up by Dan Lew
1 round upActivity.startActivities() - Nice for launching to the middle of an app flow.TextUtils.isEmpty() - Simple utility I use everywhere.Html.fromHtml() - Quick method for formatting Htm转载 2015-02-01 00:56:06 · 977 阅读 · 0 评论 -
深入解析Android的自定义布局
http://greenrobot.me/devpost/android-custom-layout/翻译 2015-01-27 17:17:13 · 993 阅读 · 0 评论 -
Blur Images Efficiently using Renderscript
https://medium.com/google-developer-experts/android-protips-blur-images-efficiently-using-renderscript-631d5ccb16fd关于使用renderscipt对图形作一些处理的描述。转载 2015-02-01 00:36:42 · 571 阅读 · 0 评论 -
Linkedin工程师是如何优化他们的Java代码的
http://greenrobot.me/devpost/java-faster-less-jvm-garbage/Linkedin工程师是如何优化他们的Java代码的最近在刷各大公司的技术博客的时候,我在Linkedin的技术博客上面发现了一篇很不错博文。这篇博文介绍了Linkedin信息流中间层Feed Mixer,它为Linkedin的Web主页,大学主页,公转载 2015-01-30 23:14:02 · 503 阅读 · 0 评论 -
Why doesn't RecyclerView have onItemClickListener()? and How RecyclerView is different from Listview
Since the introduction of ListView, onItemClickListener has been problematic. The moment you have a click listener for any of the internal elements the callback would not be triggered but it wasn't no转载 2015-01-31 00:20:50 · 553 阅读 · 0 评论 -
Parcelable vs Serializable
Parcelable vs Serializableapril 18, 2013When starting on Android, we all learn that we cannot just pass object references to activities and fragments, we have to put those in an Intent / Bundl转载 2015-02-01 01:19:50 · 628 阅读 · 0 评论 -
What is Reactive Programming?
https://medium.com/reactive-programming/what-is-reactive-programming-bc9fa7f4a7fc各个方面对反应性编程进行概念上得解释。转载 2015-02-01 00:32:19 · 452 阅读 · 0 评论 -
Fast Rendering News Feed on Android
If you work on an Android app (or any touch screen based app actually), there's a very good chance you have at least one activity based on a ListView. In many cases, it may be the screen of your app w转载 2015-02-02 13:23:44 · 845 阅读 · 0 评论 -
How to Use Loaders in Android
With the introduction of Honeycomb Loaders became the preferred way to access data of databases or content providers. They load data asynchronously and notify listeners when the results are ready.转载 2015-02-04 22:44:35 · 844 阅读 · 0 评论 -
Implementing and Using Custom Drawable States
Sunday, January 25, 2015Implementing and Using Custom Drawable States One of the things that Android comes with out of the box is pressed states, which allows colors and drawa转载 2015-02-04 02:49:08 · 611 阅读 · 0 评论 -
性能优化
1 如果不是必须不要创建对象。 int数组会比Integer数组节省空间。 两个一维数组比一个二维数组节省空间。2 常量静态final3 避免get/set4 多用增强for循环5 用double而不用float值6 String StringBuilder StringBuffer的使用区别原创 2015-01-19 16:18:15 · 437 阅读 · 0 评论 -
service和后台线程的区别
很多人在遇到耗时操作引起的UI阻塞时都会问这样一个问题,何时使用service何时开一个后台线程来解决耗时操作问题。其实这句话本身就有误导,因为它默认了service和后台线程之间是互斥的。首先,Android的主线程是在一个应用启动时而开启的单一线程,这个线程就被称为主线程或UI线程。需要注意的是UI线程并不只执行UI任务,所以我更愿意称它为主线程。而在执行其他任务时,它也负责启动appli翻译 2015-01-20 10:47:29 · 1453 阅读 · 0 评论 -
Content Provider 基础
源码分析:http://blog.youkuaiyun.com/luoshengyang/article/details/6946067推荐使用方式:http://www.grokkingandroid.com/android-tutorial-writing-your-own-content-provider/数据库监听频繁更新解决方案:http://stackoverflow.co转载 2015-02-08 02:07:12 · 501 阅读 · 0 评论 -
新的TwoWayView
如果写一个能重用布局的自定义视图是否会更加简单?从我几年前刚开始写Android应用时开始这个问题就一直卡在我脑海里。在AbsListView API 中缺乏合理的扩展钩子一直都是让我最恼火的几个点之一。社区里已经提出了不同的布局实现,它们多数都是基于AbsListView但都没有真正解决框架的问题。因此几个月前,我终于开始着手于 TwoWayView 新的API开发,它会提供翻译 2015-02-10 02:54:40 · 4909 阅读 · 0 评论 -
How to hide/show Toolbar when list is scroling (part 1)
在这篇文章当中我们将会介绍如何完成在Google+上看到的当列表向下滑动时隐藏Toolbar或其他视图,而当向上滑动时又显示出来的效果。这个效果在 Material Design Checklist上有提及.我们将使用RecyclerView来作为列表视图,但在其他可滑动容器上都是可以实现的(比如在listview上需要一些其他工作)。要实现这个效果有两个思路:1 给列表添加p翻译 2015-02-26 10:04:15 · 742 阅读 · 0 评论 -
Replace AsyncTask and AsyncTaskLoader with rx.Observable – RxJava Android Patterns
Replace AsyncTask and AsyncTaskLoader with rx.Observable – RxJava Android PatternsThere are plenty of “Getting Started” type posts talking about RxJava, some of which are in the context of Andro转载 2015-03-02 02:09:35 · 1517 阅读 · 0 评论