07-26-2013 11:35 AM
I want to know which device (Q10, Z10 or Q5) the user is using because I want to do seperate things for each device.
Previously I used device resolution to find that out, but Q5 and Q10 have the same resolution.
I found this: Qstring HardwareInfo::modelNumber() but it requires the device identifying permissions, which I don't want to do.
How can I find which device it is without getting any permissions on first launch?
07-26-2013 11:58 AM
07-26-2013 12:00 PM - edited 07-26-2013 12:04 PM
HardwareInfo might do the trick, it requires you to add -lbbdevice to your .pro libraries & if you're already getting the display resolution it's likely already setup. It says to check each method to ensure it doesnt require additional permissions.
07-26-2013 12:03 PM
07-26-2013 12:05 PM
@Saprykin only some features of it require permssions
modalNumber requires access_device_model_name permission but
processorSpeed does not, so you query by resolution then by processor speed (q5 is slower) to tell the difference between the 2
07-26-2013 12:09 PM
07-26-2013 12:21 PM - edited 07-26-2013 12:31 PM
if the output resut is the max speed (not sure if it outputs current speed) then it would be possible because the Q10 has a 1.5 Ghz processor, the Q5 has a 1.2 Ghz processor.
My main point here is analyzing the hardware differences and finding something to compare between, it will require legwork yes or alternatively permissions that earn bad reviews....
another example. the Q5 has no micro hdmi connector, the Q10 does, no permission is required to check.
so if you query by screen resolution, then hdmi connector you will be left with a very close conclusion on wether the device is a q5/10 but there should always be a backup scenario in-case of an unknown result
LIBS += -lbbdevice
#include <bb/device/HardwareInfo> HardwareInfo hardware; qDebug() << "hdmi: " << hardware.hdmiConnector();
//return value of 0 is unknown, 1 is no hdmi, 2 is micro-hdmi
07-26-2013 12:30 PM
Seems like that's the best approach at this point, just use hardwareInfo which doesn't require permissions. I can't really see any other way to do it
07-26-2013 12:30 PM