2017년 3월 22일 수요일

Need to know how to understand the component in the anythin list


who can explain how I can understand the component thing in the blocks at the anythinglist? For example, if I have a tinydb and there is a block with .getvalue/for component/tag. What is meant with this component?

--
the advanced blocks for TInyDB do not really make sense, because there is only one TinyDB in your app, see also http://ai2.appinventor.mit.edu/reference/components/storage.html#TinyDB

Each app has its own data store. There is only one data store per app. Even if you have multiple TinyDB components, they will use the same data store. To get the effect of separate stores, use different keys. You cannot use the TinyDB to pass data between two different apps on the phone, although you can use the TinyDB to share data between the different screens of a multi-screen app

generally

-- 
Thanks for you post but that was not the answer I am searching for. You have a component not only with db. You have this in everything in the anything list and I want to understand what I have to put in the component freespace and what consequences it has.

-- 

 I want to understand what I have to put in the component freespace
it seems to be, you forgot to take a look at the provided links

-- 
Short answer - 
The component blocks are always the last blocks in the Blocks Palette for each component you use.

You use them mostly for when you want to treat a bunch of similar components alike.

-- 
Thank you. So if I understood right, this is just used, if I had more components for example buttons, whom I wanted to get a feedback. I have asked because I want to create an storing app. I will have a list with as many list as the user wanted. Further the user should scan for example a product and the user enters 4 facts. And everytime, when I am thinking or hoping, that my thoughts should be right, the program is not my opinion :(

-- 
May be this example will help you understand better:

Here we have 4 buttons that acts as switches. If one of those buttons is touched, it should change its color depending on the actual color (if it's red, turn green, if it's green, turn red).
Also there's two "master" switches. One turns all the other buttons green. The other turns all the buttons red.
Start from the beginning, and go step by step to understand how the "Any" blocks works. It's easier than it looks, really.


-- 

 I want to create an storing app. I will have a list with as many list as the user wanted. Further the user should scan for example a product and the user enters 4 facts.
When some one asks for a variable number of buttons for selecting data,

they need to learn lists and TinyDB.

and look for the AI2 tutorials that cover lists, Fusion Tables, and TinyDB.

-- 


the Lists and TinyDB sections of this FAQ


Bluetooth problem


my app as created for arduino.
My problem is bluetooth , i have to connect and disconnect automatically the bluetooth with press button the my app
Example

I press the light button, you must connect to the bluetooth, switch on the light or disconnect bluetooth

--
what exactly is your problem?
have you seen

-- 
My problem is , connect and disconnect Bluetooth when press buttons in my app. Example
Press button light garage
connect Bluetooth 
On or off light garage
Disconnect bluetooth.

Press button lighr kitchen
Connect Bluetooth 
On or off light kitchen
Disconnect Bluetooth 

In automatic this operation 

Now my app, connect forever a Bluetooth.
This because Bluetooth accept one device at a time , I connect a Bluetooth six device

-- 
It would really help if you provided a screenshot of your relevant blocks, so we can see what you are trying to do, and where the problem may be.

-- 
ok my blocks

push buttons.... when Bar. click , when soffusa .click ecc....
my app connect bluetooth , run the function and disconnect bluetooth

now push buttons
my app run the function .....STOP :-(

Immagine.jpg 표시 중

-- 
as far as I understand you want to toggle the light switch
what about sending only one command to the other device and there add some logic like this

if light = on  
then set light to off
else set light to on

-- 
No, my problem not light on / off, but Bluetooth connect / disconnect

--
you already connect automatically in Screen.Initialize
you also can send something after connecting, just add a SendText block in the Screen.Initialize event and after that a Disconnect method and probably a close application block...

-- 
Your kitchen and garage are different devices with different connection strings?

That sounds like you have to start the connection from the button Click event,
save in a global variable a reminder of what you wanted to talk to and what you
wanted to say to it when the connection is complete, then after the connection is complete
(a timer?) send the command on that connection?

-- 
My app propabily solution

I press the button garage
my app starts screen.initialitze run command disconnects
Then we press the button cooking
my app starts screen.initialitze executes the command and disconnects

my problem and tell him to start from screen.initialitze


--
what about using a procedure?
see also Chapter 21 here http://www.appinventor.org/book2

--