I am designing an application that makes use of asynchronous HTTP downloads. I want this application to work on Android, Windows desktops and Mac OS desktops, which is why I am developing it in Java and try to make it very modular.
(edit for clarity, the libraries Im using are AsyncHttpClient and Android-Async-Http)
I already have libraries to handle the downloads, but the problem is that specific methods in the CORE module have to be able to perform download functionality irregardless of what library is used. I had two ideas on what to do.
- Idea 1: Put an abstract class called
GenericDownloader
in CORE and extend it in specific apps with classes likeAndroidDownloader
. - Idea 2: Put an interface called
DownloadInterface
in CORE, implement it in specific apps in a similar way to idea 1.
The problem with both of these ideas is that I cannot instantiate an abstract class or an interface, so how can I implement the functionality in CORE?
How else can I solve this problem?