+ All Categories
Home > Technology > Android developer's toolbox

Android developer's toolbox

Date post: 10-May-2015
Category:
Upload: alex-verdyan
View: 2,007 times
Download: 1 times
Share this document with a friend
Popular Tags:
39
Android developer toolbox Alex Verdyan @aexxx
Transcript
Page 1: Android developer's toolbox

Android developer toolbox

Alex Verdyan@aexxx

Page 2: Android developer's toolbox

Agenda

Build tools ant, maven

Libraries Roboguice, retrofit, ormlite,

androidannotatations, Testing

Fonemonkey, robolectric, robotium solo Stuff

acra, bugsense,

Page 3: Android developer's toolbox

Build outside IDE (for CI)

Page 4: Android developer's toolbox

Ant

Pros developed by Google (Android tools

team) Gets all the latest SDK improvements Generated from Eclipse (ADT)Cons No dependency management ( needs

Ivy) Not trivial to contribute (or debug) Ant…

Page 5: Android developer's toolbox

Maven (android-maven-plugin)

founded by JAYWAY developed by the community Hosted on github – easy to contribute/debug

Easy to setup Dependency management

Jars depend on other jars with versions Supports

package (apk/apklib), jar sign, zipalign, proguark, native, scala and more

Runs tests start emulator prior to running test

Page 6: Android developer's toolbox

Maven (android-maven-plugin) Use Maven profiles to distinguish dev from

release build

Page 7: Android developer's toolbox

Libraries

Page 8: Android developer's toolbox

roboguice

Based on Google Guice Simplify your code make it more

readable Remove boilerplate

PLUS: You get the power of dependency injection (Guice) Automatic Injection Loose coupling Testing with Mocks

Page 9: Android developer's toolbox

roboguice

Page 10: Android developer's toolbox

roboguice

Page 11: Android developer's toolbox

Retrofit

Re-usabale library by Square Inc. Interesting stuff

RestAdapter – abstraction over HTTP for Android▪ Create a Java interface for your services

ShakeDetector QueueFile (for storing a Q on Android

filesystem)

Page 12: Android developer's toolbox

Retrofit - RestAdapter

Does all the dirty HTTP work for you All calls are Async

can be used from UI thread w/ callback Built-in JSON support

Uses JdkProxy, Guice and Gson

Page 13: Android developer's toolbox

Retrofit – RestAdapte (cont.)

Page 14: Android developer's toolbox

ORM Lite

Lightweight ORM Makes DB interaction more pleasant Code more readable Mature project Good documentation + large

community Excellent support from the project

owner Grey Watson http://256.com/gray/

Page 15: Android developer's toolbox

ORM Lite - Entities

Page 16: Android developer's toolbox

DatabaseHelper

Page 17: Android developer's toolbox

DatabaseHelper (cont)

Page 18: Android developer's toolbox

DatabaseHelper (cont)

Page 19: Android developer's toolbox

Android annotations

Provides Android specific annotations to make the code even more readable

Can be integrated with roboguice Works by generating code during

build process

Page 20: Android developer's toolbox

Android annotations

Page 21: Android developer's toolbox

Android annotations

Page 22: Android developer's toolbox

Testing

Page 23: Android developer's toolbox

FoneMonkey

Relatively new (4-6 month) Backed up by commercial firm (Gorilla

Logic) Record your tests Adjust playback speed Add conditions Generate JUnit from the recording Tests can run as plain JUnit (it

communicates with the app inside emulator)

* very elegant solution for test recording

Page 24: Android developer's toolbox

FoneMonkey

Page 25: Android developer's toolbox

FoneMonkey

Page 26: Android developer's toolbox

Robotium Solo

Selenium like UI + Functional testing framework

Runs on Emulator/Device

Page 27: Android developer's toolbox

Robotium Solo - Example

Page 28: Android developer's toolbox

Robolectric

You can run tests from IDE No emulator Fast Enables TDD No mocking framework needed

http://github.com/pivotal/robolectric

Page 29: Android developer's toolbox

Robolectric

Run tests from IDE Very fast No emulator Intercepts loading of Android classes

– rewriting their bodies to return null/0/false

Or forward calls to shadow classes

Page 30: Android developer's toolbox

Shadow class

Page 31: Android developer's toolbox

Example

Page 32: Android developer's toolbox

Stuff

Page 33: Android developer's toolbox

Project Template

Starting new Android project? Here’s Intellij project template with

configured: roboguice robolectric C2DM Android source jars Jackson (json parser) ….

https://github.com/pivotal/AndroidIntelliJStarter

Page 34: Android developer's toolbox

Error reporting - ACRA

Library that submits crash reports (or exceptions) to your server / Google spreadsheet / email

Add logcat and memory usage to your report

Mature project Used by lots of apps (incl. Facebook

app) OSS

Page 35: Android developer's toolbox

Error reporting - BugSense

Bug tracking for mobile Realtime crash / bugs analytics Search Notify users when bug is fixed Supports Proguard Integrates with ACRA and JIRA

Page 36: Android developer's toolbox

Error reporting - BugSense

Page 37: Android developer's toolbox

Error reporting – Jira Mobile Connect

Post crashes/bugs as tickets in JIRA Still in development Open source Cool features

Get user feedback Reply to user via comment on JIRA issue Notify user the crash/bug he reported is

fixed and more…

Page 38: Android developer's toolbox

We’re looking for talented developers

Any.DO

Page 39: Android developer's toolbox

Thank you


Recommended