Tom Colvin
Oct 12, 2023

--

In practice it won't make a lot of difference in most cases.

@Singleton ensures there's exactly one in memory, no matter how many activities (e.g.) use it.

Binding to Activity, say, would create a maximum of however many Activities you have loaded. That could be more than one - but it also could be zero (if none of your loaded Activities use it).

You can choose to suit your app. But the memory usage of a use case should normally be so small as to be trivial, so it doesn't make much difference.

--

--

Tom Colvin
Tom Colvin

Written by Tom Colvin

Android developer / consultant; freelancer or through my agency Apptaura. Google Developer Expert in Android. tomcolvin.co.uk Articles 100% me, no AI.

No responses yet