Languages

Menu
Sites
Language
Is there orientation sensor in Z1?

I want to implement a functionality based on the orientation of the phone. But I don't know if there is orienation sensor in Z1. Anyone knows?

Responses

9 Replies
colin Rao

Hi,

f.y.i.

As I know, Z1 not support the orienation sensor. 

daniel kim

Hi,

According to below specification of Z1, it doesn't support orientation sensor(magnatic sensor which give magnetic north of earth).

    http://developer.samsung.com/samsung-z

Regards.

 

 

Jean Yang

Thanks colin! Z1 only support acceleration sensor.

I've found the codes to test what sensors the Tizen devices support, and I've paste it in the codesnipper. 

https://developer.tizen.org/community/code-snippet/native-code-snippet/codes-test-sensors-your-tizen-devices-support.

Palitsyna

Hello,

thanks for sharing this code snippet. And yes, unfortunately, Z1 doesn't support orientation sensor.

Jean Yang

Thanks Kim! The result from the test codes is just in accordence with the specification your mentioned.

Alex Dem

Hi,
In all native samples there is registered callback:
 

ui_app_add_event_handler(&handlers[APP_EVENT_DEVICE_ORIENTATION_CHANGED], APP_EVENT_DEVICE_ORIENTATION_CHANGED, ui_app_orient_changed, &ad);

This callback is called after orientation has been changed. Maybe it could be enough for your case?
Alexey.

Alex Dem

But regarding sensors - only acceleration works on Z1.
Alexey.

Jean Yang

Thanks Alex! You reminder me that the application should can be easily to accomodate to the landscape or portait orientation.

In fact, your code is used to register the call back funciton when orientaion changed.

But if we only want to automatically accomodate the app UI to specific orientation, we need add following codes.

 if (elm_win_wm_rotation_supported_get(win)) {
     int rots[4] = { 0, 90, 180, 270 };
     elm_win_wm_rotation_available_rotations_set(win, rots, 4);
 }

 

Alex Dem

Hi,
fyi: I have checked with Z3 it supports acceleration & proximity  sensors.
Alexey.