Upgrade to Pro — share decks privately, control downloads, hide ads and more …

AndroidLX: From an app to a library

AndroidLX: From an app to a library

Some insights and tips on the difference between Android application and library development, from someone who has been on both sides

Sérgio Marques Moura

July 14, 2017
Tweet

More Decks by Sérgio Marques Moura

Other Decks in Technology

Transcript

  1. Onfido is an identity verification solution, helping over 1,500 businesses

    work out who they can trust in a digital world. Hole19 offers accurate GPS distances for 40,000+ courses worldwide, along with digital scorecards and the possibility to connect with all your golf buddies.
  2. 1. Keep it dev-friendly ➔ Take care of your README...

    ◆ What does this do? ◆ Simple, well-documented API ◆ Add pictures/videos ➔ Maintain a sample app ➔ Deprecate-then-remove ➔ … and CHANGELOG ◆ Follow a versioning scheme ◆ Update it during the development
  3. 1. Keep it dev-friendly ➔ Easy to use ➔ Enforce

    validation ➔ Hard to misuse ➔ Use custom exceptions
  4. 2. Watch your dependencies ➔ “Can I do this myself?”

    ➔ Teach how to squeeze it ◆ ProGuard ◆ Multi-APK split
  5. 2. Watch your dependencies ➔ Constantly look at method count

    + APK size ◆ dexcount-gradle-plugin (gitub.com/KeepSafe) ◆ Sample app APK size
  6. 3. Some “edge cases” ➔ Host app can override XML

    resources by name ◆ strings.xml ◆ colors.xml ◆ dimens.xml
  7. 3. Some “edge cases” ➔ Use buildConfigField to fetch configuration

    info ◆ flavor ◆ build time ◆ versionName
  8. 5. Putting all together ➔ Library development is challenging ◆

    Dev-friendly ◆ Maintain library + sample app ◆ Some “edge cases” ➔ Efficient library development is even more ◆ Watch your dependencies ◆ Make them optional if possible