12/08/2018, 10:52

Tập hợp Open Source Library "khủng" nhất dành cho Android

1. Nguồn gốc Bài viết được dịch từ blog rất nổi tiếng trên qiita "イマドキなイカした Android のオープンソースライブラリ集". (Đăng ngày 23-11-2014, edit lần cuối vào 7-5-2015) Link gốc: http://qiita.com/KeithYokoma/items/fb6872a72a75e9b6f2e6 2. Môi trường phát triển Android SDK Android SDK Installer: Nếu ...

1. Nguồn gốc

Bài viết được dịch từ blog rất nổi tiếng trên qiita "イマドキなイカした Android のオープンソースライブラリ集".

(Đăng ngày 23-11-2014, edit lần cuối vào 7-5-2015)

Link gốc: http://qiita.com/KeithYokoma/items/fb6872a72a75e9b6f2e6

2. Môi trường phát triển

Android SDK

  • Android SDK Installer: Nếu không muốn download từ trang chính thức rồi phải chọn loại SDK tải về hãy sử dụng bản cài trên. Từ Shell dùng 1 lệnh command là có thể download ngay lập tức, rất tiện khi sử dụng CI.
  • ADB Idea: Plugin dành cho AndroidStudio và IntelliJ dùng cho việc có thể sử dụng ADB command dễ dàng từ IDE. Nó trợ giúp việc chọn từ menu và thực hiện chạy command.

3. Tối ưu hóa code

DI container

  • Dagger: DI container dùng cho Java hay Android của công ty square. Sử dụng annotation javax.inject.Inject. Tạo code khi compile.
  • Proton: DI container dùng cho Android. Sử dụng annotation javax.inject.Inject. Đưa instance vào tại thời điểm execute.
  • ButterKnife: Chuyên hóa cho injection của View.
  • RoboGuice: Wrapper dùng cho Android được Google cung cấp. Bên cạnh sử dụng annotation javax.inject.Inject, cung cấp độc lập annotation dành cho injection.

Tạo View

  • Michelangelo: Sử dụng annotation để chỉnh sửa code custom view. Sau khi view được inflate, có thể chỉ xử lý muốn chạy bằng annotation.

Resource

  • Paraphrase: Library giúp format string resource có thể dễ đọc và debug hơn. Những lỗi programming liên quan đến format string resource sẽ phân biệt vào lúc compile chứ không phải runtime.

Utility

  • AndroidAnnotations: Library sử dung annotation, bằng việc bắt tự động tạo code lúc compile giúp giảm lượng code phải viết. Bên cạnh có vai trò như DI container có thể đưa vào Extra chứa trong Intent, resource, system service và view, có thể điều khiển method để chạy tại main thread hay background thread.
  • Amalgam: Là commons library như Apache Commons dành cho Android. Có wrapper các loại Manager và wrapper của Context#getSystemService(String).
  • Guava: Là commons library như Apache Commons dành cho Android. Tập hợp nhiều loại utility dành cho Java.

Giải quyết vấn đề tương thích device

  • AndroidDeviceCompatibility: Library giúp giải quyết vấn đề tương thích giữa các device.

Module hóa

  • android-promise: Library dành để module hóa các xử lý async.

4. UI component

Pull to refresh

  • ActionBar PullToRefresh: UI Component xuất ra hiển thị có update tại ActionBar khi người dùng pull.
  • Android PullToRefresh: UI Component update khi pull theo phong cách Twitter. Hiện nay đã không maintain nữa nên khuyến khích sử dụng ActionBar PullToRefresh sẽ tốt hơn.

ActionBar

  • FadingActionBar: Library áp dụng effect fade-out tại ActionBar.
  • GlassActionBar: Library áp dụng effect như cửa sổ trong suốt tại ActionBar.

WebView

  • Chromium WebView: Backport Library Webview của Chromium engine được đưa vào từ version KitKat. Sử dụng library này có thể giúp giải quyết được vấn đề tương thích OS version hay device khi implement Webkit.

Text・Font

  • emojicon: Library giúp sử dụng emoji trên TextView.
  • IonIconView: Library giúp hiển thị icon được cung cấp bởi ionicons.com được trên View.
  • Android Iconify: Library giúp sử dụng được các loại font của FontAwesome trong app.
  • Calligraphy: Library giúp làm dễ dàng custom font.

Calendar

  • ExtendedCalendarView: Library cung cấp calendar view có thể hiển thị event, tạo thành set với DB lưu trữ content của calendar.
  • GoogleCalendarView: Backport từ calendar app của Google.

Export

  • Android StackBlur: Cài export blur vào Bitmap.
  • GPUImage Android: Giúp chuyển GPU Image được tạo cho iOS sang Android.

Notification

  • SuperToasts: Library giúp thay đổi được bề ngoài khi đặt nút bằng cách extend Toast.
  • Crouton: Thay thế Toast có sẵn, cung cấp Toast có khả năng custom dựa theo Context.

Layout

  • ImageLayout: Layout Component đặc biệt để đặt View trên ảnh. Có tọa độ riêng và quản lý chúng.

ListView・GridView

  • StickyListHeaders: Giống Instagram, cung cấp header bám theo scroll của ListView.
  • StickyGridHeaders: Phiên bản GridView của library phía trên.
  • Android StaggeredGrid: Có thể đối phó grid có độ cao khác nhau.
  • AdapterView Animator: Helper Library thực hiện animation khi thêm hàng vào AdapterView.
  • cwac-touchlist: Library thực hiện drag-and-drop cho List.

