Android App Development around onwcloud as a image provider



Hello, there is not much information out there for the newbies.. not even in Stack Overflow, a little background on what im trying to achieve is:

-Already managed to sync my project to the owncloud library via gradlle.
- The provided examples are not of much help for me you will see why.

I use this library to stream images URLs to some imageviews in my app, as i was on a web server I had no problem but now that I moved to owncloud, I can do the same if i provide my app with the "download link" from the stored images.

That said, what I need is to some how be able to select the owncloud stored images(access the shared folder and download) by name and or read the download link from where ever is stored..

here is the use the glide library on my project

  String url = null;
            if (plato.getFoto_movil().equals("churrasco.jpg"))
                url = "";

            if (plato.getFoto_movil().equals("pizza.jpg"))
                url = "";

            if (plato.getFoto_movil().equals("torta_chocolate.jpg"))
                url = "";


which is sad because I had to manually get those URLs from my browser and it does not work with the newly added images from any othere device, so I need to be able to get any new image and show it too.

I have the library installed 100% and implemented but

        private void startDownload(String filePath, File targetDirectory) {
            DownloadRemoteFileOperation downloadOperation = new DownloadRemoteFileOperation(filePath, targetDirectory.getAbsolutePath());
            downloadOperation.addDatatransferProgressListener((OnDatatransferProgressListener) mContext);
            downloadOperation.execute( mClient, (OnRemoteOperationListener) mContext, mHandler);

        public void onTransferProgress(long l, long l1, long l2, String s) {
   new Runnable() {
                public void run() {
                    // do your UI updates about progress here

        public void onRemoteOperationFinish(RemoteOperation remoteOperation, RemoteOperationResult remoteOperationResult) {
            if (remoteOperation instanceof DownloadRemoteFileOperation) {
                if (remoteOperationResult.isSuccess()) {

got those and

got also this two
mClient = OwnCloudClientFactory.createOwnCloudClient(serverUri,mContext,true);

then I call the method


the app crashes here when I call the startdowonload method
with the error java.lang.ClassCastException: com.eidotab.eidotab.MainActivity cannot be cast to

and even if it does have success, donĀ“t know where or how to get the download links, like I said, I need the download link from every image stored in the server..

is this possible?

thanks in advance


Got an update, managed to solve the downloading issue, and got the files downloading to my internal sd card, is not the best solution but, im ok with it, the problem was that i was implementing the methos to a recyclerview and the must be implemented in an activity... and well.. case closed, thanks