{ "id": "169156", "key": "AC-5109", "fields": { "issuetype": { "id": "1", "description": "A problem which impairs or prevents the functions of the product.", "name": "Bug", "subtask": false }, "project": { "id": "12217", "key": "AC", "name": "Appcelerator - INBOX", "projectCategory": { "id": "10000", "description": "", "name": "Customer Service" } }, "resolution": { "id": "1", "description": "A fix for this issue is checked into the tree and tested.", "name": "Fixed" }, "resolutiondate": "2017-09-26T16:59:57.000+0000", "created": "2017-07-27T20:21:10.000+0000", "labels": [ "android", "bluetooth", "hyperloop" ], "versions": [ { "id": "17038", "name": "Appcelerator Studio 4.5.0", "archived": false, "released": false } ], "issuelinks": [], "assignee": { "name": "shossain", "key": "shossain", "displayName": "Shak Hossain", "active": false, "timeZone": "America/Los_Angeles" }, "updated": "2017-09-26T16:59:57.000+0000", "status": { "description": "The issue is considered finished, the resolution is correct. Issues which are closed can be reopened.", "name": "Closed", "id": "6", "statusCategory": { "id": 3, "key": "done", "colorName": "green", "name": "Done" } }, "components": [ { "id": "15000", "name": "Hyperloop" } ], "description": "I've been trying to implement a simple Bluetooth module using Hyperloop and I've had problems with some BluetoothAdapter Methods.\r\n\r\nI'm doing a commonjs module to handle bluetooth stuff on my app, but i'll post only the specific parts that are giving me errors:\r\n\r\nvar BluetoothManager = require('android.bluetooth.BluetoothManager');\r\nvar currentActivity = new Activity(Ti.Android.currentActivity);\r\nvar Context = require('android.content.Context');\r\n\r\nvar _BluetoothManager = BluetoothManager.cast(currentActivity.getSystemService(Context.BLUETOOTH_SERVICE));\r\nvar BluetoothAdapter = _BluetoothManager.getAdapter();\r\n\r\nWhen I try to create BluetoothServerSocket it gives me this error:\r\nvar BluetoothServerSocket = BluetoothAdapter.listenUsingRfcommWithServiceRecord('TEST', '27bc60d4-366d-c8e4-27ad-106117e6fbaf');\r\n\r\n[ERROR] : HyperloopProxy: (main) [16911,16911] Unable to resolve method call. Class: android.bluetooth.BluetoothAdapter, method name: listenUsingRfcommWithServiceRecord, args: ['TEST', '27bc60d4-366d-c8e4-27ad-106117e6fbaf'].\r\n\r\nI've also try with this method(listenUsingInsecureRfcommWithServiceRecord), with no success.\r\nI'm following the Bluetooth Adapter spec https://developer.android.com/reference/android/bluetooth/BluetoothAdapter.html, but maybe I'm missing something.\r\n\r\nThx for your time!", "attachment": [], "flagged": false, "summary": "[Hyperloop] Problem calling listenUsingRfcommWithServiceRecord from Bluetooth Adapter", "creator": { "name": "dnlmartinezfernandez", "key": "dnlmartinezfernandez", "displayName": "Daniel Martinez Fernandez", "active": true, "timeZone": "America/Mexico_City" }, "subtasks": [], "reporter": { "name": "dnlmartinezfernandez", "key": "dnlmartinezfernandez", "displayName": "Daniel Martinez Fernandez", "active": true, "timeZone": "America/Mexico_City" }, "environment": "OSX El Capitan 10.11.16\r\nDevice:\r\nAndroid OS Lollipop Version: 5.0\r\nTitanium SDK: 6.0.3GA\r\nHyperloop: Don't know exactly what version", "comment": { "comments": [ { "id": "425001", "author": { "name": "dnlmartinezfernandez", "key": "dnlmartinezfernandez", "displayName": "Daniel Martinez Fernandez", "active": true, "timeZone": "America/Mexico_City" }, "body": "It seems I made a mistake for posting this on appcelerator project instead of Titanium, but I don't seem to have the permission to create a bug on Titanium project.\r\nCan you help me moving the issue to the correct project, or, if it's not possible, helping me with my account so I can post this on TIMOB.\r\nThx!", "updateAuthor": { "name": "dnlmartinezfernandez", "key": "dnlmartinezfernandez", "displayName": "Daniel Martinez Fernandez", "active": true, "timeZone": "America/Mexico_City" }, "created": "2017-07-27T22:03:20.000+0000", "updated": "2017-07-27T22:03:20.000+0000" }, { "id": "425105", "author": { "name": "sdarda", "key": "sdarda", "displayName": "Sharif AbuDarda", "active": false, "timeZone": "Asia/Dhaka" }, "body": "Hello, Please try with the latest SDK 6.1.0.GA and latest Hyperloop 2.1.2. version. Thanks.", "updateAuthor": { "name": "sdarda", "key": "sdarda", "displayName": "Sharif AbuDarda", "active": false, "timeZone": "Asia/Dhaka" }, "created": "2017-07-31T17:35:20.000+0000", "updated": "2017-07-31T17:35:20.000+0000" }, { "id": "425409", "author": { "name": "jvennemann", "key": "jvennemann", "displayName": "Jan Vennemann", "active": true, "timeZone": "Europe/Berlin" }, "body": "[~dnlmartinezfernandez], the signature is {{listenUsingRfcommWithServiceRecord (String name, UUID uuid)}} but you are passing two strings, which might be the issue why it can't find the method. Try this:\r\n\r\n{code}\r\nvar UUID = require('java.util.UUID');\r\nvar bluetoothServerSocket = BluetoothAdapter.listenUsingRfcommWithServiceRecord('TEST', UUID.fromString('27bc60d4-366d-c8e4-27ad-106117e6fbaf');\r\n{code}", "updateAuthor": { "name": "jvennemann", "key": "jvennemann", "displayName": "Jan Vennemann", "active": true, "timeZone": "Europe/Berlin" }, "created": "2017-08-03T16:00:09.000+0000", "updated": "2017-08-03T16:00:09.000+0000" }, { "id": "427373", "author": { "name": "sdarda", "key": "sdarda", "displayName": "Sharif AbuDarda", "active": false, "timeZone": "Asia/Dhaka" }, "body": "Hello [~dnlmartinezfernandez], Is your issue resolved? please get back to us. Thanks.", "updateAuthor": { "name": "sdarda", "key": "sdarda", "displayName": "Sharif AbuDarda", "active": false, "timeZone": "Asia/Dhaka" }, "created": "2017-08-29T19:35:40.000+0000", "updated": "2017-08-29T19:35:40.000+0000" }, { "id": "427384", "author": { "name": "dnlmartinezfernandez", "key": "dnlmartinezfernandez", "displayName": "Daniel Martinez Fernandez", "active": true, "timeZone": "America/Mexico_City" }, "body": "Hello, sorry for the late response, I forgot to test this as I resolved the bluetooth issue making an android module. \r\nI just tested @Jan Vennemann solution and it's working now, need to pay more attention on those parameter types :S.\r\nThank you for your help!", "updateAuthor": { "name": "dnlmartinezfernandez", "key": "dnlmartinezfernandez", "displayName": "Daniel Martinez Fernandez", "active": true, "timeZone": "America/Mexico_City" }, "created": "2017-08-29T22:32:20.000+0000", "updated": "2017-08-29T22:32:20.000+0000" } ], "maxResults": 5, "total": 5, "startAt": 0 } } }