Slide 1

Slide 1 text

Cool Open Source Libs Nabil HACHICHA GDG DevFest 2013 Algiers

Slide 2

Slide 2 text

Why Open Source? ● Better quality ○ Developed by many passionate developers ○ Innovation and enhancements over time ● Open standards & interoperability ● It’s hard to develop without it

Slide 3

Slide 3 text

Use case ● Develop & test a small app (Employees list)

Slide 4

Slide 4 text

Use case Architecture Request content from network

Slide 5

Slide 5 text

Use case Architecture ListView Adapter, based on a simple POJO

Slide 6

Slide 6 text

Use case Architecture Fragment holding our ListView

Slide 7

Slide 7 text

Use case Architecture Parse HTML using Xpath

Slide 8

Slide 8 text

OkHttp ● Efficient Http client, based on java.net. HttpURLConnection or Apache HttpClient ● Can also be used as as the transport layer for Volley

Slide 9

Slide 9 text

OkHttp ● SPDY support, allows all requests to the same host to share a socket. ● Transparent GZIP ● Silently recover from common connection problems ● Recovers from problematic proxy servers and failed SSL handshakes ● Connection pooling reduces request latency (if SPDY isn’t available)

Slide 10

Slide 10 text

OkHttp ● SPDY support, allows all requests to the same host to share a socket. ● Transparent GZIP ● Silently recover from common connection problems ● Recovers from problematic proxy servers and failed SSL handshakes ● Connection pooling reduces request latency (if SPDY isn’t available)

Slide 11

Slide 11 text

OkHttp ● SPDY support, allows all requests to the same host to share a socket. ● Transparent GZIP ● Silently recover from common connection problems ● Recovers from problematic proxy servers and failed SSL handshakes ● Connection pooling reduces request latency (if SPDY isn’t available)

Slide 12

Slide 12 text

OkHttp ● SPDY support, allows all requests to the same host to share a socket. ● Transparent GZIP ● Silently recover from common connection problems ● Recovers from problematic proxy servers and failed SSL handshakes ● Connection pooling reduces request latency (if SPDY isn’t available)

Slide 13

Slide 13 text

OkHttp ● SPDY support, allows all requests to the same host to share a socket. ● Transparent GZIP ● Silently recover from common connection problems ● Recovers from problematic proxy servers and failed SSL handshakes ● Connection pooling reduces request latency (if SPDY isn’t available)

Slide 14

Slide 14 text

Picasso ● A powerful image downloading and caching library for Android

Slide 15

Slide 15 text

Picasso ● Handling ImageView recycling and download cancelation in an adapter ● Complex image transformations with minimal memory use. ● Automatic memory and disk caching.

Slide 16

Slide 16 text

Code

Slide 17

Slide 17 text

Testsing Robolectric Mockito FEST

Slide 18

Slide 18 text

Robolectric ● Run Android tests inside JVM ● Instruct Robolectric to configure Android differently ○ use a non-standard manifest file ○ use French resources on a sideways high-res display (qualifiers)

Slide 19

Slide 19 text

Mockito ● Mocking framework, with fluent API syntaxe

Slide 20

Slide 20 text

FEST ● Fixtures for Easy Software Testing ● Simplify software testing by providing a fluent Assertions ● Just use assertThat ● FEST Android, extension of FEST

Slide 21

Slide 21 text

FEST Example: ● Regular JUNIT assertEquals(View.GONE,view.getVisibility()) ● Regular FEST assertThat(view.getVisibility()).isEqualTo (View.GONE) ● FEST Android assertThat(view).isGone()

Slide 22

Slide 22 text

Code

Slide 23

Slide 23 text

TDD ● objc-TimesSquare ○ calendar view for your apps ● PonyDebugger ○ Remote network and data debugging for your native iOS app using Chrome Developer Tools ● SocketRocket ○ WebSocket client library ● objc-mocktail ○ stub out HTTP servers in your Objective-C app. ● KIF ○ Keep It Functional - An iOS Functional Testing Framework

Slide 24

Slide 24 text

Thanks! Q&A Links http://square.github.io/