Error while getting vector values on Samsung Omnia

May 29, 2009 at 6:37 AM

Hello,

I am facing error while retrieving vector values on Samsung Omnia.

Values are retrieved successfully for the first time, but it throws error "Unable to perform operation." when device's screen is made off and then on again.

Code for HTC works flawlessly on Touch Diamond.

Anybody facing the same issue?

Thanks,

Krupal

 

Jun 3, 2009 at 6:48 AM
Edited Jun 3, 2009 at 6:48 AM

Try this:

http://sensorapi.codeplex.com/Thread/View.aspx?ThreadId=58287

Jun 5, 2009 at 4:50 AM

Thanks ageye, I will try this code.

BTW, Thanks for G-Alarm, its amazing replacement of winmo alarm. Works great on my touch diamond.

Jun 16, 2009 at 6:51 AM

Hi Ageye,

I tried this new code and seems to be working as per the user reviews (I don't have Omnia to test on my own).

Now I have one strange problem. Would you help me on this please.

My application G-Trigger, polls for G-Sensor continously. I have kept an exception for "GAlarmScreen.EXE".

If it finds "GAlarmScreen.EXE" as active application, it will stop polling the sensor, until "GAlarmScreen.EXE" is active. As soon as "GAlarmScreen.EXE" closes, G-Trigger again starts polling for G-Sensor. Now after this time, on polling the G-Sensor, getVector() returns x,y,z as 0,0,0 continuosly. I tried re-initializing the sensor from SensoryFactory but still it all time returns 0,0,0. To overcome this issue, I need to manually close my application (G-Trigger) and again run it. When I run it again it works fine.

I am not able to spot the issue. Have you ever faced such issue? I have not tested it with any application which uses this sensorapi other than GAlarm. I think it was working fine with earlier versions of GAlarm, not sure about it.

Thanks,
Krupal

Jun 16, 2009 at 10:37 AM

well, I use the way which is officially documented and used as an example in Samsung's SDK. I don't have an Omnia so I can't try it by myself - but you might want to check the other functions:

[DllImport(SamsungMobileSDKDllName, EntryPoint = "SmiAccelerometerRegisterHandler")]
private static extern SmiResultCode RegisterHandler(uint period, EventHandler handler);

[DllImport(SamsungMobileSDKDllName, EntryPoint = "SmiAccelerometerUnregisterHandler")]
private static extern SmiResultCode UnregisterHandler();

I don't know what they mean :)
Jun 17, 2009 at 11:27 AM

Thanks ageye for the prompt response.

The issue mentioned in last post is reproducible on my HTC Touch Diamond as well.

Anyway I will debug it more :)

Thanks again,
Krupal