[REQ]Turn on/off WiFi, depending on Bluetooth - Touch Diamond, MDA Compact IV Themes and Apps

Hi all!
When I woke up today, like 20 min ago!
I had an idea I would like to get on my phone..
I know a little programming, but not enough to realise this
ok..
When I'm at home I use wiFi to connect my phone to the internet, but when I'm not at home I don't use WiFi (like many others)
And I sometimes forget to turn it off when I'm going out,
and firstly It drains battery
second, It makes anoying beeps whenever it finds new wiFi's
(have anyone found how to turn this off permanently, every time i restart my phone it's back on again! Grr)
anyway back to to point...
My Bluetooth is always on...
transfering files when at home, and listning to music when I'm out...
So Idea (finally )
When Bluetooth connects/finds my home computer it will turn on WiFi
and when it loses my home computer it will turn off WiFi..
pretty simple idea, but I think It can be pretty useful?
any programming geniuses up to te task!?
Thanx to all in this Forum...!

I'll look at it...

Mr_Gee said:
I'll look at it...
Click to expand...
Click to collapse
Nice ...
I've looked in msdn about bluetooth .. but I just don't know where to start...???
The idea came partly from when I'm listening to music with bluetooth headphones and are leaving my apartment..
The music stops-starts-stops-starts.... just as I'm out of range for the bluetooth...
So I thought there must be an event that u can 'hook up on' with a small app that turns off/on the wifi...?
would be great if someone (Mr_Gee?) could help me out here ..?
or maybe just point me in the right direction when it comes to the coding?
(Visual Basic is the language I'm used to)

I got something, which is partially working,
do you connect to your PC when you are at home?
the problem i'm facing is that in the registry i can see what is going on, but for some reason i can't see if/when the BT is connected to the PC
the code is the same as "on but not connected", I could look up if there is an active sync connection, but i'm not sure if this is something that manually needs to be initiated.
the app does work if you are disconnected, it will stop the wifi

Mr_Gee said:
I got something, which is partially working,
do you connect to your PC when you are at home?
the problem i'm facing is that in the registry i can see what is going on, but for some reason i can't see if/when the BT is connected to the PC
the code is the same as "on but not connected", I could look up if there is an active sync connection, but i'm not sure if this is something that manually needs to be initiated.
the app does work if you are disconnected, it will stop the wifi
Click to expand...
Click to collapse
ok ... no, I'm not connected to my computer with active sync all the time...
So that probably isn't a solution... ?
I want it to notice if my computer is in range...
but shouldn't there be a process running that's checking if someone is connecting or sending something?
Like with the headphones, If I go out of range with them, eventually the handsfree will turn off...
Like I said... I have no idea where to go here!
But Thanx! for your help on this...
Much appreciated!

Yes that is what you would expect...
but I need to find the information somewhere
I'll keep looking and let you know

This script apparently lets you automatically activesync over bluetooth when you are close to your computer.
http://forum.xda-developers.com/showpost.php?p=1096906&postcount=5
Code:
If NOT wndExists "Connected to MEDIACENTER"
RegReadDWord HKLM, System\State\Hardware, Bluetooth, Bluetooth
If Expression %Bluetooth% <= 8
Set BluetoothWas, "Off"
Run "\Windows\ToggleBTH.exe"
Sleep 3000
EndIf
Run "\Windows\rnaapp.exe", -n -m -e"MEDIACENTER"
WaitFor "Connected to MEDIACENTER", 15
Run "\Windows\udp2tcp.exe"
Run "\Windows\rapiclnt.exe", -dppp_peer
Run "\Windows\repllog.exe", /remote /sched /h
Sleep 1000
RegWriteDWord HKLM, System\State\Hardware, Cradled, 1
While wndExists "Connected to MEDIACENTER"
Sleep 1000
EndWhile
Run "\Program Files\MortScript\TKill.exe", UDP to TCP proxy
Run "\Program Files\MortScript\TKill.exe", Remote API Client
Run "\Program Files\MortScript\TKill.exe", ActiveSync
If equals %BluetoothWas%, "Off"
Run "\Windows\ToggleBTH.exe"
EndIf
Else
Run "\Program Files\MortScript\TKill.exe", Connected to MEDIACENTER
EndIf
One could easily inset a wifi toggle softcut in there somewhere.
Surur

surur said:
This script apparently lets you automatically activesync over bluetooth when you are close to your computer.
http://forum.xda-developers.com/showpost.php?p=1096920&postcount=6
....
One could easily inset a wifi toggle softcut in there somewhere.
Surur
Click to expand...
Click to collapse
Nice find...
but I don't think it will run the script when I'm close to my computer...
looks like u run the script and it activates bluetooth runs activesync and then closes the connection ...

NisseDILLIGAF said:
Nice find...
but I don't think it will run the script when I'm close to my computer...
looks like u run the script and it activates bluetooth runs activesync and then closes the connection ...
Click to expand...
Click to collapse
Presumably you could put it in a loop and check for success or failure of the activesync connection. Reading the script is not ideal however.
Surur

surur said:
This script apparently lets you automatically activesync over bluetooth when you are close to your computer.
http://forum.xda-developers.com/showpost.php?p=1096906&postcount=5
One could easily inset a wifi toggle softcut in there somewhere.
Surur
Click to expand...
Click to collapse
Hi,
That script is indeed only one-click sync, in that particular script it's over GRPS/UMTS. I made such a script for Bluetooth also, but it's only to sync. I still haven't found a way to auto-connect to your Bluetooth or WIFI source without a script continuesly looping and there for draining the battery and the CPU.
In this thread however mjg7876 asked for ideas, put up a vote and apperantly the event driven application got the most votes. I suggested just such a feature; raise an event when a particular BT device is connectable. All we can do is hope mjg7876 gets started on the project soon, and finds a non-battery-draining way in C++ make it happen.
Cheers,
Cacti

Related

every phone call activates Bluetooth

Does anybody have an idea, why every call I made automaticaly activates Bluetooth?
I do not use any headset.
amir77a said:
Does anybody have an idea, why every call I made automaticaly activates Bluetooth?
I do not use any headset.
Click to expand...
Click to collapse
Have you installed Bluetooth Tools?
Not sure if that's even necessary or not, but certainly that software by very nature, does this so that incoming calls can be passed to Bluetooth headsets.
This can be altered, if you are using Bluetooth Tools, by enabling this item on the today screen, and turning OFF timed bluetooth mode.
If you are not using this, then I am not sure...
Yes, I do use Bluetooth tools.
I use it mainly for my GPS BT Receiver.
I will play with its options, and see if this can solved this.
amir77a said:
Yes, I do use Bluetooth tools.
I use it mainly for my GPS BT Receiver.
I will play with its options, and see if this can solved this.
Click to expand...
Click to collapse
Not solve mate - it's the whole intention of the software you installed.
Simply enable the Bluetooth Tools plugin on your today screen.
Then you will see a little clock icon.
Tap on this so it goes grey.
This means you just turned OFF the timed bluetooth option.
But mate, it ISN'T a bug, and is the very purpose of Bluetooth Tools for most people.
To get it to activate Bluetooth ONLY when a call comes in, so as to enable the headset.
Instead of PERMANENTLY having to leave BT on, and thus flatten the battery.
i'm pretty sure mine does it when i make the clock grey aswell
Rudegar said:
i'm pretty sure mine does it when i make the clock grey aswell
Click to expand...
Click to collapse
Rudegar,
If you grey out the clock, you turn OFF the timed element of Bluetooth.
It will then depend on whether you have Bluetooth ON, or Bluetooth OFF as to what happens then...
All the clock does, AFAIK, is enable or disable timed bluetooth...?
Yep.. guess you right. It's working so good with the BT GPS receiver, I'll just sit and enjoy, and let it work for 60 seconds, each call I make.
Even when I turn the clock grey it still comes on !
OK I can live with the 60secs business, it'll save battery life.
But what is the purpose of the 2 battery indicators 1&2 ?? Can't seem to suss that out ?
ekko star said:
Even when I turn the clock grey it still comes on !
OK I can live with the 60secs business, it'll save battery life.
But what is the purpose of the 2 battery indicators 1&2 ?? Can't seem to suss that out ?
Click to expand...
Click to collapse
They are two different Profiles as it were.
It means you can configure settings as you prefer for one device/gps/headset, and then click icon 2 and set another lot, for a different device, then quickly change easily.
That info is from the Bluetooth Tools site, where it is all mentioned.
I don't wish to sound too rude, but it would be helpful if people seeking support would try reading the site where they download stuff from, or the original author's site, first...
http://bluetooth.i-networx.de/index_e.html
thanks for the help mate and thanks for telling me what it already says on that site.
My question is really how to configure those two settings ? I can't work out how I can set different settings for profile 2 nor how I can change 1 ?
ekko star said:
My question is really how to configure those two settings ? I can't work out how I can set different settings for profile 2 nor how I can change 1 ?
Click to expand...
Click to collapse
Well, it's dead simple (actually, was too simple for me to understand until someone pointed it out to me...): you tap on '1', so that it gets the little grey box around it. Then you use the normal settings dialogs of the PPC to configure things like backlight timeout, brightness etc. Then go back to the Today screen, tap on '2', and again configure your PPC. Now, each time you tap '1' or '2', the set of settings will be restored. Unfortunately, I couldn't find a list of which settings are actually subject to that toggle. I know that the backlight timing is, because that's what I use it for: while TomTom is running, I don't want the backlight to go out, so while '2' was actibe, I configured the backlight accordingly. Now '1' is my normal mode, and '2' is the "navigation" mode.
Cheers
Daniel

Widcomm Bt Stack On Wizard - Howto

Hi!
In the last some days i read a lot and found the following :
1. download the widcomm stack from axim site : LINK
2. install it + do a soft reset
3. get a registry edittor (Resco, CECMD etc.)
4. change these values :
[HKEY_LOCAL_MACHINE\Software\WIDCOMM\BtConfig\SerialTransport]
BaudRate=115200 (Won't start at higher rate.)
Device=COM
FlowControl=0
Parity=0
Port=1 (This is the most important thing!)
-soft reset
-at the today screen you will find a BT icon, click on it and have fun
TESTED FEATURES
-BT FTP, tested with : SE K750i, hx4700.
-ActiveSync : NOT WORKING
KNOWN ISSUES
-unable to control from comm manager
-blue led not flashing, easy to forget
-a2dp not tested
-tested on aku3.2 and aku2.3 roms, others maybe ok.
-other devices can't download bt services list, but the services works well.
-maybe unable to remove, not tested yet
-turns off, when you trun off your device, that maybe a problem with BT headset.
DO IT ON YOUR OWN RISK
Great news! Posted an announcement to the SP & Pocket PC Mag Expert Blog too!
Problems!!!
I've just installed the bluetoth stack in my phone. I've not yet tested it but i've found two showstop problems:
- activesync doesn't work anymore
- i cannot start the comm manager anymore (when i press the comm manager button in the upper left corner i can see only a small dialog with wifi and bluetooth power levels)
This is what i've done (maybe i did something wrong):
- copied the cab to storage and ran it (installed in device)
- soft-reset (required by the installer)
- edited the registry according to the first post
- soft-reset
I'm using an aku3.2 rom
-----EDIT--------------
Comm manager is working again. I had to reassociate it in Start-Settings-Buttons
Still no activesync (over USB at least)
bye
bye
Has anyone else tried this then? Has anyone tried the hermes cab install found in here...
http://forum.xda-developers.com/showthread.php?p=1072292#post1072292
There has been reports that it works on the trinity as well, so it may work on the Wizard.
Edit: No it doesn't. I have just ried it and it gives the memory error.
took the plunge and tried it
Bluetooth works and I can connect my itech S35 to it. The A2DP profile is detected and can connect... problem is, the signal is too weak to maintain a connection, in other words, I just heard 2 seconds of music and that's it... Another problem is my speakers now don't work... must do more reading...
It's hopeful though...
I am using a Dopdo838...
new2city said:
Bluetooth works and I can connect my itech S35 to it. The A2DP profile is detected and can connect... problem is, the signal is too weak to maintain a connection, in other words, I just heard 2 seconds of music and that's it... Another problem is my speakers now don't work... must do more reading...
It's hopeful though...
I am using a Dopdo838...
Click to expand...
Click to collapse
Did you try tweaking the BT params (for example, lowering the bit speed) to see whether it would work at lower bit speeds? See my related articles.
got look out for the links to your tips and tricks again
Hi Menneisyys,
Surrendered on Widcomm stack almost 2 months ago, now have to look again for the links for your tips and tricks for the Widcomm stack again...
Any idea on how to restore audio to my speakers... still dead at the moment... sigh... don't want to restore my back up yet...
i found that you don't really need to remove the shift* keys. if you already removed it, download the BTSpeedSwitcher from the download link, and set the speed to 921600bps. that may help.
Got it working fine
Thanks, but now I am a bit unclear, but will clear things up later. I used the speedswitcher as you suggested and but I had to disable audiogateway before it could work... now I am stuck as I put my wizard into standby and now it won't come back.... on... doh!
Well, one thing I can confirm, you can put it into standby and the bluetooth is still on.......
will feed back more when I get a clearer picture of what happened.... The sound quality is great..... just skipped for a second but is not back to normal again...
My wizard has now a nice quality A2DP sound without the high pitch noise...
went to http://forum.xda-developers.com/showthread.php?p=1073003&posted=1#post1073003
and used the files from Superdave... all is well now... look at my reply at the hermes thread.. Now I will just back up this "working configuration" and retry these settings on the cab from Aximsite... All the same, thanks to the legendary Mikelspikel
Just wanted A2DP to work so bad.... and it does now. nicely..
new2city said:
Got it working
Click to expand...
Click to collapse
Okay, when you get time can you stick up how you got it all working? Many Thanks!
Ive installed the Superdave BBS_HERMES_03.CAB file and then modified the registry to use the above settings but every time i do the soft reset, the registry settings go back to the original values. Im stuck here.
Oh and i am using the last T-Mobile UK rom. (2.0 i think)
Edit 2: Now got it working. I had to kill voicecmd and cprog for it to load without giving the memory issue!
new2city said:
you can put it into standby and the bluetooth is still on.......
Click to expand...
Click to collapse
as it should - BT is on on PPC PE devices in standby mode, unlike on plain PPC's.
peetking said:
-unable to control from comm manager
Click to expand...
Click to collapse
It looks like comm manager is just an HTML document in the /windows directory. (Should be simple to redirect the button)
Leaskovski
sorry for the late reply but had a few setbacks during the night(I am in Malaysia)..
Got A2DP running all night and by mid morning... suddenly all went to hell..
1) No skipping with your suggestion of using MikelSpikel's speed switcher.
2) While trying to put it to standby to test if BT still works and it hung at first attempt. Something must have happened here as I recovered using the reset button and then suddenly I could get it to revert back to built in speakers and headset without issue. I thought, cool, it is like complete solution...
And then, I decided to backup this "complete solution" with SPB backup.. and after the softreset, I lost the ability to switch between headset and speakers. Then during the night while I sleep and use the headset, at around 3 am... the skipping came back...
and then... I restored the backup and now... got to tackle the skipping again.. never mind the muted speakers..
What linespeed(I use 320 dec), Blocks(16) and subband(8) do you use? I followed MikelSpikel's settings which work ok... last night...
back to the drawing board..
Right, i installed the superdave 03 version and then opened up the registry to make sure the settings matched the ones above. I had to kill cprog and voicecmd to start it without the memory error.
I have tested it now and although it is loading up ok, my headset connection is just not working properly. Its paired ok but nothing is getting routed through. However, my gps bluetooth device paired okay and is working fine with iGO 2006 after doing a detection. Damn shame about this headset! I am using a parrott ck3000.
redo..
Re-installed everything again and now I got a working version, some things to note though on my wizard..
1) I must overclock to 260mhz(battery status method) before I get skip free music.
2) Leaskovski, I had the same problem too in the beginning, where there is no audio getting through. Did you go to Bluetooth Manager and check the status of your headset? i went to mine(ItechS35) and I can see that the Wizard is sending data through successfully but there is no sound coming out of the headset. I solved this(that time, I don't know why it worked but it did) by going to Bluetooth services and removing the Check box for audio gateway enabled, and then music started coming through. I know, does not sound logical but it worked... that time..
Now hoping to find a way to redirect audio back to speakers when bluetooth is not used..
not tonight though.. its 10.46 pm now where I am...
This doesn't look promising for how i though the BT audio might work with this stack. I was hoping for something like the following...
"A good example of this is MS Voise command running on the MS BT stack. The two devices are paired and connected, however there is currently no streaming. You then receive the text message and MS Voice command reads the message back to you. Just before the message is read, the connection between the devices is made live, and thus the message gets read over the BT headset."
I was hoping that this was going to work for all applications like media player and iGO. I can reproduce what it is doing at the moment using the BTAudio programme that is available on these boards. I just wanted to get around this 'constant' streaming of silent noise.
Damn shame.
Okay for anyone wanting to play with this, here is how i installed and got it running...
1) Download from this thread post http://forum.xda-developers.com/showpost.php?p=1072773&postcount=72 the file BBS_HERMES_03.zip.
2) Install onto your wizard and soft reset when asked. Upon the reset, the device will moan at you about not having enought memory to load the drivers. Click ok to close this.
3) Load up your registry editor (i use FDCSoft Task Manager) and make the following mods as stated in the first post...
[HKEY_LOCAL_MACHINE\Software\WIDCOMM\BtConfig\SerialTransport]
BaudRate=115200 (Won't start at higher rate.)
Port=1 (This is the most important thing!)
If you only want audio routed to headset when there is audio to route then make this reg edit...
[HKEY_LOCAL_MACHINE\Software\WIDCOMM\Plugins\handsfree]
Audiohandling=21
4) Do not do a soft reset yet.
5) Now fire up your Task Manager (i use FDCSoft Task Manager) and kill any memory hungry tasks. The ones i kill which then allow me to start the stack is voicecmd.exe and cprog.exe.
6) Now click on the BT icon in the system tray and turn BT on.
Obviously there must be some memory leaks some where in the wizard because a couple of people have said that later in the day, if you try to turn BT on again it wont start due to memory requirements. Anyway, the best thing i can think of is to leave BT on after you have turned it on.
Currently, the blue led will not flash when BT is one. Try not to use the Normal Comms Manager to turn BT one as well as i think this trys to turn the MS stack on which won't work (probably due to memory requirements! )
new2city said:
I solved this(that time, I don't know why it worked but it did) by going to Bluetooth services and removing the Check box for audio gateway enabled, and then music started coming through. I know, does not sound logical but it worked... that time..
Click to expand...
Click to collapse
I didnt get this to work in the end by the way.
I tried your idea to leave BT all the while but some problems pop up..
1) If turn off the headset without disconnecting it(BT still left on and the phone goes on standby, sometimes it won't come back.. a poke at the reset button is the only way..
2) I left BT on and disconnected the headset properly. Great BT is still on... BUT after a few hours, I can still connect the headset, but audio is not going there anymore... ??? but goes into internal speakers?
new2city said:
I tried your idea to leave BT all the while but some problems pop up..
1) If turn off the headset without disconnecting it(BT still left on and the phone goes on standby, sometimes it won't come back.. a poke at the reset button is the only way..
2) I left BT on and disconnected the headset properly. Great BT is still on... BUT after a few hours, I can still connect the headset, but audio is not going there anymore... ??? but goes into internal speakers?
Click to expand...
Click to collapse
Hmm, i dont have those issues. I am using it with my carkit, so when i turn the engine off and remove the keys, the kit turns off. I haven't had to reset the device apart from when i have turned BT off and then tried to turn it back on again at a later stage (then giving me the memory issue).

