[转]Android2017最新面试题(3-5年经验个人面试经历

2017-12-28  本文已影响73人  Buckler

http://blog.csdn.net/huangqili1314/article/details/72792682

20141123154112649.png

主流第三方框架总结(结合2017年Android百大框架排行榜,按个人认识排序):
参考来源:http://www.cnblogs.com/jincheng-yangchaofan/articles/7018780.html

1. Retrofit

一句话介绍:Retrofit是一款类型安全的网络框架,基于HTTP协议,服务于Android和java语言

上榜理由:Retrofit以21.8k的stars量雄踞github中android子标题榜首,第一当之无愧。

官网地址 http://square.github.io/retrofit/

https://github.com/square/retrofit

作者:square团队

使用:

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

2.okhttp

一句话介绍:okhttp是一款基于HTTP和HTTP2.0协议的网络框架,服务于java和android客户端

上榜理由,okhttp以20.4k的stars量雄踞github中android子标题第二名。大型公司比如淘宝也封装的是okhttp。Retrofit2.0开始内置okhttp框架,Retrofit专注封装接口完成业务需求,okhttp专注网络请求的安全高效,笔者将两者区分开,是想让后来学习者知道,这是两套框架,学习框架原理时可以分开学习,以免理解混乱。

官网地址 http://square.github.io/okhttp/

github https://github.com/square/okhttp

作者:square团队

使用:

compile 'com.squareup.okhttp3:okhttp:3.8.0'

3.Butter Knife

一句话介绍:Butter Knife所提供了一种能力——使用注解生成模板代码,将view与方法和参数绑定。

上榜理由:github上16.5K个star,配合Androidstudio提供的Butter Knife插件,帮助开发者省却了频繁findviewbyid的烦恼,最新的Butter Knife还提供了onclick绑定以及字符串的初始化,初学者可以查阅Butter Knife以及Butter Knife插件进一步学习!

官网地址:http://jakewharton.github.io/butterknife/

github:https://github.com/JakeWharton/butterknife

作者:JakeWharton ,也是square团队成员之一

使用:

dependencies {
  compile 'com.jakewharton:butterknife:8.6.0'
  annotationProcessor 'com.jakewharton:butterknife-compiler:8.6.0'
}

5. glide

一句话介绍:glide是一款专注于提供流畅划动能力的“图片加载和缓存框架”

上榜理由:15.9k个star,图片加载类框架排名第一的框架,google 在2014开发者大会上演示的camera app就是基于gilde框架开发的

github https://github.com/bumptech/glide

作者 Bump Technologies团队

使用:

repositories {
  mavenCentral()
}

dependencies {
    compile 'com.github.bumptech.glide:glide:3.8.0'
    compile 'com.android.support:support-v4:19.1.0'
}

8.EventBus

一句话介绍:EventBus是一款本地组件间通信框架

上榜理由:组件间通信框架star量第一:14.8k,在大型项目的Activities,fragments,Threads,Services都可以看到它的使用场景,尽管EventBus在向未创建的组件传递事件时有些局限,仅适合在“活着的”组件间传递消息,但仍不妨碍它活跃在各个大型项目各个场景里。

官网地址 http://greenrobot.org/eventbus/documentation/how-to-get-started/

github https://github.com/greenrobot/EventBus

作者 greenrobot

使用:

compile 'org.greenrobot:eventbus:3.0.0'

10.picasso

一句话介绍:强力的图片下载、缓存框架

上榜理由:本榜单出现的第三款图片类框架,不同的是picasso更强调图片下载,你可以将picasso集成进你的项目中,你也可以结合gilde和UIL与picasso,三者一齐封装至你的项目中,按需所用。

官网地址 http://square.github.io/picasso/

github https://github.com/square/picasso

作者 square团队

使用:

compile 'com.squareup.picasso:picasso:2.5.2'

12.fresco

一句话介绍:一款可以管理图片内存的框架

上榜理由:github上12.8k个star,图片类排行榜第四名,facebook的出身证明了它并非是重复造的轮子,在管理图片内存领域上有着它的一片天地,渐进式加载、加载gif都是它与前三位相比独有的特性

官网地址: https://www.fresco-cn.org/

github https://github.com/facebook/fresco

作者 facebook

使用:

dependencies {
  // 其他依赖
  compile 'com.facebook.fresco:fresco:0.12.0'
}

下面的依赖需要根据需求添加:

dependencies {
  // 在 API < 14 上的机器支持 WebP 时,需要添加
  compile 'com.facebook.fresco:animated-base-support:0.12.0'

  // 支持 GIF 动图,需要添加
  compile 'com.facebook.fresco:animated-gif:0.12.0'

  // 支持 WebP (静态图+动图),需要添加
  compile 'com.facebook.fresco:animated-webp:0.12.0'
  compile 'com.facebook.fresco:webpsupport:0.12.0'

  // 仅支持 WebP 静态图,需要添加
  compile 'com.facebook.fresco:webpsupport:0.12.0'
}

13.RxAndroid

一句话介绍:一款Android客户端组件间异步通信的框架

上榜理由:github上12.7k个star,位居组件通信框架的第二名,仅在EventBus之后,如果要问两者的区别,Eventbus是用来取代组件间繁琐的interface,RxAndroid是用来取代AnsyTask的,并不冲突;当然RxAndroid的优点并不仅限于此,更多优雅的实现,可以去官网查阅!

github https://github.com/ReactiveX/RxAndroid

作者 JakeWharton

使用:

compile 'io.reactivex.rxjava2:rxandroid:2.0.1'
compile 'io.reactivex.rxjava2:rxjava:2.1.0'

18.androidannotations

一句话介绍:一款基于注解的快速开发框架

上榜理由:与Butterknife一样基于注解,利用注解快速完成view的初始化,不同的是androidannotations提供了更多的能力:简单的线程模型等;笔者只接触过Butterknife,无法更进一步叙述androidannotations的优势,如果你志在深入了解注解的妙用,可以尝试探索一下!

官网地址 http://androidannotations.org/

github https://github.com/androidannotations/androidannotations

作者: WonderCsabo

28.greenDAO

一句话介绍:greenDAO是一款高效、快速的SQLite型数据库

上榜理由:greenDAO的star数量与Realm不相上下,且与EventBus师出同门,也是由greenrobot团队开发维护的,质量有所保证,但若拷问笔者Realm与greenDao两者的优劣性,只能具体到实际使用当中,模拟线上的使用情形,进行高强度测试后才能下判断,故在此不能一言两语说完,深表遗憾

官网地址:http://greenrobot.org/greendao/

github https://github.com/greenrobot/greenDAO

使用:

buildscript {
    repositories {
        jcenter()
        mavenCentral() // add repository
    }
    dependencies {
        classpath 'com.android.tools.build:gradle:2.3.1'
        classpath 'org.greenrobot:greendao-gradle-plugin:3.2.2' // add plugin
    }
}
 
-----

apply plugin: 'com.android.application'
apply plugin: 'org.greenrobot.greendao' // apply plugin
 
dependencies {
    compile 'org.greenrobot:greendao:3.2.2' // add library
}

48.RxJava-Android-Samples

一句话介绍:一款介绍RxJava使用场景的app

上榜理由:榜单出现的第一个“仅仅为告诉你如何使用另一个项目”的开源项目,它可以说是RxJava的用例,你想得到的想不到的RxJava用法这里都有,这就是为什么它以5.2k个star矗立在这份榜单里的原因。遗憾自己没有创作这么一个受人追捧的demo?赶快动手写个其他的“XX项目用例吧”

github https://github.com/kaushikgopal/RxJava-Android-Samples

作者:kaushikgopal

使用:

clone到本地慢慢探索吧

61.volley

一句话介绍:google推荐使用的Android端网络请求框架

上榜理由:4.4k个star,并不是他不够优秀,而是使用volley已经渐渐成为广大开发者的习惯

github h<a target="_blank">ttps://github.com/google/volley</a>(新版volley地址)

作者:google

使用:

clone源码到本地

62.androidmvp

一句话介绍:一款展示Android端Mvp设计的demo

上榜理由:榜单里为数不多、仅凭展示某种设计模式就获得4.2K个star的项目,如果你有尝试mvp的打算,androidmvp可以作为你的前哨站

github https://github.com/antoniolg/androidmvp

作者:Antonio Leiva

使用:

clone到本地

复习资料参考:
一个帖子学会Android开发四大组件:https://www.cnblogs.com/pepcod/archive/2013/02/11/2937403.html
Android数据持久化存储方式:http://blog.csdn.net/YvonneVon/article/details/53438147

上一篇下一篇

猜你喜欢

热点阅读