Obtain the model and operating system version

6 views
Skip to first unread message

josuegustavoh...@gmail.com

unread,
Oct 18, 2018, 6:39:01 PM10/18/18
to CodenameOne Discussions
Hi.

I need to get the model and version of the operating system of the devices (iOS, AND) 

Look in previous topics that were quite old where they could not provide it.

For example, try an app in a MotoG Version Android 5.0 and in a Samsung Galaxy Android 8.0 and there were differences in how the code was executed. That's why I need it, in case an unexpected error occurs, it appears in the log report

Shai Almog

unread,
Oct 19, 2018, 12:56:55 AM10/19/18
to CodenameOne Discussions
Hi,
getProperty in display provides you with OS, model string etc. See the docs for the various types of models.
This should be enough for most use cases including yours.

If you really want to dig into this you can use the device detection cn1lib contributed by Diamond https://www.codenameone.com/blog/lightweight-picker-device-detection.html
Reply all
Reply to author
Forward
0 new messages