richardemery839
Aspiring developer
Profile
Posts: 258
Reg: May 15, 2013
Bangkok
9,480
07/07/14 04:35 AM (10 years ago)

Can't get PDF's to load

Back on Eclipse again. I have loaded (and works well on Emulator) menu with image. Unfortunately I click on the link to a PDF and it won't load. I have gone through the LogCat - it loads the page perfectly but then:- BT_fileManager:copyAssetToCache: issueforty.pdf BT_fileManager:deleteFile issueforty.pdf BT_fileManager:deleteFile deleting issueforty.pdf I don't understand why it would 'copyAssetToCache' when I just want it to load. Works perfectly on IOS btw.
 
Intrege
Veteran developer
Profile
Posts: 196
Reg: Sep 12, 2011
Philadelphia, P...
3,160
like
07/07/14 05:25 AM (10 years ago)
Hey @richardemery839 I believe you need to have Adobe Reader installed on the phone as well with.
 
SmugWimp
Smugger than thou...
Profile
Posts: 6316
Reg: Nov 07, 2012
Tamuning, GU
81,410
like
07/07/14 08:20 AM (10 years ago)
PDF's are always a little funky in Android... it uses a 'native' reader, like Intrege said... Adobe reader or compatible needs to be installed on your device. The way it works, not just for pdf, but pretty much any resource (I found this out doing maps) is that, even when you bundle a file up inside your app, when it's needed, it gets copied to cache, and then used. The next time the app loads, it looks for the file. If it's in cache, great. If not, whether the file lives on the internet, or if it lives in the bundle, the app will still copy it into cache. So, in the bigger picture, you 'want' it to copyAssetToCache, otherwise the file will never get accessed by the plugin, app, what have you. iOS does the same thing, as far as I can tell. Cheers! -- Smug
 
richardemery839
Aspiring developer
Profile
Posts: 258
Reg: May 15, 2013
Bangkok
9,480
like
07/07/14 08:04 PM (10 years ago)
I am creating the app on my Mac where I created the PDF's. The only cache file I can find is in the res folder and named jarlist cache. It looks like a document file and has three lines written in it. One is #do not edit. Does not seem like the kind of place to put PDF's. However, there are a couple of other folders I have never seen before. One in Android 4 folder named android.jar and has an 010 icon on the box. The other is in Android Private Libraries where there is a jcm.jar and google-play-services.jar folders. I am also using a genymotion emulator as I could not get the eclipse ones to work - if that makes a difference.
 
richardemery839
Aspiring developer
Profile
Posts: 258
Reg: May 15, 2013
Bangkok
9,480
like
07/07/14 10:53 PM (10 years ago)
Ah. You mean the cache on the emulator. Looking into it.
 
SmugWimp
Smugger than thou...
Profile
Posts: 6316
Reg: Nov 07, 2012
Tamuning, GU
81,410
like
07/08/14 12:14 AM (10 years ago)
Emulator, or device. Either one. What I would be looking into is 'why' is it deleting it from the cache after copying it 'to' the cache; that's why it isn't being read. The screen loads, and you tap to open the document. The document should either read from cache, or copy to cache, and subsequently read. It shouldn't 'delete' from the cache just after copying 'to' the cache. If it does that, the document won't be available for reading. Did you modify any code, or is this 'out of the box'...? Cheers! -- Smug
 
richardemery839
Aspiring developer
Profile
Posts: 258
Reg: May 15, 2013
Bangkok
9,480
like
07/08/14 12:59 AM (10 years ago)
Nothing is modified Smug. I have an email in at Genymotion. I have checked Google and there is someone with a similar problem but it was not answered very well. I am now trying to install install Adobe on emulator.
 
richardemery839
Aspiring developer
Profile
Posts: 258
Reg: May 15, 2013
Bangkok
9,480
like
07/11/14 04:31 AM (10 years ago)
Yipee!!! It's taken about 10 days but finally working perfectly (well, yet to be exported to a real phone for testing) but in the emulator it looks great. To those interested. Yes, with a Genymotion emulator you need to download a PDF reader. But it can't be done directly you have to download a zip file from google and when that is installed you can download whatever you want from the net. Thanks for all your help guys.
 

Login + Screen Name Required to Post

pointerLogin to participate so you can start earning points. Once you're logged in (and have a screen name entered in your profile), you can subscribe to topics, follow users, and start learning how to make apps like the pros.