Abdul Samad
11/20/2019, 11:55 AMovidiul
11/20/2019, 12:01 PMfatih
11/20/2019, 12:43 PMCody Engel
11/20/2019, 2:23 PMAdam Powell
11/20/2019, 3:12 PMvoben
11/20/2019, 3:23 PMCody Engel
11/21/2019, 1:02 AMAdam Powell
11/21/2019, 1:44 AMCody Engel
11/21/2019, 1:24 PMDavor
11/21/2019, 5:42 PMCody Engel
11/21/2019, 11:30 PMitnoles
11/21/2019, 11:42 PMlouiscad
11/23/2019, 2:10 PMSharedPreferences
doing an fsync
in onStop
and blocking the main thread?? And how come this is not documented?
And finally, why isn't there recommendation from the javadoc to use something else if it's broken by design (for error handling mainly)?Adam Powell
11/23/2019, 2:33 PMlouiscad
11/23/2019, 3:15 PMfsync
thing hasn't been removed in recent Android versions? A lot of Android apps are still using SharedPreferences
and this is not changing anytime soon given the friction plus the fact that the doc doesn't even mention it. End users would still benefit if a change is added into Android 11 to not do it on the main UI thread.Adam Powell
11/23/2019, 4:33 PMlouiscad
11/23/2019, 4:37 PMSharedPreferences
is an interface that can be implemented by anything that would not bring this performance issue to the users (let's be honest, the users pay the cost, the devs don't bother much…)NSUserDefaults
on macOS and iOS with Kotlin/Native, works great.Adam Powell
11/23/2019, 4:40 PMlouiscad
11/23/2019, 4:40 PMAdam Powell
11/23/2019, 4:41 PMlouiscad
11/23/2019, 4:42 PMfsync
happening at the wrong time.Migrating old code even to something significantly different isn't a large task.You have to take into account ensuring you didn't break anything, and other considerations that actually make people not migrate that quickly or at all from poor APIs. So it's all relative, and right now, no one but us is aware that it's not great to use it, and I won't migrate all that tomorrow in all my projects, even the one I work on the most
Adam Powell
11/23/2019, 4:47 PMlouiscad
11/23/2019, 4:50 PMSharedPreferences
, but what you would do exactly instead is not clear to me.Adam Powell
11/23/2019, 4:54 PMFlow<T>
to reflect changes to other interested parties only after they're written.louiscad
11/23/2019, 5:18 PMwriteText()
or writeBytes()
is not a good idea for this?Adam Powell
11/23/2019, 5:21 PMlouiscad
11/23/2019, 6:01 PMAdam Powell
11/23/2019, 7:49 PMlouiscad
11/24/2019, 10:56 AMAdam Powell
11/24/2019, 2:16 PMCody Engel
11/24/2019, 5:15 PM