Heads up: Android classes will be moved out of j2objc's JRE libraries

47 views
Skip to first unread message

Tom Ball

unread,
Nov 19, 2021, 11:26:02 AM11/19/21
to j2objc-discuss
Back in j2objc's early days, several Android developers asked that a few android.text and android.util classes be added to the jre_emul sub-project, as they were often used and had no dependencies on Android UI. They've quietly lived there without issue until we've started moving to Java 11, where most of jre_emul's classes are defined in the java.base module, except for the android classes. This is causing headaches trying to correctly define a java.base module for jre_emul.

The solution is to move the Android classes from jre_emul's JRE libraries into an independent jar file. Since these classes are fully platform-independent without native code, this jar would be trivial to translate with j2objc, for any apps that use these classes. Here's our current plan:
  • Move android.text, android.text.util, and android.util to a new android_util.jar file.
  • Move android.test.suitebuilder to a new android_test.jar file.
  • Remove android.os.SystemClock and android.os.AsyncTask. AsyncTask was officially deprecated in API 30 (last year) in favor of java.util.concurrent. As far as we know, SystemClock was only used by internal jre_emul classes in previous versions.
Hopefully no one will find this change too disruptive, and we'll all be able to move to Java 11 (and beyond). Please let us know if any issues arise from these changes.
Reply all
Reply to author
Forward
0 new messages