02-25-2013 04:50 PM
In my project I'd like to show diffrent layout in Q10 phone (which has physical keyboard)
I have 2 questions:
How to detect whether device has physical keyboard?
How to detect the device type in Android project?
android.os.Build.MODEL and DEVICE returns Unknown.
Is it possible to use net.rim.device.api.system.DeviceInfo in android project?
02-26-2013 03:48 AM
To detect the keyboard type on Android, normally you would use getResources().getConfiguration().keyboard
The value shows the kind of keyboard attached to the device. One of: KEYBOARD_NOKEYS, KEYBOARD_QWERTY, KEYBOARD_12KEY.
However I never tested this on BB10 as I don't have a Dev Alpha C.
On the Dev Alpha and on simulator it returns the correct value of KEYBOARD_NOKEYS.
If your Android app is running on a BlackBerry device, System.getProperty("os.name") returns "qnx".
I wasn't able to find any property which would return the exact device model.
02-26-2013 06:07 AM
Thank you for your answer.
I'm using Dev Alpha C simulator (BB10_1_X.338) and getResources().getConfiguration().keyboard returns 1, which is KEYBOARD_NOKEYS. Is it correct? Why? Dev Alpha C has a keyboard.
Can I rely on this config settings or is it always KEYBOARD_NOKEYS?
I don't have device, too.
02-26-2013 06:33 AM
KEYBOARD_NOKEYS certainly would not be correct on Q10 or Dev Alpha C
On the simulator it might be correct...
Did anyone with a Dev Alpha C device test this?
It would be nice if someone from BlackBerry could confirm whether getResources().getConfiguration().keyboard is implemented properly in the Android Runtime.
I am not able to find any information regarding this in the unsupported APIs documentation: http://developer.blackberry.com/android/apisupport
06-23-2013 10:47 AM
Well guys, on Android
is returning string "Z10" on my Dev Alpha B.
I'm assuming it'll return "Z10" on real Z10 as well.
Tried it on Dev Alpha C and it's returning "Dev Alpha"
Can somebody confirm what exactly will it return on diferent devices?
06-24-2013 10:49 AM
If all you want to do is show a different layout for the Q10, you should let the asset selector do it for you.
You can follow this: http://devblog.blackberry.com/2013/03/blackberry-q