I have developed a Java program that uses org.apache.http, and I would like to reuse most of the functionality in an Android app. I would also like to still be able to use my library in my Java program as I add functionality to it. That's why I'm looking for a way to share a single component that I could improve over time, so that I don't have to replicate my modifications each time.
I know that Android has a built-in Apache HTTP client and URLConnection, but I'm pretty sure that simply packaging my original program in a Jar with a common API won't directly work in Android, will it?
I know I'll get answers like "try it and you'll see", that's actually what I'm about to do. But trying here would cost some time, that's why I'm asking beforehand if there would be a simple way to achieve this before I go into hard translation/integration work.
Will I need for instance to create an adapter layer to really isolate the request building (with specific data) from the HTTP client? This sort of wrapper around HTTP-related stuff could delegate to Apache on the pure Java program, and to Volley (or anything else) on the Android plateform.
I would be glad if there was a simpler way...