Over a million developers have joined DZone.
{{announcement.body}}
{{announcement.title}}

This Week in Mobile: Better Dependency Injection

DZone's Guide to

This Week in Mobile: Better Dependency Injection

It's well known that dependency injection is a great approach for testable code, but how can you best deal with it in your project? The answers are here, and more.

· Mobile Zone ·
Free Resource

The common theme of the week is Dependency Injection; whether removing boilerplate by using factories in Swift, or transitioning from Dagger (the default choice for Android projects) to Koin.

iOS 

Dependency Injection Using Factories in Swift shows how to get the benefits of DI in your code without having to write huge initializers.

Data Detection in Swift gives you the chance to avoid regular expressions in your strings. The example in the article adds an extension to String to extract email addresses from the string. 

Codable was a lot of developers favorite addition to Swift 4. This article covers Everything about Codable in Swift 4.

Handling Cell Actions with Swift Generics gives you a neat way of dealing with actions on your tables. 

Some projects to check out: 

  • WhatsNew: Showcase new features after an app update similar to Pages, Numbers and Keynote.
  • Digger: Digger is a lightweight download framework that requires only one line of code to complete the file download task.
  • videoplayback-ios: Swift AVPlayer wrapper using the VIPER architecture.

Android 

Last week saw the first KotlinConf, and here’s a recap of the keynote where Kotlin 1.2 Release Candidate was announced, along with some support for iOS development with Kotlin/Native.

If Dagger isn’t your thing for dependency injection, maybe you should consider moving to Koin. This article has an example of how to do just that.

Controlling shadows on your Material Design components might not sound that impressive, but check out Playing With Elevation in Android and you’ll see how it can make a real difference.

We’ve all heard about how great Android Architecture Components are, but there are some pitfalls. Read about them here.

Joe Birch sets about Exploring Firebase Predictions, a new service allowing you to predict the behavior of users in your app, and as such provide personalized experiences. 

Finally, check out the stable release of the much loved Android Architecture Components 1.0.

Some projects to check out: 

  • RIBs: Ubers cross-platform mobile architecture 
  • rings: A simple chart for Android with 3 indicators and one more to indicate overall 
  • grox: Grox helps to maintain the state of Java/Android apps

General 

Diana Neculai explains How to Get Up To 3,500 GitHub Starts in One Week and why that is actually important. 

Some sound advice here about how to be a better leader by Killing the Elephants in the Room Before They Kill You

Here’s an interesting product design concept based around a Spotify Podcast App. Having seen it, I wish it really existed!

Topics:
swift ,kotlin ,android ,java ,ios ,mobile ,mobile app development

Opinions expressed by DZone contributors are their own.

{{ parent.title || parent.header.title}}

{{ parent.tldr }}

{{ parent.urlSource.name }}