A required library for Android development.

Source: Internet
Author: User

After completing the project, I began to summarize the detours in the development process. The biggest feeling is: the more you know about Github, the less you need to do. We recommend some frequently-used libraries here, so that readers and friends can avoid detours.

UniversalImageLoader

Android SDK features openness, simplicity, and foundation. You can create it freely, but there are very few items available, for example, when I first started to contact Android, I was surprised that ImageView could not set a source image or even an image on the SD card as the source. This is really hard for people who are used to front-end development, later I learned that there will be many situations in every aspect of image download, cache, decoding, error processing, scaling and cropping. If you simply set a src attribute, the flexibility will be limited, in addition, ImageView is a view class after all. It is not appropriate to manage the thread for some I/O and resource-consuming resources, so it accepts the concept of "self-built health.

So in the previous project development, I actually implemented a class called RemoteImageDownloader by myself, which is really difficult to look back after twists and turns, considering the mechanism of downloading the same URL only once, caching, error, and retry at the same time, and considering how to manage the queue for multiple requests, what's even more painful is to prevent Decoding of multiple images at the same time, and downsample if necessary to prevent memory exceeding the limit ...... Throughout the development process, I continued to contribute to it. After the improvement, I found that there was a library called UniversalImageLoader on Github. It was so late and burst into tears that I almost made another RemoteImageDownloader, although it is more suitable for the project, it is more wise to allow the project to adapt to the stable, dedicated maintenance, and library used by many mainstream applications.

Reference: https://github.com/nostra13/Android-Universal-Image-Loader

Android Asynchronous Http Client

If your development project needs to call the Restful API, it cannot be separated from Asynchronous HTTP requests, persistent Cookie storage, multi-File Upload, GZIP compression, and various I/O error handling. Asynchronous requests can be solved through AsyncTask, but threads are not well managed. Therefore, the Thread + Handler mode is more common, define different messages to differentiate successful requests, connection timeout, network connection failure, and server busy. GzipHeader is automatically added to RequestHeader and GzipOutputStream is automatically set to OutputSteram, organize Multipart or common POST based on the parameter type, use Preference to solidify and store cookies, and so on. encapsulate them all together. The author creates an HTTP processing class named ApiRequest, as the project progresses, it also makes great improvements, including introducing the Activity-Based concept to automatically close the connection after finishing the activity. What happened later must have been known to everyone: One day I met the Android Asynchronous Http Client, which was used by Instagram and Pinterest. Once again, I was crying, because ApiRequest features are almost always available.

Reference: https://github.com/loopj/android-async-http

Pull To Refresh

Pull-down refresh, the most mobile interaction mode. If it is limited To Pull To Refresh Listview, it is too narrow. In fact, Webview, ScrollView, and GridView can be Refresh from the drop-down menu, this is the UI component provided by the Android Pull-to-refresh library. It has gained 2700 stars on github. This plug-in is used directly by the author, without repeating the same mistakes (visual testing is not good even if the experience is done), but it is recommended to you here, because it is really too easy to use.

Reference: https://github.com/chrisbanes/Android-PullToRefresh

Gifview

Android ImageView cannot display GIF images. It still takes a long time to display GIF images. To display motion graphs, the author inherits the ImageView and adds the setGifFile method to parse GIF images through Movie, in addition, the animation function can be implemented by constantly re-painting and calculating the time when the frames are drawn to adjust the number of frames. This is not difficult, and everyone seems to be doing this. However, during the test, it was found that many machines failed to parse Gif images on Movie. The reason was not detailed, and Gifview was found on the Internet. The effect was great, although gc is slow due to memory consumption, the animation display is sufficient. It is worth mentioning that the author of GIF view is from China.

Reference: https://code.google.com/p/gifview

AndroidTouchGallery

Pinch to zoom, flip to navigate, if your project contains Gallery, these features are essential, but there are a lot of libraries in this regard, the AndroidTouchGallery I used is very practical and has a good experience, but its versatility is not very good. Some modifications may be made to integrate with your project, for example, integrating Gifview, ImageLoader, and HttpClient also requires a lot of effort.

Reference: https://github.com/Dreddik/AndroidTouchGallery

This official Google library is really dynamic. New features such as ViewPager and Fragment can also be used in the SDK below ICS, saving a lot of effort.

 

I have previously thought about putting the wheel of repetition on Github to share with you, but this idea is dispelled by factors such as lack of much time to maintain and lack of universality in design.

The above is a library that I think is very useful. If you have any additional information, please comment on it.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.