Can I use Java SE class libraries on mobile devices?

I am relatively new to Java and developing a Java implementation from the class library that I already wrote in .NET and Objective-C. A Java library primarily targets Android devices (or any device that supports Java) - is the standard Java SE library compatible with Java ME? The only data types used are standard base types, including String and possibly StringBuffer from the java.text package.

+4
source share
3 answers

Library compatibility will depend on what it actually uses from the Java API. Keep in mind that some classes that exist in SE and ME do not have the same set of methods (i.e. ME is smaller).

In the general case, I would say that there is no answer, but the best way to find out is to try.

In addition, as a support:

If you need a library for some heavy-duty operations, it might not be wise to do this on a mobile device. If your application should interact with the server, you probably want to host more resources there. Another advantage of this project is that the server application uses Java SE and can use any Java library.

0
source

Android is basically Java SE with several Android extensions. But it looks like your use case will work fine.

+1
source

You will need to look exactly at the class library present on each specific target device. There are different Java ME profiles , and Android is something completely different (it has nothing to do with Java ME). But the java.lang classes (and that where the StringBuffer lives, and not java.text ), of course, are present on all of them.

+1
source

Source: https://habr.com/ru/post/1334576/


All Articles