Sitemap
Andy Triboletti

Andy Triboletti

Software Engineer at GreenRobot.com

Android Design Patterns

1 min readMay 27, 2016

--

These are some design patterns I use frequently while developing Android apps.

Command pattern:

  • Issue requests without knowing receiver
  • Example send request from services to ui
  • Example: Otto framework

Builder pattern:

  • Create instance of class only specifying parts that matter to you
  • Example: building dialogs (AlertDialog.Builder)

Get Andy Triboletti’s stories in your inbox

Join Medium for free to get updates from this writer.

Adapter pattern:

  • Converts interface of class into other interface
  • Example: RecylerView.Adapter
  • Example: ArrayAdapter

Singleton pattern:

  • Only 1 instance should exist, accessible globally
  • Static getInstance
  • I use on Util classes
  • If you override Application class that’s a Singleton.

Other design patterns:

https://www.raywenderlich.com/109843/common-design-patterns-for-android

--

--