Recently, I used my spare time to write a life tool class application. The purpose of the beginning is mainly to get familiar with some old frameworks and some new frameworks or third-party libraries. We can see it as a Demo application for practice! Here their use in this application library summary, and some of the implementation effect we are interested in is also here to explain to you, we in the development as a reference.

directory

This directory structure is really a bit confusing, so here is a supplement to the overall structure:

  • App related (Little Autumn Magic Box)
  • Third-party libraries
    • The overall framework of the application (Rxjava + Retrofit + OKHTTP)
    • Some generic and commonly used frameworks (Glide, Leakcanary, Logger, etc.)
      1. Logger Log Printing
      2. GsonFormat & Gson JSON data parsing
      3. Butterknife dependency injection framework
      4. Leakcanary Memory leak detection tool
      5. Glide picture request library
      6. Circleimageview Circular image gallery
      7. GreenDAO database
      8. Eventbus Event publish/subscribe framework
    • Frequently use third-party platforms
      1. Millet push
      2. ShareSDK
      3. SMSSDK
      4. Their Allies statistics
    • Some open source libraries for functionality
      1. BaseRecyclerViewAdapterHelper RecycleView expanding library
      2. ReactiveNetwork Dynamic monitoring of mobile phone network connection status
      3. Colorpicker Color palette selection library
      4. BGAQRCode-Android QR code scanning project
      5. MPAndroidChart graph library
      6. Material – Calendarview material design calendar control
      7. Flexbox-layout box layout control
      8. KenBurnsView Parallax picture control
      9. Materialsearchview material design search box
      10. MagicIndicator library
      11. Android Auto-Update Library
      12. Slidinglayout Jelly bounce effect
      13. SlidingTutorial – Android guide
      14. Dynamic application for Android permissions
      15. Picture gesture control
  • At the end
    • Making the address

Application of the relevant

Here is the download address and demo video of this application, you can download and play: Xiaoqiu Magic Box download address: mobile.baidu.com/item?type=s… Small autumn magic box demo video: v.youku.com/v_show/id_X…

Third-party libraries

Enter the key point below, mainly introduce the library third party framework and library used in the development (more screenshots, mobile phone traffic party cautious into).

1. Overall framework of the application (Rxjava + Retrofit + OKHTTP Network request framework)

Most of the web request frameworks used in previous projects have been packaged OKHTTP frameworks, but in the last year or two Rxjava + Retrofit has gained momentum. As a developer, it’s always about learning and adopting new technologies. In the world of development, it’s always about technology, and when a new technology comes along, it has its advantages, whether it’s better than the old framework, easier to use, etc.

For Rxjava + Retrofit + OKHTTP, I don’t recommend looking for any of those so-called packaged libraries on the Internet right now, People are still using Rxjava and Retrofit natively, although the code is a bit cumbersome, so that you can get familiar with their various uses more quickly. (Also, I haven’t found a library that wraps them perfectly yet.)

The official address of the three libraries please find yourself, here provides an introduction to the use of Demo address (personally also refer to this use) Github address: github.com/rengwuxian/…

If you’re not familiar with the basic usage of all three libraries, check out the tutorials I’ve collected below:

IO /post/560e15… Okhttp tutorial: address: ocnyang.com/tags/OkHttp… Retrofit2 tutorials: ocnyang.com/tags/Retrof…

2. Some general and commonly used frameworks (Glide, Leakcanary, Logger, etc.)

Logger Log printing Github address: github.com/orhanobut/l…

GsonFormat Github address: github.com/zzz40500/Gs… Gson Github address: github.com/google/gson

Butterknife Dependency Injection framework Github address: github.com/JakeWharton…

Leakcanary Memory leak detection tool Github address: github.com/square/leak…

Glide Photo request library Github address: github.com/bumptech/gl… Tutorial address: ocnyang.com/tags/Glide/

Circleimageview Github address: github.com/hdodenhof/C…

Github address of greenDAO database: github.com/greenrobot/…

Github address: github.com/greenrobot/…

3. Use of common third-party platforms (push + social sharing login + SMS verification)

