Android Development — Some of the best practices

  1. Use Static Final For Constants (static 15%-20% faster)

  2. RecyclerView (replaces ListView and GridView)

  3. Don’t use a database unless you really need to

  4. You can think about realm it’s really awesome!

  5. RxJava is the best alternative to AsyncTasks and so much more

  6. Retrofit is the best networking library there is

  7. Don’t write your own HTTP client, use Volley or OkHttp libraries

  8. Shorten your code with RetroLambda

  9. Combine RxJava with Retrofit and RetroLambda for maximum awesomeness!

  10. Package by Feature, not layers

    for example:
    ├─ data
    │ ├─ local
    │ ├─ model
    │ └─ remote
    ├─ injection
    │ ├─ component
    │ └─ module
    ├─ ui
    │ ├─ main
    │ ├─ detail
    │ └─ etc..
    ├─ util
    └─ views
    ├─ adapters
    └─ widgets

11.Put passwords and sensitive data in gradle.properties

12.FlatBuffers is an efficient cross platform serialization library, so use it

13.think about Dagger2 or BufferKnife.

原文参考链接:https://laanayabdrzak.github.io/

猜你喜欢

转载自blog.csdn.net/u014011112/article/details/61915117