What phonegap cordova do?

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?
 

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.
 

Eme Fibonacci

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.
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?
 

Enrique Gonzalez R

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?
You can load a game in a b4a webview with a local HTML, it Will load without issue.afaik of course
 

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)
 

Eme Fibonacci

Well-Known Member
Licensed User
I use app internal server to load html file in webview via http protocol.
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.
 

Brandsum

Well-Known Member
Licensed User
This makes app more vulnerable. The server can be accessed by other devices.
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.
 
Top