mardi 16 août 2016

Include complete Android SDK in java project

I have implemented a project that uses reflection to find Android classes by name, as in Class.forName("android.util.Log"). The code works for most classes, but some of the names I am looking for appear not to exist. For example android.bluetooth.IBluetoothA2dpcannot be found by forName().

The way I have included the Android SDK in my project is to add it as an external library, like so:

IntelliJScreenshot

The classes that are not discovered by Class.forName()seem to have in common that they either cannot be found altogether (as seen on the right hand side of the image), or their definition contains symbols that cannot be resolved (such as a private field referencing a class that cannot be found). As far as I can tell the sources I have added seem to therefore be incomplete, as for example the definition of interface IBluetoothA2dp is nowhere to be found.

How can I get a hold of the rest of the source files? Have I added the jar incorrectly?

Thanks.





Aucun commentaire:

Enregistrer un commentaire