Reputation: 5848
When I try to get bluetooth properties in tizen studio:
var bluetoothSwitchAppControl = new tizen.ApplicationControl('http://tizen.org/appcontrol/operation/edit', null, 'application/x-bluetooth-on-off');
var adapter = tizen.bluetooth.getDefaultAdapter();
I'm getting this error:
Uncaught TypeError: Cannot read property 'getDefaultAdapter' of undefined
What is the problem and how to solve it?
Upvotes: 1
Views: 485
Reputation: 2184
It's totally Okay. You don't need to solve anything. Most probably you are running the project on Tizen Wearable/Mobile Emulator.
tizen.bluetooth.getDefaultAdapter() and other relevant bluetooth functions would be undefined when you are deploying the app on Emulator, Cause Emulators don't support Bluetooth. When you would deploy the Project on Real Device it would work as expected.
Upvotes: 2