Android通用框架

有了这些框架,还愁做不好Android开发吗?

速度膜拜

内存泄露检测 LeakCanary

github地址

https://github.com/square/leakcanary

RecyclerView必备

github地址

https://github.com/CymChad/BaseRecyclerViewAdapterHelper/wiki/%E9%A6%96%E9%A1%B5

MVP

简介

Android MVP Sample,MVP+Retrofit+RxJava实践小结

github地址

https://github.com/WuXiaolong/AndroidMVPSample

butterknife

github地址

https://github.com/JakeWharton/butterknife

网络请求

Retrofit

https://github.com/square/retrofit

依赖

compile'com.squareup.retrofit2:retrofit:2.1.0'

compile'com.squareup.retrofit2:converter-gson:2.1.0'

compile'com.squareup.retrofit2:adapter-rxjava:2.1.0'

相关博客

Android Retrofit 2.0 使用-补充篇

Android Retrofit 2.0使用

Retrofit官网

响应式编程

RxJava

github地址

https://github.com/ReactiveX/RxJava

事件总线

RxBus

简介

基于RxJava写的事件总线

相关博客

RxBus

数据库

greenDAO

https://github.com/greenrobot/greenDAO

图片加载

glide

github地址

https://github.com/bumptech/glide

compile'com.github.bumptech.glide:glide:3.7.0'

picasso

github地址

https://github.com/square/picasso图片操作

简介

Image Cropping Library for Android 图片裁剪

github地址

https://github.com/Yalantis/uCrop

相关博客

uCrop使用及源码浅析

图片操作

PhotoView

github地址

https://github.com/chrisbanes/PhotoView

相关博客

github之PhotoView使用

A circular ImageView for Android 圆头像

github地址

https://github.com/hdodenhof/CircleImageView

视频播放

VideoView

VideoView 的使用非常简单,播放视频的步骤:

在界面布局文件中定义 VideoView 组件,或在程序中创建 VideoView 组件

调用 VideoView 的如下两个方法来加载指定的视频:

setVidePath(String path):加载 path 文件代表的视频

setVideoURI(Uri uri):加载 uri 所对应的视频

调用 VideoView 的 start()、stop()、psuse() 方法来控制视频的播放


ExoPlayer

ExoPlayer Git 地址

用法

ExoPlayer 开源项目包含了 library 和 示例:

ExoPlayer library – 这部分是核心的库

Demo app – 这部分是演示怎么使用 ExoPlayer 的 Demo

ExoPlayer 库的核心类是 ExoPlayer 类。该类维护了播放器的全局状态 。比如如何获取媒体数据,如何缓冲以及是怎样的编码格式。

ExoPlayer 基于 MediaCodec 和 AudioTrack 提供了默认的音视频的 TrackRenderer 实现。所有的 renderers 都需要 SampleSource 对象,ExoPlayer 从 SampleSource 获得 media samples 用于播放。下图展示了 ExoPlayer 是如何配置组合这些组件用于播放音视频的。

ExoPlayer 库提供了一些不同类型的 SampleSource 实例:

ExtractorSampleSource – 用于 MP3,M4A,WebM,MPEG-TS 和 AAC;

ChunkSampleSource – 用于 DASH 和平滑流的播放;

HlsSampleSource – 用于 HLS 播放;

在 ExoPlayer 的 Dome 中使用 DemoPlayer 对 ExoPlayer 进行了封装,并提供了使用上述几种 SampleSource 构建 TrackRenderer 的 Builder。

SmoothStreamingRendererBuilder

DashRendererBuilder

ExtractorRendererBuilder

在使用的时候我们根据不同的需求创建对应的 RendererBuilder,然后将 RendererBuilder 传递给 DemoPlayer 然后调用 DemoPlayer 的 setPlayWhenReady 方法。

Vitamio

Vitamio demo 地址

ijkplayer

ijkplayer 项目地址

最后编辑于
©著作权归作者所有,转载或内容合作请联系作者
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

推荐阅读更多精彩内容

  • Android 自定义View的各种姿势1 Activity的显示之ViewRootImpl详解 Activity...
    passiontim阅读 175,724评论 25 709
  • afinalAfinal是一个android的ioc,orm框架 https://github.com/yangf...
    passiontim阅读 15,702评论 2 45
  • 第一章 天晴 夏末,第一次的初相见,苏络就觉得好像在哪见过清源,这种似曾相识的感觉,让苏络以为就是一见钟情。 那日...
    金娜娜阅读 4,587评论 2 9
  • 今天造成8点左右,站长圈大家都讨论,网站纷纷出现错误打不开的现象,最后确定是河南机房电力事故,导致部分主机和云服务...
    马浩周阅读 1,644评论 0 0
  • 嗜血冷酷独自翱翔眼神穿透乌云身体穿透风沙累了挂在树上孤单了又怎么办? 你飞过我的屋顶落下一片残破的羽毛我把羽毛挂在...
    葺宝阅读 1,267评论 1 5