Jacques van Niekerk
Posts: 0
Joined: Wed Apr 09, 2014 3:35 pm

Use Javascript to determin if instance is HTML5 or Android?

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.

Evgene Karachevtsev
Posts: 12
Joined: Mon Apr 28, 2014 1:12 pm

Use Javascript to determin if instance is HTML5 or Android?

Hello Jacques,

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

Return to “Issues”