Android Question Serial Library

LewJ

New Member
Licensed User
Hi,I'm new to 4BX so very much in the learning curve.
I created an app based on the BT tutorial and all worked fine, communicating with a PIC uP.
Then, I tried using the same code using B4XPages. I cannot get it to work. The error I get is at this line of code" PairedDevices = Serial1.GetPairedDevices"
So, my question is, can an app created using 4BXPages use the Serial library and connect with BT, or does one have to create a new app using the Default option?
I hope I've explained OK :)
Thanks in anticipation for any assistance to be pointed in the right direction,
Lew
 

agraham

Expert
Licensed User
Longtime User
There is nothing magic about a B4XPages app. It is just a normal app with a single activity that uses an Android setting to keep that activity running when in the background so avoiding dealing with the complications of the Android Activity life-cycle, so yes it should work.

It would help if you post the error message rather than just saying an error occurred.
 
Upvote 0

jkhazraji

Active Member
Licensed User
Longtime User
Hi,I'm new to 4BX so very much in the learning curve.
I created an app based on the BT tutorial and all worked fine, communicating with a PIC uP.
Then, I tried using the same code using B4XPages. I cannot get it to work. The error I get is at this line of code" PairedDevices = Serial1.GetPairedDevices"
So, my question is, can an app created using 4BXPages use the Serial library and connect with BT, or does one have to create a new app using the Default option?
I hope I've explained OK :)
Thanks in anticipation for any assistance to be pointed in the right direction,
Lew
 
Upvote 0

LewJ

New Member
Licensed User
Thank you very much for the replies, a great help.
After changing a few names (Activity to B4XPages) and a few minor code adjustments it almost worked. Then, I stood up and kicked my butt when I saw the glaring mistake...I had left out the Serial Initialization line of code! Caught out by a basic copy-and-paste mistake.
Well that mistake certainly assisted my learning curve, I picked up a lot through getting it resolved.
Thanks once more, regards,
Lew.
 
Upvote 0
Top