Skip navigation
Monika Sharma
Currently Being Moderated

Open PDF on Android (Flash 4.5 mobile app)

Jun 14, 2011 11:52 PM

Hi,

 

I am planning to implement a ebook pdf reader by getting the url of the pdf (which resides locally or on web) on an Android device and read it.

I have read in livedocs that only when the condition (HTMLLoader.pdfCapability == HTMLPDFCapability.STATUS_OK) is true, the pdf will be read. But its never true on my machine or on the device.

 

Please help. What else do I need to do?

 

Thanks

Monika

 
Replies
  • Currently Being Moderated
    Jun 15, 2011 1:56 AM   in reply to Monika Sharma

    Hi Monika,

    I think you need to use StageWebView as HTMLLoader is not supported on mobile profile:

    http://help.adobe.com/en_US/air/build/WS144092a96ffef7cc16ddeea2126bb4 6b82f-8000.html

    You could use HTMLLoader.isSupported to detect this feature if you have cross-platform code  and when using StageWebView:

    http://help.adobe.com/en_US/FlashPlatform/reference/actionscript/3/fla sh/media/StageWebView.html

    you also can check for feature support with StageWebView.isSupported in your code - both as sanity checks.

    Also take note on this:

    In Android 3.0+, an application must enable hardware acceleration in the Android manifestAdditions element of the AIR application descriptor to display plug-in content in a StageWebView object.

    in linked doc. Also:

    http://forums.adobe.com/message/3738416

     

    regards,

    Peter

     
    |
    Mark as:
  • Currently Being Moderated
    Jun 15, 2011 2:21 PM   in reply to Monika Sharma

    Hi Monika,

     

    What I'm not sure about is if Adobe Reader (9 or X) for Android supports plugin mode on Android for web views (I've no Android device now so can't tell you for   sure - I know that Android OS has no built-in support for PDF content contrary to iOS via web browser). Emulators are useful for general test but not for feature critical testing. I'd rather ask now if Reader X (available for install via app market) supports plug-in mode either here:

    http://forums.adobe.com/community/adobe_reader_forums/android

    or here:

    http://forums.adobe.com/community/air/development/mobile

     

    regards,

    Peter

     
    |
    Mark as:
  • Currently Being Moderated
    Dec 18, 2011 3:45 PM   in reply to Peter Blazejewicz

    In Android 3.0+, an application must enable hardware acceleration in the Android manifestAdditions element of the AIR application descriptor to display plug-in content in a StageWebView object.

     

    I'm having major trouble with displaying PDFs in Android  inside a StageWebView. The code doesn't give me any errors, but then inside my app on Adnroid the StageWebView shows up Blank

     

    From what I've read inorder for STageWebView to disply "plugin" you need Hardware acceleration turned on, but the part I cannot figure out is how do I publish for Android 3.0 in Flash Builder or Flash?  It seems you can select "ANDROID" but in that theres no version selection.

     

    Harware selection only exists in Android 3.0 and above, so it seems this is a GIGANTIC BLUNDER on Adobe's part?.......  How can we build for Hardware acceleration when there is no option to publish to the OS that supports it?

     

     

    Is there a way to tell Adobe Flash BUilder 4.6 or Flash Professional to Publish for Android 3.0 SDK?

     

    COME ON ADOBE!!!

     


     
    |
    Mark as:
  • Currently Being Moderated
    Dec 18, 2011 9:58 PM   in reply to Darkriderdesign

    OK SO I GUESS SINCE THIS IS UN ANSWERED.... WE"LL JUST HAVE TO FIGURE THIS OUT OURSELVES.....

     

    I'm just going to start posting a running thread on what I'm finding:

     

    -- ok so StageWebView works when I run it locally in the emulator, it loads the PDF just as it would in IE or FireFox, I

    I've also read on a post that StageWebView work by sort of displaying the "Default web browser onthe device" sort of like a window chopped through the AIR app?  If this is the case it sort of makes since that it's not working on Android because you can't really preview a PDF inside a web browser, is automatically downloads it and tries to run it with a native app.... if this is the case then the blank window in StageWebView is dead because it's done what it was was suppose to it's now up to the device.

     

    --- I read that "Dolphin browser on android run PDFs inside itself", if this is the case then how do you switch the "Default" broswer in Android?  If AIR just chops a hole in your app to use the native browser, well then Dolphin could work?

     

    -- I've tried just about ever configuration of app manifest and Hardware acceleration, I'm pretty sure at this point, this is not the reason it doesn't work. in that the "plug-in" they are talking about is the video plugin inside the HTML5 markup....

     
    |
    Mark as:
  • Currently Being Moderated
    Mar 5, 2012 9:22 AM   in reply to Darkriderdesign

    Did you every find an answer to this as I am having the same problem??  I cannot diplay a PDF in android version 2.4.  It works GREAT on  the desktop and I-devices.  Just not Android.  I think this is some sort of bug in the StageWebView for an Adobe product not to know how to render another Adobe product.  (air on android cannot display a PDF in their stageWebView class)

     
    |
    Mark as:
  • Currently Being Moderated
    Calculating status...
    Mar 5, 2012 11:31 AM   in reply to DaBullCoder

    This may be an Android issue, I can't open PDF's directly in the Android embedded browser when just doing normal browsing, I have to download them and then open them with a PDF application.

    Mark

     
    |
    Mark as:

More Like This

  • Retrieving data ...

Bookmarked By (0)

Answers + Points = Status

  • 10 points awarded for Correct Answers
  • 5 points awarded for Helpful Answers
  • 10,000+ points
  • 1,001-10,000 points
  • 501-1,000 points
  • 5-500 points