Question

I have a library (not an Android library) that uses the Apache HTTP libraries. I want to use this library in an Android application. It also needs to be used with other types of frameworks. Will this cause any conflicts with the Apache libraries in Android, and is there any way to make it so that when it is included in Android it will use Android's Apache libraries? It would be really inconvenient to have to pass in the HTTP client to use.

Was it helpful?

Solution

Will this cause any conflicts with the Apache libraries in Android

That depends upon how you define "conflicts".

You do not control the runtime classpath, and the firmware always wins. Hence, the Android version of HTTPClient will be used, for all HTTPClient classes that exist in the Android SDK.

If your other library is dependent upon a different version of HTTPClient, you may be in trouble.

is there any way to make it so that when it is included in Android it will use Android's Apache libraries

You have no choice: Android's classes will be used, wherever there is a duplicate.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top