bluetooth in apk-file

Ask, and ye shall receive.
brasay
Posts: 4
Joined: 13:23, 13 Mar 2015

bluetooth in apk-file

Postby brasay » 13:33, 13 Mar 2015

Hi,

I have tested the relaxation application with the suggested cordova plugin by using the evothings workbench, and when the app is launched from the workbench it works perfectly fine.

Today I tried to package that application in an apk-file by using cordova. When I install the app it asks for the bluetooth permissions as it should, but when I run the application, it doesn't detect any of the beacons.

Any ideas why the beacons are not detected when the app is packaged in an apk file?

Thanks in advance

alex
Posts: 92
Joined: 00:59, 19 Nov 2013

Re: bluetooth in apk-file

Postby alex » 08:43, 14 Mar 2015

Hi!

Did you add the plugin to your Cordova projekt beror buildning, using the Cordova CLI?

Code: Select all

   $ cordova plugin add https://github.com/evothings/cordova-ble.git   

brasay
Posts: 4
Joined: 13:23, 13 Mar 2015

Re: bluetooth in apk-file

Postby brasay » 12:02, 14 Mar 2015

alex wrote:Hi!

Did you add the plugin to your Cordova projekt beror buildning, using the Cordova CLI?

Code: Select all

   $ cordova plugin add https://github.com/evothings/cordova-ble.git   


Yes, I tried making the apk by also adding the plugin you said, but still nothing happens when I launch the app. I'm using cordova 4.2.0, could that be the reason that it doesn't work?

EDIT*

I downgraded my cordova version to 3.6.3-0.2.12 & installed the following plugins:

com.unarin.cordova.beacon
pl.makingwaves.estimotebeacons
com.megster.cordova.bluetoothserial
com.evothings.ble

Still no beacons get detected, how do i make them work in a standalone app?

User avatar
micke
Posts: 256
Joined: 20:49, 18 Nov 2013

Re: bluetooth in apk-file

Postby micke » 14:59, 15 Mar 2015

Hi brasay,

I will make a test and build a stand-alone app and see how it works. For iBeacon access the only plugin needed should be com.unarin.cordova.beacon.

Let me get back tomorrow or so.

Best, Mikael

brasay
Posts: 4
Joined: 13:23, 13 Mar 2015

Re: bluetooth in apk-file

Postby brasay » 09:49, 16 Mar 2015

micke wrote:Hi brasay,

I will make a test and build a stand-alone app and see how it works. For iBeacon access the only plugin needed should be com.unarin.cordova.beacon.

Let me get back tomorrow or so.

Best, Mikael


Hi,

I've tried to package the ibeacon-scan application by using cordova with the com.unarin.cordova.beacon plugin and it works perfectly in a standalone application. For some reason the relaxation app doesn't want to work in a standalone application.

Could it be that the code of the relaxation app is somewhat outdated and that would be the reason that it doesn't want to work? I would like to use the relaxation app in a standalone application to demonstrate the possibilities of iBeacons but I don't know why it doesn't want to work.

Thanks in advance.

brasay
Posts: 4
Joined: 13:23, 13 Mar 2015

Re: bluetooth in apk-file

Postby brasay » 11:37, 16 Mar 2015

Hi,

I fixed the problem. The problem was indeed the code of the relaxation app that was outdated.

I changed the following lines:

Code: Select all

var delegate = locationManager.delegate.implement(
   {
      didDetermineStateForRegion: function(pluginResult)
      {
         //console.log('didDetermineStateForRegion: ' + JSON.stringify(pluginResult))
      },

      didStartMonitoringForRegion: function(pluginResult)
      {
         //console.log('didStartMonitoringForRegion:' + JSON.stringify(pluginResult))
      },

      didRangeBeaconsInRegion: function(pluginResult)
      {
         //console.log('didRangeBeaconsInRegion: ' + JSON.stringify(pluginResult))
         app.didRangeBeaconsInRegion(pluginResult)
      }

To:

Code: Select all

var delegate = new locationManager.Delegate();
   
      delegate.didDetermineStateForRegion= function(pluginResult)
      {
         //console.log('didDetermineStateForRegion: ' + JSON.stringify(pluginResult))
      },

      delegate.didStartMonitoringForRegion= function(pluginResult)
      {
         //console.log('didStartMonitoringForRegion:' + JSON.stringify(pluginResult))
      },

      delegate.didRangeBeaconsInRegion= function(pluginResult)
      {
         //console.log('didRangeBeaconsInRegion: ' + JSON.stringify(pluginResult))
         app.didRangeBeaconsInRegion(pluginResult)
      }
   

User avatar
micke
Posts: 256
Joined: 20:49, 18 Nov 2013

Re: bluetooth in apk-file

Postby micke » 22:14, 18 Mar 2015

Glad to hear you fixed the problem! Great work finding the outdated code!

Sorry for this, I should not have old code around like that.

Best regards, Micke


Return to “Questions and answers”

Who is online

Users browsing this forum: No registered users and 43 guests