I want to write a program in J2ME to turn the Bluetooth on/off automaticly in a certain time without the user permission.
I'v been looking for a while but I couldn't find an answer.
I want to write a program in J2ME to turn the Bluetooth on/off automaticly in a certain time without the user permission.
I'v been looking for a while but I couldn't find an answer.
No way. We cannot be able to automatically turn on/off bluetooth in java & j2me. Better you refer to the documentation of JSR 82
There is definitely no way to programmatically switch your Bluetooth on and off in Java ME. However what may be useful is to switch between discoverable modes:
to be discoverable, and
to hide from other devices. It doesn't save battery, but it does make things that little bit more secure I guess.
Some phones will automatically switch bluetooth ON when a MIDlet starts using the Java ME Bluetooth API.
Other phones will not.
AFAIK, there is no Java ME API to switch bluetooth ON/OFF.
I have yet to find a mobile phone that automatically switches bluetooth OFF after some time of inactivity.
Any way you find to do this (I'm sure it's doable in Symbian OS C++, for example) will be platform-dependant.