Multi-Checkbox kept in memory

456 views
Skip to first unread message

Sebunian

unread,
Feb 23, 2015, 2:08:45 PM2/23/15
to


Hello, Community.

A few days, I configure a application with MIT App Inventor 2, and I would like my app remembers several choices made with the "Checkbox", even if I close the application.
I found a system that uses the "Checkbox" and "Tiny DB", but I have a little problem.
Let me explain, I have several "Checkbox" on the same page, I press a "Checkbox", close my app, but when I return to my app, all "Checkbox" are checked, then that I have just validated a "Checkbox".
 
The party "Block" my App Inventor 2

 








What I would like, when I validate a "Checkbox" that only this checkbox is validated and not others, and also that when I validate another "Checkbox", the others "Checkbox" already checked remains checked

How can I do?

PS: Excuse me if my English is not good, but being French, I translated via "Google Translation"

Thank You

Taifun

unread,
Feb 23, 2015, 2:34:06 PM2/23/15
to mitappinv...@googlegroups.com
if you want the app to remember choices, you have to read the values from TinyDB in the Screen Initialize event, you currently don't do that...

also: never use the open another screen together with "Screen1", except if you use Tribblehunter's method. Why? see here https://puravidaapps.com/manager.php

and: does this make sense?

if you uncheck the checkboxes, they are disabled, so you can't check them again?

Taifun

Trying to push the limits of App Inventor! Snippets and Tutorials from Pura Vida Apps by Taifun.         

Sebunian

unread,
Feb 23, 2015, 5:08:07 PM2/23/15
to mitappinv...@googlegroups.com
Hello, Taifun and thank you for answer.

I modified the method to open another screen with the "Tribblehunter" method

As for the last thing you told me about, it was just a mistake on my part (This has was changed)

But I did not understand what you mean to me say 
Taifun : you have to read the values from TinyDB in the Screen Initialize event, you currently don't do that...
can you detail a little more

 thank you :)

Sebunian

unread,
Mar 3, 2015, 12:28:41 PM3/3/15
to mitappinv...@googlegroups.com
UP !!

Taifun

unread,
Mar 3, 2015, 12:49:01 PM3/3/15
to mitappinv...@googlegroups.com
to get a value from TinyDB, use the TinyDB.GetVAlue block, see also http://ai2.appinventor.mit.edu/reference/components/storage.html#TinyDB
btw. it helps to do some tutorials to learn the basics...
Taifun

Abraham Getzler

unread,
Mar 3, 2015, 1:48:00 PM3/3/15
to mitappinv...@googlegroups.com

Sebunian

unread,
Mar 3, 2015, 2:01:37 PM3/3/15
to mitappinv...@googlegroups.com
If I understand correctly, I have to put different Tag for each checkbox?

Otherwise, I have a little problem on the multiscreen Tribblehunter (https://puravidaapps.com/tribblehunter.php), as soon as I press a button, it does not change me screen and it marks me "MIT AI2 Companion stopped." So what's the worry?


Taifun

unread,
Mar 3, 2015, 2:15:08 PM3/3/15
to mitappinv...@googlegroups.com
you are working with checkboxes, which can be checked = true or checked = false
so what do you think, does the valueIfTagNotThere = empty string makes sense here?
what about using a boolean false block instead?
Taifun


Sebunian

unread,
Mar 3, 2015, 5:25:58 PM3/3/15
to mitappinv...@googlegroups.com
My checkbox problem is solved, thank you for your help.

But now I have problem with the multi-screen. I am using the method of Tribblehunter, but when I press the button I get an error "MIT AI2 Companion stopped."
Whence comes this error?

Sebunian 

Taifun

unread,
Mar 3, 2015, 6:38:30 PM3/3/15
to mitappinv...@googlegroups.com
to find out more about the Runtime Error, you can use Logcat

I normally use Eclipse and Logcat there, but if you have installed the App Inventor Software (see also http://appinventor.mit.edu/explore/ai2/setup-emulator.html), you already have everything you need to use logcat...

How to use Logcat
  1. connect your device using USB with your computer
  2. in File Manger go to the App Inventor directory, which is  C:\Program Files\App Inventor or similar
  3. press Shift and right mouse click the subdirectory commands-for-Appinventor to get the context menu
  4. select "open command window here" and you will get a command window of that subdirectory
  5. enter adb logcat and the logcat will start running
To copy your log, right click, click "select all" and enter to copy the complete log into the clipboard, then open Notepad and paste it using ctrl-v.

Taifun

Sebunian

unread,
Mar 11, 2015, 1:51:39 PM3/11/15
to mitappinv...@googlegroups.com
Hello Taifun. Thank you for answer

It marks : 'logcat' is not recognized as an internal control
or external, operable program or a command file.


Thanks

Taifun

unread,
Mar 11, 2015, 1:54:48 PM3/11/15
to mitappinv...@googlegroups.com
you have to run that in your commands-for-Appinventor directory 
Taifun

Sebunian

unread,
Mar 11, 2015, 2:51:16 PM3/11/15
to mitappinv...@googlegroups.com
I still have the same message

Taifun

unread,
Mar 11, 2015, 3:16:52 PM3/11/15
to mitappinv...@googlegroups.com
in your commands-for-Appinventor folder, are you able to see the adb.exe file?
did you enter adb logcat in the command window?
Taifun


Sebunian

unread,
Mar 11, 2015, 3:54:23 PM3/11/15
to mitappinv...@googlegroups.com
This is what I have in my file :













Yes I typed logcat adb in the command window but it marks me 

Sebunian

unread,
Mar 11, 2015, 3:58:16 PM3/11/15
to mitappinv...@googlegroups.com
As much for me, I was mistaken, I put logcat adb and not adb logcat


Now in the command window, there marks -waiting 
 for device-

Taifun

unread,
Mar 11, 2015, 5:49:56 PM3/11/15
to mitappinv...@googlegroups.com
you might want to read step 1 of the very small list of steps again?
Taifun

Sebunian

unread,
Mar 20, 2015, 2:41:20 PM3/20/15
to mitappinv...@googlegroups.com
Hello

I followed your steps, but I always -Waiting for device-
My phone is plugged to my PC




Taifun

unread,
Mar 20, 2015, 3:16:09 PM3/20/15
to mitappinv...@googlegroups.com
it seems to be, your device can't be found, which should be connected via USB
sorry, I don't know how you could fix that, anyone?

coming back to your question
but when I press the button I get an error "MIT AI2 Companion stopped."
Whence comes this error?
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.
Reply all
Reply to author
Forward
0 new messages