What phonegap cordova do?

Discussion in 'Chit Chat' started by Eme Fibonacci, Aug 21, 2019.

  1. Eme Fibonacci

    Eme Fibonacci Well-Known Member Licensed User

    An html5 game does not work in webview offline. To solve this, game developers use phonegap cordova. It is a plugin that works as player to run html5 games offline.

    I was thinking about this question. What does phonegap really do? Does he have uses a webview? If it uses a webview how the webview works offline?

    Do you know anything about this?
     
  2. Enrique Gonzalez R

    Enrique Gonzalez R Well-Known Member Licensed User

    Webbrowser are only html and Javascript interpreters, there is no magic, Cordova is only an embedded web browsers that reads local html files.
     
    BillMeyer likes this.
  3. Eme Fibonacci

    Eme Fibonacci Well-Known Member Licensed User

    You did not understand the question.
    If you put a webview into a b4a application and load an html5 game it will not work offline. However, phonegap makes the same html5 game work offline. The question is how he does it?
     
  4. Enrique Gonzalez R

    Enrique Gonzalez R Well-Known Member Licensed User

    You can load a game in a b4a webview with a local HTML, it Will load without issue.afaik of course
     
  5. Eme Fibonacci

    Eme Fibonacci Well-Known Member Licensed User

    From HTML5 documents.

    "Exported games won't work until you upload them. (When running on the file:/// protocol, browsers block many features from working for security reasons.)"

    I found a partial solution.

    If anybody someday need work with html5 games on android webview this can help.

    setAllowUniversalAccessFromFileURL (Added in API level 16)
     
  6. Brandsum

    Brandsum Active Member Licensed User

    I use app internal server to load html file in webview via http protocol.
     
  7. Eme Fibonacci

    Eme Fibonacci Well-Known Member Licensed User

    I was doing this too but realized some problems:

    1) This makes app more vulnerable. The server can be accessed by other devices.
    2) More battery is spent app + server.
    Try my solution.
     
  8. Brandsum

    Brandsum Active Member Licensed User

    You have to add your own authentication method. I always check the app signature hash before processing the response.

    setAllowUniversalAccessFromFileURL does not solve camera access problem.
     
Loading...
  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice