App has multiple pages. In one page, bluetooth connection will be established to the HC-05 and send a single letter as a text to Arduino. when we navigate between pages, each time when we land on bluetooth page, by clicking connect button will connect and send the data to Arduino which is working fine .AIA version but when I build as .APK version, it works only for the very 1st time and 2nd time onwards it gives me error 507. i tried connecting using connect address block as well. It says available , picks the address but not establishing the connection. Any help would be very appreciated
Bluetooth is not connecting in .apk version but works in .aia version when navigating between the pages
By 'pages', I think you mean Screens.
BlueTooth will disconnect when you change screen.
So use virtual screens (show and hide vertical arrangements) in one real screen, the bluetooth will not disconnect.
To back-up Kevin's recommendation:
When we define virtual screens, we use one 'real' App Inventor Screen (most often Screen1). Screen-sized Vertical Arrangements on it are displayed/hidden as required - they are the Virtual Screens. This is generally a better approach for multi-screen Apps, they share data without having to "pass" it between screens and it also reduces code duplication, making the App more efficient and the code easier to follow if you have to return to it at a later date.
So, instead of separate "houses", virtual screens are "rooms" of the same "house".
Thank you both. Virtual screen helped me and I am able to connect to Bluetooth Successfully.
This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.