I was confused related ICU4J
, if i want to upgrade my application version to Support Android N
. How can i migrate from previous Android SDK to Android ICU API . For Example if i have used Calendar in my Application Using java.util.Calendar
, will i implement that again with Android ICU API ? or there is shortest way ?

- 2,759
- 2
- 28
- 42
3 Answers
you don't have to implement that again for android N. but just change way of use.
explained in documentation
Migrating to android.icu APIs from other Android SDK APIs
use android.icu.util.Calendar
instead of java.util.Calendar
for support older version then Android N you have to add ICU4J libraries

- 18,812
- 8
- 82
- 177
-
Where can I find this "ICU4J libraries" is there any support library to include ? – Oleksandr Albul Nov 15 '17 at 06:16
While migrating from icu4j to android N. You don't have to implement it again in android N. But you need to change only the imports & remove the ICU4J from your external library as per the document.
If you are already using the ICU4J APIs in your app, and the android.icu
APIs meet your requirements, then migrating to the framework APIs requires you to change your Java imports from com.ibm.icu
to android.icu
.
- You may then remove your own copy of ICU4J files from the APK.
When you migrating from ICU4J to android N please note below point.
Note:
- The ICU4J framework APIs use the
android.icu
namespace instead ofcom.ibm.icu
. - This is to avoid namespace conflicts in APKs that contain their own com.ibm.icu libraries.

- 6,709
- 4
- 42
- 59
Like all new APIs, if you want you app to work on earlier versions of Android you should not use them (unless you protect the calls behind version checks).
If you only intend to target the N release, then you can use the android.icu ICU4J APIs.

- 1
-
What the reason to develop app only for android N and higher ? If my min sdk=14 how can I use icu classes ? Maybe there is some support library with icu package? – Oleksandr Albul Nov 15 '17 at 06:18