Win a copy of Java Persistence with Spring Data and Hibernate this week in the Spring forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Tim Cooke
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • Junilu Lacar
  • Rob Spoor
  • Jeanne Boyarsky
Saloon Keepers:
  • Stephan van Hulst
  • Carey Brown
  • Tim Holloway
  • Piet Souris
Bartenders:

Unable to open pdf in android in Gdrive

 
Ranch Hand
Posts: 251
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hello,

Usecase: Open pdf(present in internal storage in my app name directory) in android via any pdf reader app present in the device (eg: GDrive).


Problem As per my current analysis it works fine in android 9 and below devices but creates the problem in Android 10.

What is happening: Pdf name gets displayed in Gdrive pdf viewer header but pdf doesn't render. and brings back to my app.

Devices which are creating a problem: Samsung s 10(Doesnot know the android version), One plus A6000(Android 10), Samsung A70(Doesnot know the android version), Nokia 6.1 plus(Android 10), OnePlus 6T(Doesnot know the android version)

Though there are devices which are running on android 10 and are not creating a problem.

Devices which are not creating a problem: Samsung GalaxyS20(Android 10)

There are also few devices that were not creating a problem earlier with android 10 and recently have started creating the problem and vice-versa also(i.e. problem got fixed automatically).

This problem is quite confusing and I am unable to find root cause.

What I have tried 1. Checked Logs: No error/exception got logged

2. Checked result code of intent there also no issue.
3. Permissions: In-app: Media, camera, and storage permission: enabled In drive: Storage permission: enabled
4. I have also read the documentation of android 10.

To allow other apps to access files stored in this directory within internal storage, use a FileProvider with the FLAG_GRANT_READ_URI_PERMISSION attribute.


   
5. There is no problem with pdf because opening same pdf with some other pdf reader(eg: adobe)it works flawlessly.
Currently app


I just simply want to solve this issue. I am having a few questions:

1. Is it actually some problem with android 10 or issue with my code only?

2. Does making app compatible with android 10 will solve this issue?

3. How can I debug it?

If I have missed any case then please let me know. Thanks in advance.
 
Bartender
Posts: 7488
171
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
The first thing to check is whether there are any messages in the the logcat.

Then I would try the same approach with some other, very simple PDF. So you'll know whether this is a general issue with displaying PDFS, or just with one particular one.
 
priyanshi bhardwaj
Ranch Hand
Posts: 251
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Tim Moores wrote:The first thing to check is whether there are any messages in the logcat.

Then I would try the same approach with some other, very simple PDF. So you'll know whether this is a general issue with displaying PDFS, or just with one particular one.



@Tim apologies for the late reply.

1. Logcat: There is no exception. No message nothing

2. I have already tried it with multiple pdf's. It is a general issue.

 
Tim Moores
Bartender
Posts: 7488
171
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Then my advice would be to try to reduce it to an SSCCE: a minimal app that still exhibits this problem. It should have one class (the main activity), and do nothing but send that Intent. My guess would be that this app would not actually exhibit the issue. Then you'd know that this problem is somewhere else in your app, which makes it amenable to further examination.

OTOH, if the minimal app still exhibits the problem, you have all you need for filing a bug report with Google :-)
 
If you are using a wood chipper, you are doing it wrong. Even on this tiny ad:
The Low Tech Laboratory Movie Kickstarter is LIVE NOW!
https://www.kickstarter.com/projects/paulwheaton/low-tech
reply
    Bookmark Topic Watch Topic
  • New Topic