Upload
infinum-ltd
View
199
Download
0
Tags:
Embed Size (px)
Citation preview
We design and develop great software for mobile and web.
Android libraries which we use on daily basis
Ivan Kocijan
ViewsDiscreet app rateButterKnifePicasso Universal Image LoaderGlideViewPager IndicatorCircleImageViewAndroid crop
APIRetrofitGSON
DatabaseDbFlowAndroid dbInspector
TestingMockitoRoboelectricOkHttp
OtherCrashlyticsEventbusDaggerJoda Time
Discreet app rate
ButterKnife
• View "injection" library
• It finds and automatically cast the corresponding view in your layout
• Helps you write less code
ButterKnife usage
ViewPagerIndicator
• Paging indicator widgets compatible with the ViewPager
• Helps you provide a clear indicator that additional content exist
ViewPagerIndicator usage
CircleImageView
CircleImageView usage
Android crop
• Provides a simple image cropping
• Simple configuration
• Backwards compatible to Gingerbread
• Nice and clean UI
Android crop usage• Declare CropImageActivity in your manifest file
Android crop usage - part2
UniversalImageLoader
• Library for loading, caching and displaying images
• Highly customizable
• You can cache images on disk or memory or both
UIL usage - part 1
UIL usage - part 2
Glide
• Glide supports fetching, decoding and displaying video stills, images, and animated GIFs.
• Uses a custom HttpUrlConnection but it can use Volley or OkHttp library instead
Glide usage
Picasso
• Image downloading and caching library
• Easy to use
• Automatic memory and disk caching.
Picasso usage
UIL vs Picasso vs Glide
Objective:
• Load 8268x14173px (11MB) image into ImageView
• Do not use custom configuration
Results
Glide UIL Picasso
Memory allocated (MB) 13 MB 20 MB ∞Time (s) 28 sec 46 sec ∞
GSON
• Convert Java Objects into their JSON representation
• Convert a JSON string to an equivalent Java object
GSON usage - part 1
GSON usage - part 2
Retrofit
• Use annotations to describe the HTTP request
• URL parameter replacement and query parameter support
• Multipart request body and file upload
Retrofit usage - part 1
Retrofit usage - part 2
DbFlow
• ORM android database library with annotation processing
• Very fast
• Triggers, Views, Indexes, and many more SQLite features
• Approved by Željko Plesac
DbFlow usage - part 1
DbFlow usage - part 2
DbFlow usage - part 3
DbInspector• Created by Dino Kovač
• View the contents of the in-app database for debugging purposes
• No need to pull the database from a rooted phone
• Approved by Željko Plesac
• Android talks #5
Mockito
• “Mockito is a mocking framework that tastes really good”
• Create readable unit tests which produce clean verification errors
• Top 10 Java library across all libraries
Robolectric
• A unit test framework that helps you test-drive the development of your Android app
• Robolectric handles inflation of views, resource loading, and lots of other stuff.
• Run your tests on your workstation, or on your Continuous Integration environment
OkHttp• Create MockWebServer
Crashlytics
• Light weight crash reporting solution
• Easy to use
• Android studio plugin
• Very powerful
Eventbus
• Publish/subscribe event bus
• Simplifies the communication between components
• Has advanced features like delivery threads, subscriber priorities
Eventbus usage1. Define event
public class MessageEvent { /* Additional fields if needed */ }
2. Register subscriberEventBus.getDefault().register(this);
public void onEvent(MessageEvent event) {// Do something };
3. Register onEvent method
EventBus.getDefault().post(new MessageEvent());
4. Post event
Dagger
• Dependency injector for Android and Java
• Makes each class easy to test
• Create reusable modules
• Check out their official site
Joda Time• Replacement for the Java date and time classes
• Provides simple API
• Multiple calendar systems
• Under active development since 2002
• From Java SE 8 onwards, users are asked to migrate to java.time
Links• ButterKnife - http://jakewharton.github.io/butterknife/• ViewPagerIndicator - http://viewpagerindicator.com/• CircleImageView - https://github.com/hdodenhof/CircleImageView• Android Crop - https://github.com/jdamcd/android-crop• UniversalImageLoader - https://github.com/nostra13/Android-Universal-Image-Loader• Glide - https://github.com/bumptech/glide• Picasso - http://square.github.io/picasso/• Retrofit - http://square.github.io/retrofit/• GSON - https://code.google.com/p/google-gson/• DbFlow - https://github.com/Raizlabs/DBFlow• DbInspector - https://github.com/infinum/android_dbinspector• EventBus - https://github.com/greenrobot/EventBus• Dagger - http://square.github.io/dagger/• JodaTime - http://www.joda.org/joda-time/• Mockito - http://mockito.org/• Roboelectric - http://robolectric.org/• OKHttp - https://github.com/square/okhttp• Discreet app rate - https://github.com/PomepuyN/discreet-app-rate• Crashlytics - https://try.crashlytics.com/
email: [email protected]: @ikocijan Android talks: infinum.coAndroid talks video: Youtube channel
Thank you!