Tuesday 15 March 2011

gwt - How to load a remote javascript app into a cordova windows phone 8.1 app and have it access cordova plugins -



gwt - How to load a remote javascript app into a cordova windows phone 8.1 app and have it access cordova plugins -

we attempting create relatively lean cordova app deployed windows phone 8.1 platform loads javascript application main webview remote server, maintain access cordova/phonegap plugins. have done in android (see bottom of post).

the remote application requires next features.

access cordova plugins. persistence when device off-line. persistence of info in app, in particular when devices' powerfulness cycled. intend utilize indexdb this.

is possible , if how?

current state of play in windows phone 8.1 window.location = remoteurl ;

causes remoteurl opened in scheme browser. not require.

the inapp browser windows platform apears differently described in cordova wiki. suggests that

window.open('http://whitelisted-url.com', '_self');

will open url in cordova webview. not happen.

we can create web view hand , point @ remote app

var wv = dodument.createelement('x-ms-webview'); wv.style.width = "100%"; wv.style.height = "100%"; wv.navigate(remoteurl); document.body.appendchild(wv);

this not allow access cordova plugins, if server serves cordova.js files part of downloaded application.

also not sure how sand boxed webview , how persistent cached info between executions of windows store app.

our android soulution

including inappbrowser plugin.

config.xml

<access origin="*" />

in android play store application do:

function launchremote() { window.open(remoteurl,'_self'); } document.addeventlistener('deviceready', launchremote, false);

the remote served application launch page includes entry

<script type="text/javascript" src="cordova.js"></script>

and copying server cordova.js, cordova_plugins.js files , plugins directory cordova projects platforms\android\assets\www direcory after running

cordova build android releated documentation.

cordova 4.0.0 cordova main docs

cordova gwt windows-phone-8.1

No comments:

Post a Comment