Zombie BA

hello every 1. I have a BA running windows mob 6.1 pro and everything is working fine except t e fact that when i put the device on standby, it is always turning itself on again. does this happen to anyone? thanks
hi
any test?what do mean?
Zero|Cool said:
hello every 1. I have a BA running windows mob 6.1 pro and everything is working fine except t e fact that when i put the device on standby, it is always turning itself on again. does this happen to anyone? thanks
Click to expand...
Click to collapse
which ROM do you have?
Do you happen to have BigMike bluetooth running?
standy..you mean you press the power button and the screen goes off, right? And then it turns on by itself? Did you check if your bluetooth is on? Because I experienced this too before, if I left the bluetooth on and I turn off (stand by) the BA after a while it will turn on itself. Hope this helps. Cheers.
Try going through your power management under settings.
You might have tick a few things there.
I was getting this trouble too!
As Resident evil... on nights my device wakes up and begins screaming STARS!!!!
I just call Claire redfield and Alice and they burn on its head! PUMMM!
jajajaj
Well... check out your settings if you have a program runing under... and it needs conections via BT, Wi-fi or GPRS... your device gonna wakes up trying to get conection all the ways it can... if nothing is runing behind maybe was a bad flash... reflash it...
Hope all we can help you...
We are like a squadron supporting forces... Huh im playing too much Acecombat 5....
It could either be Bluetooth running and also it could be some appointment/message turning your device on. Also, do you have your device cradled? ActiveSync (if connected to PC) will turn your device on to sync.
Hope this helps
red_hanks said:
standy..you mean you press the power button and the screen goes off, right? And then it turns on by itself? Did you check if your bluetooth is on? Because I experienced this too before, if I left the bluetooth on and I turn off (stand by) the BA after a while it will turn on itself. Hope this helps. Cheers.
Click to expand...
Click to collapse
It's exaclty that. I read somewhere it has something to do with the bluetooth stack, I turned off BT and it stopped lol However I need BT always on as I use an external sirf star 3 gps and I pair up the mobile phone with my car. Can anyone tell me how to fix this? Tks
Zero|Cool said:
It's exaclty that. I read somewhere it has something to do with the bluetooth stack, I turned off BT and it stopped lol However I need BT always on as I use an external sirf star 3 gps and I pair up the mobile phone with my car. Can anyone tell me how to fix this? Tks
Click to expand...
Click to collapse
There is no fix. Since WM5, the BT driver requires that it be turned on periodically or else it turns itself off. All ROM cookers (AFAIK) use the big mike fix driver to keep the BT alive.
motisu said:
There is no fix. Since WM5, the BT driver requires that it be turned on periodically or else it turns itself off. All ROM cookers (AFAIK) use the big mike fix driver to keep the BT alive.
Click to expand...
Click to collapse
I read somewhere that if you installed another BT stack that eventually it would solve the problem? Is this true?
ok there is fix but i do not advice you to use it if you use BT handsfree - because with original driver BT turns off when device get in standby and this one keeps it working
you can install S2U2 and set:
Lock when device wakes up: ON
Power Off in: 5s (this is the minimum).
this is not a solution, but more like a workaround...this works for me well...

