Question
I created a '(Circle) Sensors' sample project in Tizen Studio. When I install and run this project on my Gear S2 (SM-R770) running Tizen 2.3.2, the app only displays a white screen without any functionality.
The error logs show the following repeated messages:
08-20 14:13:00.411 : ERROR / sensors (4409 : 4409) : [../src/data.c:78] sensor_get_default_sensor() error: Invalid argument
No other useful error information is available. How can I make the sample app work properly?
Answer
Problem Understanding
The issue occurs when trying to run the Circle Sensors sample app on Gear S2 (SM-R770) with Tizen 2.3.2. The error suggests that the device cannot find or access the default sensor, causing the app to display only a white screen.
Solution Methods
-
Check Sensor Availability:
- Verify that your device actually has the sensors the sample app is trying to access
- Some older devices might not support all sensor types
-
Alternative Implementation:
- As mentioned in one of the answers, implementing custom sensor code might work better than using the sample
- Follow the working example from the Tizen documentation
-
Update Tizen Version:
- Consider updating your device to a newer Tizen version if possible
- Some sensor-related issues were fixed in later versions
Code Examples
Here's a basic sensor implementation that works on Gear devices:
#include <sensor.h>
void initialize_sensor() {
sensor_h sensor;
int error;
error = sensor_get_default_sensor(SENSOR_ACCELEROMETER, &sensor);
if (error != SENSOR_ERROR_NONE) {
dlog_print(DLOG_ERROR, "SENSOR", "Failed to get accelerometer sensor");
return;
}
// Add your sensor event handling code here
}
Additional Tips
- The issue appears to be common across multiple Gear devices
- For more detailed sensor implementation, refer to the official documentation on Samsung Tizen OS:
- When testing sensor applications, always:
- Check device compatibility
- Handle sensor errors gracefully
- Test on multiple devices if possible