Have seen new packages in Android SDK docs. All of them are available in API level 24 which corresponds to Android Nougat and seem to replace the 'java.xxx' packages by 'android.icu.xxx'. For example:
The java.text.DateFormat package is duplicated in android.icu.text.DateFormat and so on
Also, in some icu classes appears the following annotation:
[icu enhancement] ICU's replacement for (class name). Methods, fields, and other functionality specific to ICU are labeled '[icu]'.
So, what does ICU stand for? And what are differences between java and android.icu packages? Will java packages be deprecated soon?
Android leverages the ICU library and CLDR project to provide Unicode and other internationalization support. This document's discussion of Unicode and internationalization support is divided into two sections: Android 6.0 (API level 23) and lower, and Android 7.0 (API level 24) and higher.
ICU4J is an add-on to the regular JRE that provides: Collation – rule-based, up-to-date Unicode Collation Algorithm (UCA) sorting order For fast multilingual string comparison; faster and more complete than the J2SE implementation.
This explains the notion of icu
pretty well. They've basically introduced this for the later API's to "reduce your APK footprint". I don't think that the ICU is a replacement for the java.*.*
libraries but is just an alternative to use. There is also one interesting thing on that page:
As the ICU team deprecates APIs in the future, Android will also mark them as deprecated but will continue to include them.
Here is also a little list of features about ICU4J which is quite helpful.
ICU stands for International Components for Unicode
http://site.icu-project.org/
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With