Display.getInstance().isSimulator();
On Friday, March 12, 2021 at 2:52:03 PM UTC-8 P5music wrote:
> I need a function to detect whether the app is running on the simulator of
> the IDE (computer) instead of a mobile device.
>
> The platform name is from the skin.
> For example I get "ios", or "and".
>
> This is not useful:
> public static boolean isSimulator()
> {
> String os=Display.getInstance().getPlatformName();
> System.out.println("os "+os);
> if (!(
> (os.toLowerCase().contains("ios"))||
> (os.toLowerCase().contains("and"))
> )) {return true;}
> else {return false;}
> }
>
> How to detect the fact that the device is simulated?
> Thanks
>
>
--
You received this message because you are subscribed to the Google Groups
"CodenameOne Discussions" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/codenameone-discussions/1446e3ce-56d4-4cc5-aa2f-8ef2d8297304n%40googlegroups.com.