Page 1 of 1

Use Javascript to determin if instance is HTML5 or Android?

Posted: Tue Aug 12, 2014 7:50 am
by Jacques van Niekerk

Is there any way to use Javascript to determine whether the currently executing instance of an Appery app is native Android, or HTML5 ?
One wants to do this in order to deprecate native services which are not visible via Android.
I want to avoid having two versions of the app - would rather do checking in the code.


Use Javascript to determin if instance is HTML5 or Android?

Posted: Tue Aug 12, 2014 10:35 am
by Evgene Karachevtsev

Hello Jacques,

You may use this function:
prefunction isPhoneGapApp () {
return (document.URL.indexOf('http://') === -1 && document.URL.indexOf('https://') === -1);
};/pre


Use Javascript to determin if instance is HTML5 or Android?

Posted: Tue Aug 12, 2014 3:35 pm
by Jacques van Niekerk

Thanks.