Closed mrcodecloud closed 3 years ago
@RAZA-ABBBASI
Thank you for posting the link to your repository. I have reproduced the issue. Please try performing the following steps:
implementation 'com.groupdocs:groupdocs-viewer-cloud:21.8'
to implementation 'com.groupdocs:groupdocs-viewer-cloud-android:21.8'
the groupdocs-viewer-cloud-android works better with Android AppsFileInfo fileInfo = new FileInfo();
fileInfo.setFilePath("three-layouts.dwf");
In case you would like to upload a file from a device you'll need to upload a file to the storage first. Check this test as an example.
@vladimir-litvinchik Thank you so much for the response, I am late here but got it through a hard way that we first need the file to be tested at the storage first. Now I am looking into the file uploading part and will update you with the results. Thanks again for your prompt response.
Also I am curious, how I can use the response to view the rendered file in android?
@RAZA-ABBBASI
The simplest scenario I can think of:
createView
- this method will convert the file e.g. to HTML and place the output in your storage in the viewer
folderHere is an example that includes the second and third steps.
Thanks I am looking into it now.
@vladimir-litvinchik The code snippet you shared above is for testing Test. Can you please share how I can upload file to the groupdocs cloud?
@RAZA-ABBBASI
You can upload a file to storage by using FileApi
like so
Configuration configuration = new Configuration("app-sid", "app-key");
FileApi fileApi = new FileApi(configuration);
File file = getFile();
fileApi.uploadFile(new UploadFileRequest(path, file, null));
Here are some tests that are using FileApi
.
Not sure, why I am always getting an exception file not found I updated the repo, can you please have a look at it? MainActivity2.kt is the file we are working on now.
@RAZA-ABBBASI
For the sake of simplicity, I have created a sample application https://github.com/vladimir-litvinchik/converting-file-to-html-and-downloading-output-with-cloud-sdk where you can find all the steps that have to be performed including uploading a file to storage and downloading the output.
@vladimir-litvinchik Thanks for your support. I just finished my sample app which performs the following
It will be great help for the groupdocs android users, if you share it at groupdocs github examples page.
@RAZA-ABBBASI
Great to hear that you have finished the sample app!
It will be great help for the groupdocs android users, if you share it at groupdocs github examples page.
Do you mean adding a sample Android project that uses SDK to https://github.com/groupdocs-viewer-cloud?
Yes, Please
@RAZA-ABBBASI
I believe that it does make sense. We'll consider adding a sample app to the list of samples. Thank you for your suggestion!
@vladimir-litvinchik I am trying to build a sample android app for rendering the dwg files, but always getting API Exception error. Here is my sample app repo, can you please help? https://github.com/RAZA-ABBBASI/dwgviewer