user6363994
user6363994

Reputation: 21

Can I access Java APIs and Packages that are not in Android?

Not all Java Packages are part of Android but is there a way to gain access to them through some work around? Purely as an example javax.sound is one such class. Yes Android has classes to do the same thing but if we already had the working Java written, rewriting it all using Android APIs is not ideal.

Is there any way to use the Java API or do we have to use the Android API?

Upvotes: 0

Views: 66

Answers (2)

AndroidGuy
AndroidGuy

Reputation: 50

No, not all Java libraries have been ported to Android. You will need to use the Android-specific implementation, especially for things that deal with the hardware layer or require a specific technology stack, such as audio libraries.

Upvotes: 1

Basil Battikhi
Basil Battikhi

Reputation: 2668

Yep totally you can but it depending on which libs that you want to use for example you cant use databases drivers in your android apps, neither UI libs , but you can use gson for example

Upvotes: 0

Related Questions