ViewPager

  • JazzyViewPager: Có thể customize animation khi swipe.
  • Android ViewPagerIndicator: View hiển thị vị trí đi theo ViewPager.

Dialog

  • Android Styled Dialogs: Library giúp thực hiện áp dụng style vào dialog theo chủ đề.

ImageView

  • CustomShape ImageView: ImageView có thể cắt chỉnh ảnh rồi tạo nhiều hình đa dạng.
  • Rounded ImageView: Library tạo ImageView có góc tròn.
  • PhotoView ImageView có chức năng phóng to thu nhỏ ảnh.
  • ImageViewZoom: ImageView có chức năng phóng to thu nhỏ ảnh.

Chat

  • Holo Graph Library: Library tạo Graph Chat style Holo.
  • AChartEngine: Library tạo Graph Chat.

Interaction

  • Android Swipe To Dismiss: Library thực hiện việc swipe View rồi xóa.
  • EnhancedListView: Giống như Gmail, mỗi khi swipe một hàng thực hiện interaction xóa và extend ListView có chức năng Undo.

5. Các loại khác

  • Android Sliding Up Panel: Giống với Google Play Music, Library hiển thị panel xuất hiện từ dưới lên phía trước.
  • CardsLib: Library set giúp cấu trúc card UI.
  • ProgressWheel: Library giúp customize progress bar xoay vòng tròn.
  • Android Bootstrap: Cùng với FontAwesome, Library này giúp sử dụng được các loại nút style Bootstrap.
  • Android Satellite Menu: Library cấu trúc menu giống như Path.
  • NineOldAndroids: Library Backport animation framework được đưa vào từ API 11.
  • Holo Everywhere: Library Backport Holo theme.
  • Holo ColorPicker: Library View giúp chọn màu.
  • Android Validator: Library giúp validate input.
  • android-gifview: Library View có khả năng chạy Gif animation.

6. Serialize

Json

  • Google Gson: Library mapping dựa vào reflection.
  • Jackson: Library có khả năng serialize/deserialize siêu tốc.

7. Database

ORM

  • GreenDAO: Sử dụng class định nghĩa riêng biệt schema, entity rồi mapping.
  • Active Android: Tại khai báo entity class, thêm annotation rồi mapping.

Eventbus

Cách sử dụng ở đây.

  • otto: Eventbus nhẹ cho Android dựa trên Guava.
  • EventBus: Có extension về chức năng hơn otto.

8. Giúp debug

View

  • scalpel: Tool nhằm hiển thị 3d cấu trúc tầng của View.

9. Resource

  • Madge: Giúp nhìn qua có thể nhận biết Bitmap đang hiển thị kích cỡ gốc không.

Crash log

  • Native Crash Handler: Hoạt động như error handling của Native code, tìm ra SIGSEGV.. và tạo Java exception. Từ đó sẽ thu thập được đủ crash log không lấy được hết từ Google Play..

output log

  • hugo: Library logging method call theo annotation.
  • deploygate: Không chỉ thu thập log, service này giúp cung cấp cả apk. Có thể làm được nhiều điều trên web console nếu ghép sdk vào.

10. Ảnh

Load và cache ảnh

  • Android Universal Image Loader: Dựa theo các loại setting để hiển thị, cache và load ảnh.
  • picasso: Library nhằm hiển thị, cache và load ảnh theo method chain.

Chỉnh sửa

  • CropImage: Library hỗ trở cắt ảnh.

11. Phát triển app hybrid

Framework dựa theo implement native, liên kết với JavaScriptInterface và phát triển hybrid app.

  • Hybridge
  • triaina

12. Test

Test Utility

  • fest-android: Đưa FEST vào Android test.
  • robolectric: Giúp tăng tốc Android test.
  • Robotium: Cài UI test như Selenium, ngoài ra extend UI test framework có Android framework.

Mock

  • Mockito: Library giúp mock được nhiều thứ.
  • RobotGirl: Fixture Library dành cho ActiveAndroid.

13. Truyền tin

REST

  • Retrofit: Tạo dễ dàng REST client.
  • RoboZombie: Tạo dễ dàng REST client.

Truyền tin Http・SPDY

  • okhttp: Client support truyền tin http(s) và SPDY.
  • volley: Utility giúp thuận tiện hóa nhiều xử lý truyền tin.

14. Build Script

Gradle

  • Gradle Android Utils: Tập hợp utility của build script.
  • Gradle MVN Push: Helper push kết quả dạng aar tới Maven Repository.
  • Gradle Android Test Plugin: Helper plugin giúp thực hiện test Android ở Gradle.

15. Các tiện ích khác

Update Checker

  • UpdateChecker: Hiện dialog khi có update.

Review

  • RateThisApp: Hiện dialog khuyến khích review.

Job Queue

  • Priority JobQueue: Job Quêu có kèm độ ưu tiên.
  • nirai: Cơ chế Job Quêu theo IntentService. Chi tiết tại đây

SharedPreferences

  • esperandro Wrapper của SharedPreferences.

Rất mong nó sẽ giúp ích cho các Android developer.

0