0

I'm using Flash Builder to build a mobile application for Android Phones. I would like to know if it is possible to check for Bluetooth (ON/OFF) and enable it if it is OFF. I'm using the internet to check for connection that shows below but I also want to use Bluetooth check activation and pair to other devices. Please Help!!

<fx:Script>
<![CDATA[
    import air.net.URLMonitor;
    import mx.managers.PopUpManager;
    import views.BloodVialsHomeView;
    private var monitor:URLMonitor;
    [Bindable] private var isConnected:Boolean;
    protected function init():void {
        monitor = new URLMonitor(new URLRequest("http://google.com/"));
        monitor.addEventListener(StatusEvent.STATUS, checkConnection);
        monitor.start();
    }
    private function checkConnection(e:StatusEvent):void {
        connectionIndicator.currentState = monitor.available ? "connectionOn" : "connectionOff";
        if(!monitor.available){
            openAlert();
        }
    }

    private function openAlert():void {
        mobileAlert.open(this, true);
        PopUpManager.centerPopUp(mobileAlert);
    }

    public function exitApp():void {
        NativeApplication.nativeApplication.exit();
    }
]]>

TCO
  • 167
  • 1
  • 8

1 Answers1

0

This is not so much a Flash Builder question as an AIR one. Maybe this other question can orient you: Bluetooth Android - adobe Air

Community
  • 1
  • 1
Luis
  • 1,235
  • 1
  • 12
  • 12
  • actually this one has more information http://stackoverflow.com/questions/5055768/is-there-a-way-to-access-bluetooth-on-android-via-adobe-air – Luis May 15 '13 at 22:16
  • I'm new to flash builder. How do you integrate the adobe Air with flash builder? So it can turn Bluetooth ON/OFF. I'll appreciate your help very much. Thank you. – TCO May 16 '13 at 01:14
  • @TCO "Native extensions" provide functionality not included in AIR for your target platform. You create or get one, package and deploy it with your AIR application, and call it at runtime. I haven't done on that on Android, so I cannot really assist on that part. – Luis May 16 '13 at 01:25
  • Thank you Luis. Your information is very helpful. Do you know anyone that familiar with this native extension? I have an other question maybe you can answer it. Do you know how to run flash animations in flash builder without creating flash project? Only use a flash container or components to integrate animations in flash builder.. Help please... – TCO May 16 '13 at 02:48
  • @TCO That is better answered in a separate question, and I'm sure it has been done already. Search around. – Luis May 16 '13 at 14:03