Android Question NFC communicate between two devices.

yaqoob

Active Member
Licensed User
Longtime User
Hello everyone

Is there is an NFC library that allows communicating between two devices?
 

DonManfred

Expert
Licensed User
Longtime User
Not that i know of. It is something you have to build by yourself.
 
Upvote 0

yaqoob

Active Member
Licensed User
Longtime User
Hello,
I follow Erel's instructions, but it seems something is not working. For example, I am using the following code. The application displays "Message transferred," but nothing happens on the receiver's mobile side. Any suggestion?

MobileToMobil:
Sub Process_Globals
    'These global variables will be declared once when the application starts.
    'These variables can be accessed from all modules.
    'Private xui As XUI
    'Private LastIntent As Intent
    
End Sub

Sub Globals
    'These global variables will be redeclared each time the activity is created.
    
    Private nfc As NFC
End Sub

Sub Activity_Create(FirstTime As Boolean)
    
    
    ToastMessageShow("Please make sure the device is close", True)
    nfc.PreparePushMessage("nfc")
    
End Sub

Sub nfc_CreateMessage As List
    
    
    ToastMessageShow("Message transfred", True)
    Return Array (nfc.CreateUriRecord("https://www.b4x.com"))

End Sub

Sub Activity_Resume

End Sub

Sub Activity_Pause (UserClosed As Boolean)

End Sub
 

Attachments

  • MobileToMobile.zip
    2.3 KB · Views: 142
Upvote 0

yaqoob

Active Member
Licensed User
Longtime User
Start with the Beam example. Does it work for you?

Your code is missing several parts.
Sorry for the late reply. I had to get another mobile to check the application. No, the beam application does not work between 2 mobiles.
 
Upvote 0

Blueforcer

Well-Known Member
Licensed User
Longtime User
Same here.
installed the android beam example without modification on a Andorid 11 and a Android 12 device.
They vibrate when holding together, but nothing happens.

Edit:
I just read that android beam was already discontinued years ago. Only a few manufacture build this into their OS. with android 14 android Beam disappears completely.

 
Last edited:
Upvote 0
Top