Best practices for calling APIs

Not all of the APIs can be used in both the Mobile and Web environment. In the section called “General API”, the following functions: of_popmenu, of_popmenuon, of_print2file, of_Print2PDF, of_getbrowserversion, of_getiehandle, of_getieurl, & of_is64browser from the AppeonExtFuncs object are effective in the Web environment only. In the section called “Mobile Device API”, all listed functions are effective in the Mobile environment. If a function that is effective in the Web environment only is executed in a Mobile environment, or if a function that is effective in the Mobile environment only is executed in a Web environment, the function may return unexpected values, and cause the application to perform abnormally.

Therefore, to avoid the aforementioned problem, you should detect the running environment first before calling the corresponding functions.

For example, to call the of_setapprotationlock API which take effects in the mobile environment only, you are recommended to write the scripts in this way:

if appeongetclienttype()="MOBILE" then
   eon_mobile_awsex lgnv_aws
   lgnv_aws = CREATE eon_mobile_awsex
   lgnv_aws.of_setAppOrientation(2)
   lgnv_aws.of_setapprotationlock(1)
    destroy lgnv_aws
end if