r/androiddev • • Nov 26 '16

Effective Java for Android (cheatsheet)

https://medium.com/rocknnull/effective-java-for-android-cheatsheet-bf4e3433889a
223 Upvotes

49 comments sorted by

View all comments

9

u/McDaddyWithFries Nov 26 '16

"because not all Java features are ported and used in Android (e.g. enums, serialization, etc) or due to the limitations that a mobile device has (e.g. Dalvik/ART behaves differently than a desktop JVM"

Dear writer, do you mind sharing what those are? Specifically about enums and serialization?

You can use serialization and enums, so what is not ported exactly?

7

u/netcyrax Nov 26 '16

Good catch, thanks for pointing out. What i meant is that neither of the two features are widely used in Android. Enums (@IntDef are preferred) and serialization (parcelables are preferred) have Android-specific alternatives.

13

u/Saketme Nov 27 '16

Enums are pretty widely used in android apps. Unless you're referring to AOSP by "Android", I'd disagree with you.

0

u/[deleted] Nov 27 '16

[deleted]

7

u/Saketme Nov 27 '16

That's a different discussion :)

2

u/eMperror_ Nov 28 '16

Meh, they take more space but it's not really that much of an issue with modern devices.