2016년 12월 15일 목요일

Send a bluetooth-signal from a second screen


I have an App Inventor programm with 2 screens. From the first screen I send BT-signals and it works well. Now I want to send other BT-signals to the same source from the screen two by click on an button. How can I put a relation to the BT- component defined as a Non-Visible-Component on screen one?

-- 
use only one screen, else for bluetooth you have to reconnect in other screens, which does not make much sense

Use different screens wisely
Before starting to create another screen, first you should think about is it really necessary? See also Building apps with many screens and SteveJG's post about advantages/disadvantagesbecause in only one screen you also can use vertical arrangements to simulate different screens, just set the arrangements to visible = true/false as needed... See also Martyn_HK's example about how to use Tabs in AppInventor and another example from Cyd

-- 
thanks for your important hints. It were new information for me and this is a sentence I read at one of the links:

All this, of course, comes at the price of increased program complexity in the blocks that handle the view switching -- it’s much simpler to add a new screen for each new view and not have to worry about view switching logic.  You can work that way for small numbers of screens. 

My App will only get 2 screens and I would like to learn the procedure to realise my question.
So it would be nice, if you tell me something to this solution.


-- 
As far as I know, BT only works from Screen1

-- 
This is very simple Freddy.  The Bluetooth component will work correctly only from ONE screen.  If a developer uses multiple screens and uses Bluetooth to control a device from screen A and the app switches to screen B, the app will lose the Bluetooth pairing connection.  This is the way the AI2 Bluetooth object works.  All Developers must program around this limitation if they do not want to lose a connection.  The programming SOLUTION is to not use multiple screens if your app uses a Bluetooth connection.  You are correct that switching screens can work efficiently for a small number of screens if a developer does not use the Bluetooth component or is willing to pass data between screens using a TinyDB.

-- 

댓글 없음:

댓글 쓰기