Top Banner
Cool Open Source Libs Nabil HACHICHA GDG DevFest 2013 Algiers
24

GDG Algiers DevFest 2013 Cool AndroidLibs

May 10, 2015

Download

Technology

nhachicha

Presenting some cool libs from http://square.github.io/ to help you with developing and testing your Android.

The source code is here:

Android App
https://github.com/nhachicha/GDGDevFestAlgiers2013Android

Backend
https://github.com/nhachicha/GoogleDevFest2013Algiers
Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Page 1: GDG Algiers DevFest 2013 Cool AndroidLibs

Cool Open Source LibsNabil HACHICHA

GDG DevFest 2013 Algiers

Page 2: GDG Algiers DevFest 2013 Cool AndroidLibs

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

Page 3: GDG Algiers DevFest 2013 Cool AndroidLibs

Use case

● Develop & test a small app (Employees list)

Page 4: GDG Algiers DevFest 2013 Cool AndroidLibs

Use case

Architecture

Request content from network

Page 5: GDG Algiers DevFest 2013 Cool AndroidLibs

Use case

Architecture

ListView Adapter, based on a simple POJO

Page 6: GDG Algiers DevFest 2013 Cool AndroidLibs

Use case

Architecture

Fragment holding our ListView

Page 7: GDG Algiers DevFest 2013 Cool AndroidLibs

Use case

Architecture

Parse HTML using Xpath

Page 8: GDG Algiers DevFest 2013 Cool AndroidLibs

OkHttp

● Efficient Http client, based on java.net.HttpURLConnection or Apache HttpClient

● Can also be used as as the transport layer for Volley

Page 9: GDG Algiers DevFest 2013 Cool AndroidLibs

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)

Page 10: GDG Algiers DevFest 2013 Cool AndroidLibs

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)

Page 11: GDG Algiers DevFest 2013 Cool AndroidLibs

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)

Page 12: GDG Algiers DevFest 2013 Cool AndroidLibs

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)

Page 13: GDG Algiers DevFest 2013 Cool AndroidLibs

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)

Page 14: GDG Algiers DevFest 2013 Cool AndroidLibs

Picasso

● A powerful image downloading and caching library for Android

Page 15: GDG Algiers DevFest 2013 Cool AndroidLibs

Picasso

● Handling ImageView recycling and download cancelation in an adapter

● Complex image transformations with minimal memory use.

● Automatic memory and disk caching.

Page 16: GDG Algiers DevFest 2013 Cool AndroidLibs

Code

Page 17: GDG Algiers DevFest 2013 Cool AndroidLibs

Testsing

RobolectricMockitoFEST

Page 18: GDG Algiers DevFest 2013 Cool AndroidLibs

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)

Page 19: GDG Algiers DevFest 2013 Cool AndroidLibs

Mockito

● Mocking framework, with fluent API syntaxe

Page 20: GDG Algiers DevFest 2013 Cool AndroidLibs

FEST

● Fixtures for Easy Software Testing

● Simplify software testing by providing a fluent Assertions

● Just use assertThat

● FEST Android, extension of FEST

Page 21: GDG Algiers DevFest 2013 Cool AndroidLibs

FEST

Example:● Regular JUNITassertEquals(View.GONE,view.getVisibility())

● Regular FESTassertThat(view.getVisibility()).isEqualTo(View.GONE)

● FEST AndroidassertThat(view).isGone()

Page 22: GDG Algiers DevFest 2013 Cool AndroidLibs

Code

Page 23: GDG Algiers DevFest 2013 Cool AndroidLibs

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

Page 24: GDG Algiers DevFest 2013 Cool AndroidLibs

Thanks!

Q&A

Links http://square.github.io/