tl;dr : This article I think starts to really dive into where traditional Java methodologies fails when running on Android, and you need to look at what is provided for you by the framework to achieve the same task while minimizing performance impacts.
- Use Android-Appropriate Data structures - for smaller collections, use android (ArrayMap/SparseArray) which avoids autoboxing
- Use Parcels not Java Serialization - Also talks about Persistable Bundles
- Use JSON/XML for web services, use SQLite or SharePreferences to store the data
- Avoid JNI - but if you don't here are some tips
- Favor Primative Types.
I really don't have much to add to what they go over in this article, but I think Engineers with a Java background could gain quite a bit of information just from this one post that will probably help them in the future. It discusses Bundles, SharedPreferences, SQLite, PersistableBundle, JNI, and several collection classes on Android which should be used if possible. ArrayMap, SimpleArrayMap, SparseArray, SparseBooleanArray, SparseIntArray, SparseLongArray, and LongSparseArray.
What did I learn from this post? Probably to spend a bit more time when using collections, and see if I can find an Android specific one that suites the use case better.
No comments:
Post a Comment