We have a class library, written in Java (Standard Edition or MIDP 2.0, we have both variants), compiled to JAR file. There’s nothing special in that library, mainly work with sockets (TCP and UDP) and threading.
Now we need to ensure, that this library will work on Android, and fix linkage problems (such as classes or methods missing on Android).
Is there a way to “validate” generic JAR file for Android without writing a complicated test case and running it on Android? I imagine something that I can pass the JAR to and it will tell me “could not load JAR – method X not found in class Y”.
Found the solution. If you have a JAR file which you want to check for basic compatibility with Android’s libraries, you need to do the following:
If the JAR references missing classes, you will get an error immediately during building.