cancel
Showing results for 
Search instead for 
Did you mean: 

OS version

Former Member
0 Kudos

Hi All,

Is it possible to determine the OS of PDA whether it is mobile 5 or mobile 3 in the MI application.Is there are any API's. to find the same.

We have made the MI application where we have one webdynpro report. Now the problem is that when i want to go back to MI home page or back to MI application page from Webdynpro report.Its working in Mobile 2003 if i hardcode the server address as 127.0.0.1...where as in Mobile 5 its not working since it takes server name as localhost.so is it possible to determinethe OS using some API's or mobile engine config parameter to resolve the same.

Thanks in advance

Regards

Devendra Phate

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi Devendra,

You can use the


         System.getProperty("os.name")
         System.getProperty("os.version")
         These APIs are provided by java itself.

Thanks & Regrads,

Abhijit

Answers (1)

Answers (1)

Former Member
0 Kudos

Hi Devendra

Yes MI definitely provides an API to solve such problems. There is an API class by name Configuration. In this class there is a method getOperatingSystemName() which does this job. You can use the following line of code in your applicaiton and based on the OS name returned, you can redirect your URL accordingly.

Configuration.getInstance().getOperatingSystemName()

Also since you just need to redirect your page either to 127.0.0.1 or localhost based on the type of OS on your PDA, it is possible to achieve this using a simple JavaScript as shown below.

<script type="text/jscript">
if (ScriptEngineMinorVersion() <= 5) {
        window.location.href = "http://127.0.0.1:4444...";
} else {
        window.location.href = "http://localhost:4444...";
}
</script>

Hope this helps

Best Regards

Sivakumar