Topic
IC4NOTICE: developerWorks Community will be offline May 29-30, 2015 while we upgrade to the latest version of IBM Connections. For more information, read our upgrade FAQ.
3 replies Latest Post - ‏2013-02-11T06:43:54Z by IdanAdar
MuraliK,Meduri
MuraliK,Meduri
50 Posts
ACCEPTED ANSWER

Pinned topic "Codova plugin" Vs "move between the web and Native Pages"

‏2013-02-09T09:10:54Z |
Hi Team
Iam bit confused on when to go for the "Cordova Plugin" feature and "WL.NativePage.Show". Can you please tell me when to use which feature and the difference between these 2 features.

Iam working on a project where i have to show a PDF within the application, My "PDF Preview is a Native Coponent", so in this case do i have to go for the "Cordova Plugin feature" or "WL.NativePage.Show"?

Your help is highly appreciated, will waiting for the responce, thanks in advance.
  • IdanAdar
    IdanAdar
    741 Posts
    ACCEPTED ANSWER

    Re: "Codova plugin" Vs "move between the web and Native Pages"

    ‏2013-02-10T06:50:32Z  in response to MuraliK,Meduri
    For an explanation about the two features, please review the following training module, pages 8 to 10.
    ftp://public.dhe.ibm.com/software/mobile-solutions/worklight/docs/v505/Module_07_-_Overview_of_Client_Technologies.pdf

    If you choose the WL.NativePage approach, then this is for iOS and Android only.
    In this case you simply navigate from your webView to a nativeView, where you will need to implement in native code (Objective-C for iOS, Java for Android) the mechanism to display your PDF file and any other functionality, like returning to the webView once done viewing the PDF, for example.

    The Cordova plug-in approach simply allows you to access device functionality, such as the device's camera, compass, and others. You'll need to review the Cordova API and see if what they offer will allow you to be able to display a PDF in your webView; if not, you will need to implement this natively.

    Displaying PDFs is different in each platform, not all platforms even allow for this. You will need to research this...

    ***

    Note: IBM forums are in the process of migrating to a new format. During migration the forums will be frozen and in read-only mode. If you wish to continue this thread discussion please post it on stackoverflow, where the Worklight team and others can respond.

    See the Forum Migration announce post for more details. Thank you.
    https://www.ibm.com/developerworks/forums/thread.jspa?messageID=14937476

    Idan Adar
    QA Engineer
    IBM Worklight Mobile Platform
    • MuraliK,Meduri
      MuraliK,Meduri
      50 Posts
      ACCEPTED ANSWER

      Re: "Codova plugin" Vs "move between the web and Native Pages"

      ‏2013-02-10T10:31:53Z  in response to IdanAdar
      Thanks idan for the reply,
      if i write a android specific java code which opens the PDF in a native webview component not on the webview where my worklight application is running, i know my application can call this cordova plugin,
      is there any possibility that this webview comes on top of my worklight aplication with a close button, when the user clicked on the close button, the pdf view gets disapeared and my application would be there. instead of moving between the web and native pages.

      if this is possible then i can execute this on all the 4 platforms, instead of going for the WL.NativePage.Show

      does that make sence?
  • IdanAdar
    IdanAdar
    741 Posts
    ACCEPTED ANSWER

    Re: "Codova plugin" Vs "move between the web and Native Pages"

    ‏2013-02-11T06:43:54Z  in response to MuraliK,Meduri
    Murali, I think that you still do not understand the concept.

    Please forget for a moment what you are trying to achieve with opening a PDF file in your application, and do the training modules. These will teach you the concepts of using Cordova plug-ins as well as opening native pages from a Worklight application. Once you do that, I am certain you will understand which approach you will prefer to take with your application.

    There is no escape, if you want to know how to do something, please read the material, do the exercises and look at the sample applications.

    Module 8.1 - iOS Development: Combining Native and Web Pages
    ftp://public.dhe.ibm.com/software/mobile-solutions/worklight/docs/v505/Module_08_1_-_iOS_Development_Combining_Native_and_Web_Pages.pdf

    Module 8.2 - iOS Development using Worklight API in a Native Application
    ftp://public.dhe.ibm.com/software/mobile-solutions/worklight/docs/v505/Module_08_2_-_iOS_Development_Using_Worklight_API_in_a_Native_Application.pdf

    Module 9.1 - Android Development: Combining Native and Web Pages
    ftp://public.dhe.ibm.com/software/mobile-solutions/worklight/docs/v505/Module_09_1_-_Android_Development_Combining_Native_and_Web_Pages.pdf

    Module 9.2 - Android Development using Worklight API in a Native Application
    ftp://public.dhe.ibm.com/software/mobile-solutions/worklight/docs/v505/Module_09_2_-_Android_Development_Using_Worklight_API_in_a_Native_Application.pdf

    The samples can be found next to each module, here:
    https://www.ibm.com/developerworks/mobile/worklight/getting-started/#mobile-client-development

    ===
    Note: IBM forums are in the process of migrating to a new format. During migration the forums will be frozen and in read-only mode. If you wish to continue this thread discussion please post it on stackoverflow, where the Worklight team and others can respond.

    See the Forum Migration announce post for more details. Thank you.
    https://www.ibm.com/developerworks/forums/thread.jspa?messageID=14937476

    Idan Adar
    QA Engineer
    IBM Worklight Mobile Platform