The Yin and Yang of NDK Development – AnDevCon Boston 2015

by: Konstantin Mandrika (@kmandrika) and Matt Willis (@mattwillis) from Twitter

IMG_20150730_112432

Make sure you are using the NDK when you actually need it.  If you are making a Pong app or a Chess app, you probably don’t need the NDK.

By default, you will build for 7 types of processor architectures.

armeabi and x86 are generally good bases and will cover the majority of all processor types for android devices.

AAR libraries typically are compiled for all processor types, this can cause unsatisfied link errors when you pull in an AAR file from gradle and it won’t make much sense.  It can do this if you are compiling for the base types (armeabi and x86) because it will try to use a 64 bit version, or an armeabi-v7 version which will cause a processor type mismatch.

Tip for AAR files: You can split AARs into different runtime builds in order to fix this.

Developer Experience: They traced down a bug that only happened on one device and one version of Android. It was due to an error in Libc.  Yuck.  This is something you can’t control, so this illustrates one of the issues with Android fragmentation.

C++ STL (Standard Template Library)

  • Small and very useful.  Less complete than java.util.*
  • Most implementations are incomplete
  • Tip: Take a copy of the STL, put it in your app, that will avoid issues for different implementations on different devices.

NDK Crash handling is EXTREMELY CHALLENGING
* Try out crashlytics: https://dev.twitter.com/crashlytics/android/ndk

DroidCon Montreal 2015

DroidCon Montreal

DroidCon Montreal was AWESOME.  Hands down the best Android conference I’ve ever attended.  There were so many great speakers and sessions that shared tips on Android from the community level instead of straight from Google (like Google I/O).  I felt like I was at a hollywood party with all of these amazing developers that I look up to and use their code in my own projects.

I am going to be doing a series which will touch on the cool things I learned from the conference and go into detail on each.  Here are the topics I hope to cover and as I write posts, I will link them here.

  • Debug Modes for Android Apps
  • Leveraging RxJava
  • Writing Gradle Plugins
  • Monitoring App Crashing with Crashlytics
  • GRPC grpc.io
  • Charles Proxy charlesproxy.com
  • Images on Android w/Picasso, Thumbor & More
  • Testing on Android
  • Material Design & Transitions
  • SDK & Android Library Design
  • Supporting Offline Apps
  • Recycler View

In the meantime, checkout the keynote from Jesse Wilson and Jake Wharton about Open Source.

About Me

I have been creating web pages since 1997 and writing software professionally since 2004.  I started a company called Handstand Technologies in 2010 so I could build awesome mobile and web applications for clients.  I now also work at Capital One and specialize in Android development on their Mobile Payments team.  You can find me at meetups, conferences and hackathons as an attendee or as a presenter.

When I’m not working, I enjoy traveling and doing Handstands in new places.

Connect with me on Twitter, LinkedIn.

Cheers,
-Sam Edwards