2

I have a .jar in my Android project which has many references and uses of the java.awt.* classes and other classes not available on Android. How can I provide my own implementations of these classes so that I can embed the unmodified .jar file (the only modification is being ran through dx) in my Android application and it will use my own class implementations?

Isaac Waller
  • 32,709
  • 29
  • 96
  • 107

1 Answers1

1

Sorry, you can't. Classes in your .apk must not be in the java.*, javax.*, android.*, and com.android.* namespaces. An application can't replace system classes, and if you have classes in those namespaces that aren't currently defined by the system you run the risk of breaking in the future if a class of the same name appears.

hackbod
  • 90,665
  • 16
  • 140
  • 154