Android Frameworks: Highlighting the Need for a Solid Development Framework 

19

Click here to load reader

description

 

Transcript of Android Frameworks: Highlighting the Need for a Solid Development Framework 

Page 1: Android Frameworks: Highlighting the Need for a Solid Development Framework 

Android FrameworksHighlighting the need for a solid

development framework

Page 2: Android Frameworks: Highlighting the Need for a Solid Development Framework 

A little about me...

● In the industry since 2002.● Started at Mutual Mobile in 2011. ● Last hair cut 2011. ● During which I’ve released 7 apps.

Page 3: Android Frameworks: Highlighting the Need for a Solid Development Framework 

● Starting from scratch is unsustainable.● A framework is a common code base that is

reusable in multiple contexts● Basically its just an Android project ready to

be copied ● This is possible because most app share

common basic tasks

What is a framework

Page 4: Android Frameworks: Highlighting the Need for a Solid Development Framework 

Technical benefits

● All libraries are bootstrapped and ready to play

● Prevents reinventing the wheel● Common build system interface

Page 5: Android Frameworks: Highlighting the Need for a Solid Development Framework 

● Allows all team members a common ground for communication

● Allows for cross team problem solving ● Allows for easy onboarding● Unifies non collocated teams● Measure team member success

Organizational benefits

Page 6: Android Frameworks: Highlighting the Need for a Solid Development Framework 

Components of a Framework

Page 7: Android Frameworks: Highlighting the Need for a Solid Development Framework 

Component: REST Consumption

Most app currently leverage REST. As such this is one of your most important decisions.

● Existing Libraries○ HttpUrlConnection○ ApacheHTTPClient○ Volley○ Retrofit○ okhttp

Page 8: Android Frameworks: Highlighting the Need for a Solid Development Framework 

Component: Object Serialization

While ReST services are great at returning strings, POJO’s are better.

● Existing Libraries○ Gson○ Jackson○ Simple○ Protobuf

Page 9: Android Frameworks: Highlighting the Need for a Solid Development Framework 

Component: Caching

As mobile matures so do the users. Redundant REST requests won’t cut it any more.

● Existing Libraries○ Volley○ okhttp○ DiskLruCache

Page 10: Android Frameworks: Highlighting the Need for a Solid Development Framework 

Component: Local Database

Invariably the app will need to keep state. Your devs will need a place to keep it.

● Existing Libraries○ Shared Preferences○ Sqlite○ Ormlite○ GreenDAO○ DB4O

Page 11: Android Frameworks: Highlighting the Need for a Solid Development Framework 

Component: In App Communication

Communicating is hard, even more so if you have Asynctasks, Services and, Fragments in the mix.

● Existing Libraries○ Android intent system○ Otto○ Eventbus

Page 12: Android Frameworks: Highlighting the Need for a Solid Development Framework 

Component: Automated Testing

Well done. Here are the test results: You are a horrible person. I'm serious, that's what it says: "A horrible person." We weren't even testing for that.

-- GLaDOS / Portal 2

● Testing Options and Support Libraries○ Android Test Projects○ JUnit○ Robolectric○ Mockito○ Robotium○ uiautomator

Page 13: Android Frameworks: Highlighting the Need for a Solid Development Framework 

Component: Build system & CI

Autonomous build creation is a wonderful thing and gives you moment to moment status of your projects.

● Existing Options○ ANT build process○ Maven (kinda...)○ Gradle build process

Page 14: Android Frameworks: Highlighting the Need for a Solid Development Framework 

Additional Considerations

This is not an exhaustive list keep your eyes open for other things as well.

● Logging● Crash reporting● Code Metrics● Image loading

Page 15: Android Frameworks: Highlighting the Need for a Solid Development Framework 

Component: Glue

Even with the best libraries selected a successful framework needs to be pulled together.

Page 16: Android Frameworks: Highlighting the Need for a Solid Development Framework 

Mutual Mobile’s Framework

Praxis: the process by which a theory, lesson, or skill is realized.

● Libraries Used○ ApacheHTTPClient○ Gson / Simple○ DB4O○ Otto○ JUnit / Robotium○ ANT○ Dagger

Page 17: Android Frameworks: Highlighting the Need for a Solid Development Framework 

Care and feeding of your framework

● Frameworks only last so long.● Some of the libraries listed haven’t had their

first birthday yet.● Keep looking for new ways to improve and

adapt.

Page 18: Android Frameworks: Highlighting the Need for a Solid Development Framework 

Keeping up with the times

● Some examples from Mutual Mobile’s framework○ On 2.2 we used a segmented controller but, after

ICS we changed to Android’s Actionbar.○ We used singletons and static members to keep

system state, now we use our DI framework to moderate standard POJOs, holding state

○ We used Handlers to communicate AsyncTask results, now we ride the bus.

Page 19: Android Frameworks: Highlighting the Need for a Solid Development Framework 

Questions?