android - Get device or simulator information runtime for SOAP web services -
i have here small issue codenameone when calling soap
web service device. may know, soap
web services have own way of encoding http requests. these encoding rules different wether use soap
1.1 or 1.2.
when run in simulator, seems v1.2 used, , requires way of specifying http headers service work.
when on device (iphone here), switched soap
1.1 , thus, http headers needs encoded differently (soap action, content type).
so question: in code, how can figure in environment running, simulator, or real device? , while @ it, if ever need specific logic of sort based on device nature, how can make check?
thanks in advance hints.
you can use
display.getinstance().getplatformname()
to return name of platform running on.
if running on iphone return "ios". did quick test , saw return "ios" in emulator.
hope helps
Comments
Post a Comment