모바일에서 현재 화면 방향을 얻어온다.
Parameters | Type | Description |
---|---|---|
strCallBackName | STRING | 호출할 CallBack 함수명 |
Type | Description |
---|---|
void |
시스템 정보를 JSON 형태로 리턴 받아 처리 할수 있다.
function btn_getorientation_on_mouseup(objInst)
{
mobil_basic.getorientation("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 == "getorientation") {
html = "화면 방향 : " + GetOrientationText(obj.orientation) + " (" + obj.orientation + ")";
fld_sys.settext(html);
}
}
function GetOrientationText(orientation)
{
orientation = parseInt(orientation, 10);
switch(orientation) {
case 1: return "Portrait";
case 2: return "Landscape";
}
}