cancel
Showing results for 
Search instead for 
Did you mean: 

How to show PDF file and use DownloadTask class

mcasanket
Champ on-the-rise
Champ on-the-rise
Hello everyone,

I have developed a simple application in which I am showing a list of files in some folder of alfresco. But when I click on the PDF file it shows me error and application crashes. What code i should write to open the PDF file? Do I need to download it first and then show?

I also saw the documentation for Alfresco Android, how can I use DownloadTask in my code. Can anyone give a simple example code?

Thanks in advance.
1 REPLY 1

jm_pascal
Star Contributor
Star Contributor
Aloah,

If you want to open a file inside your device, you have to download it first and then use any reader available like Acrobat Reader.
To download the file, you can
<ul>
<li>implement your own background task + implement your Intent to open it see : http://developer.android.com/training/building-connectivity.html and http://developer.android.com/training/sharing/index.html </li>
<li>Use Alfresco Mobile UI library with DownloadTask to download the file and ActionManager to send the file to another application.</li>

If you want a sample application on how to use Alfresco Android SDK, please have a look to the github project https://github.com/Alfresco/alfresco-android-sdk/tree/master/samples/alfresco-mobile-android-samples...

</ul>
Hope it helps.