Skip to content

Instantly share code, notes, and snippets.

@1fabiopereira
Last active February 20, 2017 17:36
Show Gist options
  • Save 1fabiopereira/220e501e0c8e5d5bacb7b18210ef090f to your computer and use it in GitHub Desktop.
Save 1fabiopereira/220e501e0c8e5d5bacb7b18210ef090f to your computer and use it in GitHub Desktop.
Simple mobile detect architecture
class AndroidArchitecture{
static getArchitecture(){
let architecture;
if(navigator.platform.indexOf('i686') !== -1){
architecture = '32-bits';
} else if(navigator.platform.indexOf('armv8l') !== -1){
architecture = '64-bits';
}
return architecture;
}
}
alert(AndroidArchitecture.getArchitecture());
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment