0

Flash Builder を使用して、Android Phone 用のモバイル アプリケーションを作成しています。Bluetooth(ON/OFF)を確認し、OFFの場合は有効にできるかどうか知りたいです。インターネットを使用して以下に示す接続を確認していますが、Bluetooth チェックの有効化と他のデバイスとのペアリングも使用したいと考えています。助けてください!!

<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();
    }
]]>

4

1 に答える 1

0

これは Flash Builder に関する質問ではなく、AIR に関する質問です。たぶん、この他の質問があなたを導くことができます: Bluetooth Android - adobe Air

于 2013-05-15T22:15:14.513 に答える