시스템 정보를 얻어온다.
Parameters | Type | Description |
---|---|---|
strCallBackName | STRING | 호출할 CallBack 함수명 |
Type | Description |
---|---|
void |
시스템 정보를 JSON 형태로 리턴 받아 처리 할수 있다.
function btn_infosys_on_mouseup(objInst)
{
mobil_basic.infosys("mobile_api_callback");
}
// Callback Function
function mobile_api_callback(func_name, response) {
var html = "";
var obj = JSON.parse(response);
mobil_basic.toast("func_name: " + func_name);
mobil_basic.toast("response: " + response);
if (obj.code != 200) {
screen.alert(obj.result);
return;
}
/** Info API **/
if (func_name == "infosys") {
html = "해상도 : " + obj.resolution+"\n";
html = html + "code : " + obj.code + "\n";
html = html + "result : " + obj.result + "\n";
html = html + "디바이스모델 : " + obj.devicemodel + "\n";
html = html + "OS종류 : " + GetOsText(obj.os) + " (" + obj.os + ")\n";
html = html + "OS버전 : " + obj.osversion + "\n";
html = html + "통신사 : " + obj.telecom + "\n";
html = html + "디바이스방향 : " + GetOrientationText(obj.orientation)
+ " (" + obj.orientation + ")";
// 정보 표시
fld_sys.settext(html);
}
}
function GetOsText(os)
{
os = parseInt(os, 10);
switch(os) {
case 0: return "Invalid";
case 1: return "Android";
case 2: return "iOS";
case 99: return "Unknown";
default: return "Unknown";
}
}
function GetOrientationText(orientation)
{
orientation = parseInt(orientation, 10);
switch(orientation) {
case 0: return "Invalid";
case 1: return "Portrait";
case 2: return "Landscape";
case 99: return "Unknown";
default: return "Unknown";
}
}