Slide 1

Slide 1 text

Overview of libraries and tools that make your Android development easier and faster

Slide 2

Slide 2 text

• Radek Piekarz • .NET Developer at Making Waves • Android fan and developer (Scrobble FM) • Contact: [email protected] 28.06.2013 © MAKING WAVES 2 Few words about me

Slide 3

Slide 3 text

• Kraków Business Run 28.06.2013 © MAKING WAVES 3 Case study

Slide 4

Slide 4 text

28.06.2013 © MAKING WAVES 4 Tools

Slide 5

Slide 5 text

28.06.2013 © MAKING WAVES 5 IntelliJ IDEA / Android Studio

Slide 6

Slide 6 text

Maven • Useful for continuous integration • Easy access for thousands of Java and Android libraries • Can be used with Eclipse / IntelliJ Idea / Android Studio / Notepad++ etc. 28.06.2013 © MAKING WAVES 6

Slide 7

Slide 7 text

• Out-of-the-box Feature Set • IntelliJ IDEA includes comprehensive set of tools which work out-of-the-box and make your development more productive. • Support for Maven and Gradle • Built-in tools for unit testing and coverage • VCS tools with Git, GitHub, SVN and others • Tasks and context management 28.06.2013 © MAKING WAVES 7

Slide 8

Slide 8 text

ADB Wireless • https://play.google.com/store/a pps/details?id=com.ttxapps.wifi adb 28.06.2013 © MAKING WAVES 8

Slide 9

Slide 9 text

28.06.2013 © MAKING WAVES 9

Slide 10

Slide 10 text

• dex2jar • apktool • jd-gui 28.06.2013 © MAKING WAVES 10 (Anty)cracker

Slide 11

Slide 11 text

Useful libraries 28.06.2013 © MAKING WAVES 11

Slide 12

Slide 12 text

28.06.2013 © MAKING WAVES 12

Slide 13

Slide 13 text

ABS + VPI • Action Bar Sherlock • ViewPagerIndicator 28.06.2013 © MAKING WAVES 13

Slide 14

Slide 14 text

• https://github.com/chrisbanes/ActionBar-PullToRefresh 28.06.2013 © MAKING WAVES 14 ActionBar-PullToRefresh

Slide 15

Slide 15 text

• SDK, Resources, & Native Method Emulation • Run Tests Outside of the Emulator • No Mocking Frameworks Required 28.06.2013 © MAKING WAVES 15 Robolectric

Slide 16

Slide 16 text

28.06.2013 © MAKING WAVES 16

Slide 17

Slide 17 text

• https://github.com/square/retrofit public interface GitHubService { @GET("/users/{user}/repos") List listRepos(@Path("user") String user); } GitHubService service = restAdapter.create(GitHubService.class); List repos = service.listRepos("octocat"); 28.06.2013 © MAKING WAVES 17 retrofit

Slide 18

Slide 18 text

• https://github.com/square/picasso • Picasso.with(context).load("http://i.imgur.com/DvpvklR.png").into(i mageView); • Many common pitfalls of image loading on Android are handled automatically by Picasso: – Handling ImageView recycling and download cancelation in an adapter. – Complex image transformations with minimal memory use. – Automatic memory and disk caching. 28.06.2013 © MAKING WAVES 18 Picasso

Slide 19

Slide 19 text

• Android Universal Image Loader by nostra13 – Multithread image loading – Possibility of wide tuning ImageLoader's configuration (thread executors, downlaoder, decoder, memory and disc cache, display image options, and others) – Possibility of image caching in memory and/or on device's file sysytem (or SD card) – Possibility to "listen" loading process – Possibility to customize every display image call with separated options – Widget support – Android 2.0+ support 28.06.2013 © MAKING WAVES 19 Other similar libs

Slide 20

Slide 20 text

• Volley (https://developers.google.com/events/io/sessions/325304728) – Nice and easy API for executing REST requests; – unifies the mechanism for REST requests by abstracting the "bottom" layer, i.e. you don't care any more about HttpClient or HttpUrlConnection. On lower versions (<= GINGERBREAD) Volley uses AndroidHttpClient and no higher it uses HttpUrlConnection; – it is very fast. In the I/O presentation the guy states that they tested it at Google with several different apps and Volley was clear winner in all categories; – it is extensible -- you can use it as a basis to create your own custom type of requests (and response handling/parsing) 28.06.2013 © MAKING WAVES 20

Slide 21

Slide 21 text

//create a stack CardStack stack = new CardStack(); stack.setTitle("title test"); // add 3 cards to stack stack.add(new MyCard("3 cards")); stack.add(new MyCard("3 cards")); stack.add(new MyCard("3 cards")); // add stack to cardView mCardView.addStack(stack); // draw cards mCardView.refresh(); 28.06.2013 © MAKING WAVES 21 Cards UI https://github.com/nadavfima/cardsui-for-android

Slide 22

Slide 22 text

UnifiedPreference 28.06.2013 © MAKING WAVES 22 • Easy to use • Takes care of most of the boilerplate code • Use a single pane for phones, or headers and fragments for tablets • Binds preference values to summaries according to Android Design Guidelines • Translated to 50 locales (imported from AOSP internal strings) • Uses ActionBarSherlock (optional) https://github.com/saik0/UnifiedPreference

Slide 23

Slide 23 text

EventBus EventBus Otto Declare event handling methods Name conventions Annotations Event inheritance Yes Yes Subscriber inheritance Yes No Cache most recent events Yes, sticky events No Event producers (e.g. for coding cached events) No Yes Event delivery in posting thread Yes (Default) Yes Event delivery in main thread Yes No Event delivery in background thread Yes No Aynchronous event delivery Yes No EventBus Otto Posting 1000 events, Android 2.3 emulator ~70% faster Posting 1000 events, S3 Android 4.0 ~110% faster Register 1000 subscribers, Android 2.3 emulator ~10% faster Register 1000 subscribers, S3 Android 4.0 ~70% faster Register subscribers cold start, Android 2.3 emulator ~350% faster Register subscribers cold start, S3 Android 4.0 About the same 28.06.2013 © MAKING WAVES 23 https://github.com/greenrobot/EventBus

Slide 24

Slide 24 text

• https://github.com/jfeinstein10/SlidingMenu • SlidingMenu is an Open Source Android library that allows developers to easily create applications with sliding menus like those made popular in the Google+, YouTube, and Facebook apps. public class SlidingExample extends Activity { @Override public void onCreate(Bundle savedInstanceState) { SlidingMenu SlidingMenu menu = new SlidingMenu(this); menu.setMode(SlidingMenu.LEFT); menu.setTouchModeAbove(SlidingMenu.TOUCHMODE_FULLSCREEN); menu.setShadowWidthRes(R.dimen.shadow_width); menu.setShadowDrawable(R.drawable.shadow); menu.setBehindOffsetRes(R.dimen.slidingmenu_offset); menu.setFadeDegree(0.35f); menu.attachToActivity(this, SlidingMenu.SLIDING_CONTENT); menu.setMenu(R.layout.menu); } } 28.06.2013 © MAKING WAVES 24 SlidingMenu

Slide 25

Slide 25 text

ListViewAnimations • https://github.com/nhaarman/ ListViewAnimations ListViewAnimations is an Open Source Android library that allows developers to easily create ListViews with animations. 28.06.2013 © MAKING WAVES 25

Slide 26

Slide 26 text

android-maps-utils BubbleIconFactory bubbleFactory = new BubbleIconFactory(MapFragment.this.ge tActivity()); bubbleFactory.setStyle(Style.BLUE); Bitmap icon = bubbleFactory.makeIcon(name); marker = getMap() .addMarker(new MarkerOptions() .position(latLgnDistances.get(0.0)) .title(name) .icon(BitmapDescriptorFactory.fromB itmap(icon))); 28.06.2013 © MAKING WAVES 26