Android Tutorial Android Bluetooth / BluetoothAdmin Tutorial

Status
Not open for further replies.

Scantech

Well-Known Member
Licensed User
Longtime User
Are you sure that there are no bluetooth devices near you?

The DeviceFound event is raised as a result of the native API. It will only add devices reported by the OS.
I will do some more investigating. I was in the apartment when I did a search. Not Sure how many other Bluetooth devices are around me. When Away from the apartments it is working properly.
 
Last edited:

techknight

Well-Known Member
Licensed User
Longtime User
Why they would put that in the locations permission is completely asinine, because this could lead into a false sense of "insecurity" when installing an app and someone actually looks at the permissions. "Why does it need to know my location?" phrase... GRRR google....

Anyways... Can someone try on Android M if location is disabled, if BT discovery still works?
 

DavideV

Active Member
Licensed User
Longtime User

I agree with you about the permissions, too much for bluetooth discovery in my opinion.
Could be for ibeacon?
isn't it a sort of bluetooth localization?
 

Mitesh_Shah

Member
Licensed User
Longtime User
HI CAN ANY ONE TRY IN NEW ANDROID OS 6.0 ?

I AM TRY IT IN MY LENOVO K3 NOTE PHONE - ANDROID 6.0 IT'S NOT WORKING. GETTING ERROR DEVICE NOT FOUND

BUT IT'S WORK IN KITKAT AND LOLLIPOP Version

REGARD

MITESH
 

Mitesh_Shah

Member
Licensed User
Longtime User
HI Erel

I m add >>android.permission.ACCESS_COARSE_LOCATION to Region Module Attributes but, getting Compiling Error.

Parsing code. Error
Error parsing program.
Error description: Attribute not supported: android
Occurred on line: 10
#Androidermission.ACCESS_COARSE_LOCATION
 

red30

Well-Known Member
Licensed User
Longtime User
I use your example. The data is transmitted. Not working reception ... What am I doing wrong?
B4X:
#Region Module Attributes
    #FullScreen: False
    #IncludeTitle: True
#End Region

'Activity module
Sub Process_Globals
    Dim AStream As AsyncStreams
    Dim bc As ByteConverter
End Sub

Sub Globals
    Dim readings As EditText
    Dim label1 As Label


End Sub

Sub Activity_Create(FirstTime As Boolean)
    Activity.LoadLayout("2")
    readings.Color = Colors.black
    If AStream.IsInitialized = False Then
        'AStream.InitializePrefix(Main.serial1.InputStream, True, Main.serial1.OutputStream, "AStream")
        AStream.Initialize(Main.Serial1.InputStream, Main.Serial1.OutputStream, "AStreams")
    End If
End Sub

Sub AStreams_NewData (Buffer() As Byte)
    readings.Text=Buffer
    label1.Text=("Data: " & bc.HexFromBytes(Buffer))
End Sub

Sub AStream_Error
    ToastMessageShow("Connection is broken.", True)
End Sub

Sub AStream_Terminated
    AStream_Error
End Sub

Sub Activity_Resume
  
End Sub

Sub Activity_Pause (UserClosed As Boolean)
    If UserClosed Then
        AStream.Close
    End If
End Sub

Sub LightOn_Click
    AStream.Write(Array As Byte(0x00,0x05,0x3f))
End Sub
 
Status
Not open for further replies.
Cookies are required to use this site. You must accept them to continue using the site. Learn more…