First of all, in fact, all platforms with the same function in the domestic market tend to be basically homogeneous, so there is no need to choose which one is so tangled, and the efficiency difference will not be too big.

  1. Millet push (originally did not want to use millet, can not resist a few years ago millet mobile phone selling good reputation, I will use to try. Here are the shortcomings compared with other platforms. Xiaomi push currently does not support rich text, but its efficiency is very good.
  2. Social sharing and login for ShareSDK Mob
  3. SMS verification of SMSSDK Mob platform (feel Mob platform reputation is stable, on the one hand is a good name, on the one hand forever free)
  4. Ameng statistics (this small application can use most of it)

4. Some open source libraries for features

BaseRecyclerViewAdapterHelper RecycleView expanding library No matter in which project, may use relatively frequent is the list, the list said first that you yourself to choose library. If you’re still using a ListView/GridView, you really need to take some time out and research RecyclerView.

The use of RecyclerView I think we have in the daily development has been frequently used, now for RecyclerView packaging library has also been everywhere, Github star thousands of also a lot of a lot of. You can take a look at the friend to summarize RecyclerView library collection, you will be dazzling: “those cool RecyclerView open-source library finishing” Jane books address www.jianshu.com/p/154891851…

Which I had finally chose BaseRecyclerViewAdapterHelper after comparing multiple libraries this library, said this simple reason: when the choice standard is:

  • **1. ** list should have all functions (add Header&Footer, pull down to refresh the page, pull up to load more of these basic functions);
  • **2. ** can not have invasion, the so-called invasion is not the use of the original ecology has the essence of change, such as some framework requires you to use SuperRecycleView such as these custom control name, more even sometimes look at the source code of these frameworks found, Inside it is an inherited LinearLayout; It is also unacceptable to require you to nest a parent layout around the original control when using it.
  • 3. * * * * here an overview of the BaseRecyclerViewAdapterHelper, this framework invasive are very small, and the layout when you don’t need any change, need to refresh the drop-down, you can be the same in the external layer nested SwipeRefreshLayout. Add a header/footer and you create a new layout and you can easily add it with.add(header). BaseRecyclerViewAdapterHelper this framework you can probably tell from the name, its invasion on the Adapter, but the Adapter is the responsibility of the data Adapter populated, the invasion of the it, in my opinion is acceptable.

Github address: github.com/CymChad/Bas… Github address: Github address: github.com/CymChad/Bas…

Here is the use of “Little Autumn Magic Box” :



RecyclerView recently wrote a more detailed combing article, we can see: RecyclerView combing: click & long according to events, sectionline, drag sort, sliding delete

ReactiveNetwork Dynamic monitoring of mobile network connection status In the current application, often used for example, under the WiFi network to display pictures, and mobile phone traffic does not display pictures, this time need to monitor the connection and disconnect of mobile network, WiFi and traffic switch, in order to make corresponding changes at any time. The ReactiveNetwork library can help you do just that. Github address: github.com/pwittchen/R…

Colorpicker Color palette selection library






Github.com/QuadFlask/c…

BGAQRCode-Android QR code scanning project

The author himself is also a library of others, if your project requires QR code scanning and the requirements are not too high, you can consider using this library. Github address: github.com/bingoogolap…

MPAndroidChart graph library

Anyone who has used charts in Android development will probably know about this library. This library is really powerful not powerful open source library, can meet most of your graph needs. Github address: github.com/PhilJay/MPA…

Material – Calendarview material design calendar control

A very beautiful calendar control, scalability is also very good. Github address: github.com/prolificint…

Flexbox-layout box layout control

Github address: github.com/google/flex… There are a lot of tutorials out there, so Google them.

KenBurnsView Parallax picture control

Sometimes it is used in projects and the effect is very good. Github address: github.com/flavioarfar…

Materialsearchview material design search box

Github address: github.com/MiguelCatal…

MagicIndicator library

This library, currently found more or less or a little bug, remember hongyang God also open source a similar library, also quite good can search by themselves. MagicIndicator address: github.com/hackware199…

Android Auto-Update Library

A library that automatically updates your app locally. Dialog & Notification support for both forms is great. Project address: github.com/feicien/and…

Slidinglayout Jelly bounce effect

This effect is very common in QQ, generally used in WebView, of course you can also use in other places, use your imagination. Github address: github.com/HomHomLin/S…

SlidingTutorial – Android guide


According to the Demo direct use, can be customized things very few, of course, there is nothing to customize the guide page itself, just to see if you like the design of the guide page. There are two libraries here, and I’m going to use the first one in my application, so just enjoy it. Slidingtutorial-android project address: github.com/Cleveroad/s… AppIntro Github: github.com/apl-devs/Ap…

Dynamic application for Android permissions

Starting from Android 6.0, some advanced permissions need to apply dynamic, in previous versions is one-time license all permissions when it is applied in installation of application, but after 6.0, after installation will only allow some low permissions by default and advanced permissions need you manual for the user opening, if you don’t apply in the interface application permissions will be flashing back to collapse.

Developers already know this, but here are a few libraries that can help you dynamically apply for permissions:

  • PermissionsDispatcher address (currently used in the application) : github.com/hotchemi/Pe…
  • RxPermissions address: github.com/tbruyelle/R…
  • Easypermissions address: github.com/googlesampl…

Android picture gesture control

Github address: github.com/boycy815/Pi…

At the end

All right, so much for the library. If you have any problems when playing “Little Autumn Magic Box”, you can leave a message below. If you have any questions about the implementation effect of a function in the application, you can also leave a message below. If I feel necessary, I will write some corresponding tutorials for you. For the “little autumn magic box” source code, can not be put out at present, on the one hand, now just completed, code format what to write are more arbitrary, may not avoid the existence of many bugs; On the other hand, some functions in the application have not been perfected, or an incomplete application. I’ll put the source code on Github when the time is right. (Already uploaded source code)

At present, we have built a corresponding project on Github, and also summarized the implementation of the third-party library and related functions in more detail above, you can have a look:

Github address: github.com/OCNYang/QBo…