Android 2.0 - Bluetooth shame!!!

Hello folks,
in the new Android 2.0 there's a limit on Bluetooth: you can't enable DISCOVERABLE mode without passing through an Android dialogbox and only for a limited period of time (max 300 seconds): SHAME!!! This means that for DUN connections (or similar) the user should press YES every 300 secs (on Droid probably there's a bug, only 120 secs are allowed).
The problem could be found on the GIT at line 758: the application requires the WRITE_SECURE_SETTINGS permission to run the setScanMode method, unfortunately not available at user level.
Hope this could be fixed for homebrew roms.
Cheers
I thought it had always been that way Isn't the limit there as a security measure? Oh well, thanks for pointing out a solution, should be interesting to see if this is adopted in to new ROMs.
Paragnosta said:
Hello folks,
in the new Android 2.0 there's a limit on Bluetooth: you can't enable DISCOVERABLE mode without passing through an Android dialogbox and only for a limited period of time (max 300 seconds): SHAME!!!
Click to expand...
Click to collapse
That is an EXCELLENT feature. Prevents the user from accidentally leaving it on, and thus vulnerable.
This means that for DUN connections (or similar) the user should press YES every 300 secs (on Droid probably there's a bug, only 120 secs are allowed).
Click to expand...
Click to collapse
INCORRECT. The host only needs to be discoverable when the connection is established. The connection, once established, can remain open for an unlimited amount of time.
lbcoder said:
That is an EXCELLENT feature. Prevents the user from accidentally leaving it on, and thus vulnerable.
Click to expand...
Click to collapse
Sorry, but this is not so excellent as you can think. It's OK when user enable the discoverable mode from the Android settings, fine and good. But if you want to create a background service always listening for incoming connections, simply you can't!!!
You must use a system dialogbox each time you wanna be discoverable and it's not so cool
One example? If you want, you can't receive proximity marketing messages, unless you KNOW when and where enable the discoverable mode. And if you want a public DUN service always discoverable by anyone? You can't!!!
IMHO, this is a great limit for developers, that's why the Bluetooth is dying...
Cheers
Paragnosta said:
Sorry, but this is not so excellent as you can think. It's OK when user enable the discoverable mode from the Android settings, fine and good. But if you want to create a background service always listening for incoming connections, simply you can't!!!
You must use a system dialogbox each time you wanna be discoverable and it's not so cool
One example? If you want, you can't receive proximity marketing messages, unless you KNOW when and where enable the discoverable mode. And if you want a public DUN service always discoverable by anyone? You can't!!!
IMHO, this is a great limit for developers, that's why the Bluetooth is dying...
Cheers
Click to expand...
Click to collapse
I have yet to meet anyone who WANTs to receive proximity marketing messages.
That's like WANTING spam in your inbox...
Or WANTING junk mail...
Or LOVING commercials...
Paragnosta said:
Sorry, but this is not so excellent as you can think. It's OK when user enable the discoverable mode from the Android settings, fine and good. But if you want to create a background service always listening for incoming connections, simply you can't!!!
Click to expand...
Click to collapse
It is a PHONE, not a server. If you are using the phone, then it is in YOUR HAND, which means you can click the button. And the use-case for a phone is that you use the PHONE to connect to OTHER DEVICES -- not the other way around!
You must use a system dialogbox each time you wanna be discoverable and it's not so cool
Click to expand...
Click to collapse
So? If the thing is always discoverable, what's to stop someone from hacking in? This is a necessary feature, and it doesn't interfere with appropriate use.
One example? If you want, you can't receive proximity marketing messages, unless you KNOW when and where enable the discoverable mode.
Click to expand...
Click to collapse
Again, the devices need to be paired ANYWAYS. You can't just bluetooth crap for fun and have everything receive it. BAD IDEA, DANGEROUS.
And marketing messages? As in ADVERTISEMENTS? Seems like a good thing to BLOCK AT ALL COSTS.
And if you want a public DUN service always discoverable by anyone? You can't!!!
Click to expand...
Click to collapse
Huh?
Again, it is a ***PHONE***. Not a server! You *DO NOT WANT THAT*.
IMHO, this is a great limit for developers, that's why the Bluetooth is dying...
Click to expand...
Click to collapse
No it isn't. It just prevents developers from doing things that they shouldn't be doing or have no legitimate reason to be doing.
Well, anyway you look at it, its a limitation put in place to protect people that don't know what they're doing at the expense of those who do.
Example:
I wanted to use KBlueLock (Locks the screen when bluetooth device disapears and [optionally] unlocks when it appears). I can't because the device won't stay discoverable. As soon as the timeout runs out, the screen is locked.
stormlabs said:
Well, anyway you look at it, its a limitation put in place to protect people that don't know what they're doing at the expense of those who do.
Example:
I wanted to use KBlueLock (Locks the screen when bluetooth device disapears and [optionally] unlocks when it appears). I can't because the device won't stay discoverable. As soon as the timeout runs out, the screen is locked.
Click to expand...
Click to collapse
Your phone doesn't need to be discoverable for your headset to remain visible to it, so either your description is wrong, or the problem that you perceive is unrelated to your guess about the cause.
lbcoder said:
Your phone doesn't need to be discoverable for your headset to remain visible to it, so either your description is wrong, or the problem that you perceive is unrelated to your guess about the cause.
Click to expand...
Click to collapse
I'm not talking about a headset. KBlueLock is part of KDE's bluetooth framework in Linux. It locks the screen when a certain BT device is no longer present.
You're assuming a pairing is required when it isn't. The mere presence (or not) of that device in a scan is enough.
Paragnosta said:
Hello folks,
in the new Android 2.0 there's a limit on Bluetooth: you can't enable DISCOVERABLE mode without passing through an Android dialogbox and only for a limited period of time (max 300 seconds): SHAME!!! This means that for DUN connections (or similar) the user should press YES every 300 secs (on Droid probably there's a bug, only 120 secs are allowed). ..........
Cheers
Click to expand...
Click to collapse
I second that. My bluetooth in my car and laptop would not automatically pair unless I have discoverable mode active. Its a hassle to always have to go to your bluetooth settings to activate that field EVERYTIME, otherwise it would not pair. They should have an option to have it turned on all the time. The user should have the freedom to choose! and not restrict them due to security issues.. i had blackberry's, and nokias, and had no problem with people trying to "hack" into my phone or whatever since my bluetooth was on all the time (and is automatically discoverable)
So in order for the phone to be on discoverable mode for a longer time, this would require editing the code for bluetooth right? Would this mean that the application will be rooted to the android platform? I am working on creating an app that allows bluetooth to be on discoverable mode all the time so perhaps with what the Bluetooth Adapter available to me right now in API 2.0, will prevent me from achieving this goal... Does anyone have code suggestions that can help me pass this obstacle? Below is what I have to make bluetooth discoverable for 300 seconds max. The Bluetooth Adapter prevents me from going beyond that time and also does not let me proceed to make bluetooth discoverable without user permission.
Intent discoverableIntent = new Intent(BluetoothAdapter.ACTION_REQUEST_DISCOVERABLE);
discoverableIntent.putExtra(BluetoothAdapter.EXTRA_DISCOVERABLE_DURATION, 300);
startActivity(discoverableIntent);
Thank you for your help in advance.
Sincerely,
AndroidTeam5
opinions opinions.. one man telling another man what they want and others telling others what they do and do not need.
The BOTTOM LINE is we should always have the option.. for example you MAY THINK (your opinion) that proximity marketing is like spam but freaking OBVIOUSLY SOMEONE WANTS IT he JUST SAID IT WOULD BE A GOOD THING... so damn everyone needs to take their opinions and leave..
You only post in this thread if you think it is useful.. not if you dont..
anyway proximity marketing would be good for example you are walking around a new area and you are really interested in what there is to eat around you.. and what deals they may have.. well you are walking down the street and BLING it tells you what the specials are..
Its funny cause everyone hates on spam and advertisments because we are always getting shown them when we are doing something else.. so its annoying.. but proximity marketing means that you turn that **** on when you are walking around interested in what the hell is available to you...
Bluetooth
I looked up more on Bluetooth and discover that I could perhaps use the NDK to make use of the Bluetooth Stack. Has anyone use Android Bluetooth using NDK? Is this recommended?
Thank you
AndroidTeam5

how to detect a bluetooth connection

hello,
i search a solution to detect a bluetooth connection, device is equal.
all what i found is getBondedDevices() from BluetoothAdapter, but pairing this is not a connection...
thanks 4 help
Solved!
i use ACTION_ACL_CONNECTED and ACTION_ACL_DICONNECTED from class BluetoothDevice.
Code:
getApplicationContext().registerReceiver(receiver,
new IntentFilter(BluetoothDevice.ACTION_ACL_CONNECTED));
getApplicationContext().registerReceiver(receiver,
new IntentFilter(BluetoothDevice.ACTION_ACL_DISCONNECTED));
Android-Wireless
Helo Sir,
How to switch On Bluetooth and Wireless programatically? Even i can't switch on bluetooth and wireless manually in android.
Emulator shows error.
dineshsubramanian said:
Helo Sir,
How to switch On Bluetooth and Wireless programatically? Even i can't switch on bluetooth and wireless manually in android.
Emulator shows error.
Click to expand...
Click to collapse
Emulator actualy dosn't support Bluetooth, WLan and GPS!
CodeFlatter said:
i use ACTION_ACL_CONNECTED and ACTION_ACL_DICONNECTED from class BluetoothDevice.
Code:
getApplicationContext().registerReceiver(receiver,
new IntentFilter(BluetoothDevice.ACTION_ACL_CONNECTED));
getApplicationContext().registerReceiver(receiver,
new IntentFilter(BluetoothDevice.ACTION_ACL_DISCONNECTED));
Click to expand...
Click to collapse
This only works if the device isn't yet connected. If the device is ALREADY connected when your app starts, how do you detect that, without starting a discovery?
been searching for a few days for an answer to this. Anyone got one?
Thanks
Scott
No one has any ideas on this? A month of searching has so far proven futile, but I can't believe it's not possible...
On the Google android developers site there is a complete example (a bluetooth chat).
http://developer.android.com/intl/de/resources
Hi!
I'm trying to connect my phone (HTC desire running Opendesire last update or HTC stock 2.2) to a serial to bluetooth converter module.
It seems to me that BluetoothChat sample is a good point to start as this application sends bytes over bluetooth.
That's just what i want to do: send some bytes from phone, receive some bytes from the module
I tried to run the Bluetoothchat sample on my phone:
Discovering and pairing the module is ok, but I'm unable to open a connection.
Anyone ever tried (and get success) to do same things as me?
Thank you.
Delvorak said:
This only works if the device isn't yet connected. If the device is ALREADY connected when your app starts, how do you detect that, without starting a discovery?
been searching for a few days for an answer to this. Anyone got one?
Thanks
Scott
Click to expand...
Click to collapse
Take a look at my SpeakerProximity Project => http://code.google.com/p/speakerproximity/
I faced the same problem and the solution that fitted the best was using BT connect/disconnect receivers that always get triggered and update a shared preference.
Hi,
I'm still having some issue with the bluetoothchat sample from sdk and bluetooth to serial converter module.
Now it works fine with AOSP rom but i'm still unable to make connection with HTC stock rom.
I've tried with a friend to run the application on a galaxy spica and we had the same issue. First the application didn't even start on spica and we had to change permissions to avoid Force Close.
Somebody knows what's wrong with bluetooth and HTC or Samsung?
Thank you
detecting bluetooth STATE_ON
in your OnStart() use :
mBluetoothAdapter = BluetoothAdapter.getDefaultAdapter();
if (mBluetoothAdapter != null) //if null device does not support bluetooth
{
if (mBluetoothAdapter.getState()==BluetoothAdapter.STATE_ON) {
//do stuff
}
}
I use a bluetooth listener for the STATUS_CHANGED event to check if BT is switched on.
If so, i enable my scanning avtivities, else i disable them.
Greetz,
Mike
STATE_ON is not the same as connected, though. (I think).
Personally, I've be having trouble figuring out the disconnect event to listen for, but I think the ACL one is what I need. Will try to remember to post back if I get it working. Damn WiFi process always interupts my transfers epecially when email decides it's time to sync.
Anyways, one tip for those having trouble with the BluetoothChat example is that for some reason you dont want to be listening for a connection at the same time as trying to make one. If you try the BluetoothChat example it actually almost always fails to connect. But if you make sure only one device is using listenforRfcomm... and the other is connecting, you'll connect fine.
The Spica thing is some bug with that phone specifically, though I think some people have solved it with some type of strange method reflection. Check stackoverflow for spica/bluetooth.
Just an update for my problem the ACL braodcasts were just what I was looking for though the diconnect broadcast is sometimes very slow to trigger.

Categories

Resources