Over a million developers have joined DZone.

This Week in Mobile: Avoiding Memory Leaks

DZone's Guide to

This Week in Mobile: Avoiding Memory Leaks

There's one common theme between our iOS and Android coverage this week; avoiding memory leaks. Before you break up for the holidays, why not clean up your app!

· Mobile Zone ·
Free Resource

There's nothing more infuriating than hitting a memory leak near production time. This week we look at how to prevent leaks in Swift, and how WeakReference is not the only option for Android developers. We also look at security, widgets and much more.


We all know from experience that it's too easy for a little bit of carelessness to punish our app with a memory leak, so read How to Prevent Memory leaks in Swift Closures to make sure that you understand where leaks can arise. 

Bob Lee is producing some great articles around iOS development these days. Read Intro to Grand Central Dispatch in Swift 3 and you'll understand the basics in a few minutes. 

I'm all for straightforward articles this week. Swift optionals explained simply does exactly what it promises. If you're confused about optionals, press reset on what you've learned so far and take a look.

Is Protocol Oriented Swift Better than Object Oriented Swift? While the answer might not be clear cut, I think most people are happy to follow protocol oriented Swift.

I love the home screen on iOS10, being able to swipe to get a high-level overview from apps that provide a Today widget. Should you consider Taking Advantage of iOS 10’s Today Widget

Some projects worth looking at: 

  • SnowFlake: SVG in Swift
  • AppStoreStyleHorizontalScrollView: App store style horizontal scroll view 
  • GLNotificationBar: An iOS10 style notification bar, can be used to handle push notifications in active state 
  • R.swift: Get strong typed, autocompleted resources like images, font, and segues in Swift projects 
  • Me: A super slim solution to nested asynchronous computations 

And if that’s not enough, check out the COBE team’s Top 5 iOS Libraries for December.


SQLDelight looks interesting, where you can generate models from SQL queries. If this is something you need, check out this getting started guide for SQLDelight 

No one wants memory leaks, but did you know that You don’t have to use WeakReference to avoid memory leaks? Maybe it should be your last resort, rather than your default option. 

Flavors in gradle builds are fantastic, and here's an explanation on how to use Product Flavors for Android Libraries

With so many possible points of failure, this article on how to improve the security of your Android app provides an excellent checklist that all developers should consider.

An excellent example of how to take advantage of AnimatedVectorDrawable with this jump-through animation that gets displayed while an app is gathering location details. 

This week’s Android project highlights include: 


Not everyone wants to go native. After talking about Titanium myths last week, let's see Why is Xamarin a good choice for mobile app development?

With Snapchat as a prime example of the ultimate in shareability, Josh Elman looks at the differences between Intuitive Design vs Shareable Design.

ios ,swift ,android ,java ,mobile

Opinions expressed by DZone contributors are their own.

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

{{ parent.tldr }}

{{ parent.urlSource.name }}