30

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?

BamsBamx
  • 4,139
  • 4
  • 38
  • 63
  • [International Components for Unicode](https://developer.android.com/preview/features/icu4j-framework.html) – Mike M. Aug 06 '16 at 00:18
  • This library can be [quite large](http://stackoverflow.com/q/28241755/3681880) to include in your project pre-API 24. – Suragch Feb 14 '17 at 01:54

2 Answers2

21

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.

px06
  • 2,256
  • 1
  • 27
  • 47
  • I have found that the java.text.SimpleDateFormat in my current builds is behaving like the ICU implementation, despite documentation to the contrary, Confusing. Android Studio 3.5.3 target SDK 28. – Dave Hubbard Dec 30 '19 at 16:48
15

ICU stands for International Components for Unicode

http://site.icu-project.org/

bTheHelper
  • 159
  • 1
  • 3