# Bluetooth Serial Problem with ionic

**URL:** <https://forum.ionicframework.com/t/bluetooth-serial-problem-with-ionic/20128>\
**Category:** ionic-v1\
**Created:** [April 1, 2015, 7:22pm UTC](https://forum.ionicframework.com/t/bluetooth-serial-problem-with-ionic/20128 "2015-04-01T19:22:12Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![gereksizcoder](https://avatars.discourse-cdn.com/v4/letter/g/8e8cbc/32.png) [@gereksizcoder](https://forum.ionicframework.com/u/gereksizcoder)\
**Post date:** [April 1, 2015, 7:22pm UTC](https://forum.ionicframework.com/t/bluetooth-serial-problem-with-ionic/20128/1 "2015-04-01T19:22:12Z")

</div>

I m trying to build bluetooth application firstly android using latest ionic framework and cordova. I created blank app

but its not working. its causes crash. I cannot find bluetoothserial in ngCordova. someone have exampe with this plugin.  
I used this plugin.

> **[don/BluetoothSerial](https://github.com/don/BluetoothSerial)**
>
> BluetoothSerial - Cordova (PhoneGap) Plugin for Serial Communication over Bluetooth

  
my app.js

```
   // Ionic Starter App

 // angular.module is a global place for creating, registering and retrieving Angular modules
// 'starter' is the name of this angular module example (also set in a <body> attribute in index.html)
// the 2nd parameter is an array of 'requires'
 angular.module('starter', ['ionic'])

.run(function($ionicPlatform) {
   $ionicPlatform.ready(function() {
    // Hide the accessory bar by default (remove this to show the accessory bar above the keyboard
     // for form inputs)
   if(window.cordova && window.cordova.plugins.Keyboard) {
     cordova.plugins.Keyboard.hideKeyboardAccessoryBar(true);
  }
if(window.StatusBar) {
  StatusBar.styleDefault();
}
 });
} ).controller("MainCtrl",function($scope){
    $scope.bluetoothEnable="Test";
    var listPorts = function() {
        // list the available BT ports:
        bluetoothSerial.list(
            function(results) {
              alert(JSON.stringify(results));
            },
            function(error) {
                alert(JSON.stringify(error));
            }
        );
    }

    // if isEnabled returns failure, this function is called:
    var notEnabled = function() {
        alert("Bluetooth is not enabled.")
    }

    // check if Bluetooth is on:
    bluetoothSerial.isEnabled(
        listPorts,
        notEnabled
    );

});
```

---

<div class="post-metadata">

**Author:** ![ysrael](https://avatars.discourse-cdn.com/v4/letter/y/ea5d25/32.png) [@ysrael](https://forum.ionicframework.com/u/ysrael)\
**Post date:** [April 1, 2015, 11:38pm UTC](https://forum.ionicframework.com/t/bluetooth-serial-problem-with-ionic/20128/2 "2015-04-01T23:38:17Z")

</div>

It is on ngCordova just undocumented unfortunately

[http://ngcordova.com/build/](http://ngcordova.com/build/)

---

<div class="post-metadata">

**Author:** ![gereksizcoder](https://avatars.discourse-cdn.com/v4/letter/g/8e8cbc/32.png) [@gereksizcoder](https://forum.ionicframework.com/u/gereksizcoder)\
**Post date:** [April 2, 2015, 8:05am UTC](https://forum.ionicframework.com/t/bluetooth-serial-problem-with-ionic/20128/3 "2015-04-02T08:05:06Z")

</div>

thank you man .I will try 😄
