Skip to first unread message

John Mountain

unread,
Apr 11, 2019, 7:23:40 AM4/11/19
to mitappinv...@googlegroups.com

I assume it does but my very simple programs do not work!  My first experience was the first project from Random Nerd Tutorial's "Android Apps for Arduino"  this app connect the phone to an Arduino and has buttons to turn an led off and on.  Verified that I had prpoerly configured the MIT App inventor correctly.  Installed on my phone and it would not make the bluetooth connection.  Verified my phone and hardware set up with an example program off github by Mayoogh Girish.  All works fine.  So my hardware and phone check out. 

 

After much troubleshooting, I chased the problem down to the list picker AfterPicking event not firing!

 

So I set up a very simple test program with a list picker and a text box.  Then connected to my phone via WifI when I click the List Picker on my phone I see the list populate and the MIT AI2 Companions shuts down!

 

The MIT AI is very cool and would like it to work.  But so far some thing as simple and basic as a list picker has cost me several hours of trouble shooting. 

So questions:

1.    1. Is it possible to create working apps with this system?  (I assume yes, it is after all MIT!)

2.    2. Is it possible to step thru the “code” and trouble shoot?

3.   3.   Can these apps be converted to Java, C, Python, or VB?

Chris Ward

unread,
Apr 11, 2019, 8:00:51 AM4/11/19
to MIT App Inventor Forum
Hello John

400,000 Users per month says it does work. The (Random Nerds) LED tutorial is common place and popular with schools  -we rarely get support requests.

Answers
  1. Yes. There are at least thousands of App Inventor Apps in use right now.
  2. Yes/No. Not in the way you are used to with text-based coding. There is a "do" facility to check values/process, a comprehensive error catcher and logs that can be used.
  3. No. You can instead write your app in Java/Kotlin via Android Studio if you prefer. 
Had you invested time doing the Tutorials first, you might not have had a problem with the ListPicker :)
It is best not to use the Companion when working with microcontrollers - instead, build a debug APK.

You will find info and useful links on my website:



Taifun

unread,
Apr 11, 2019, 8:32:06 AM4/11/19
to MIT App Inventor Forum
So I set up a very simple test program with a list picker and a text box.  Then connected to my phone via WifI when I click the List Picker on my phone I see the list populate and the MIT AI2 Companions shuts down!

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.

Taifun

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


John Mountain

unread,
Apr 11, 2019, 10:16:43 AM4/11/19
to MIT App Inventor Forum


Much appreciated
Blocks_2019-04-11_1014.png
Screen12019-04-11_1011.png

John Mountain

unread,
Apr 11, 2019, 10:24:40 AM4/11/19
to mitappinv...@googlegroups.com
I am very happy that it works, Never saw it before Monday it is very cool.  But with my first experience with something this simple and basic failing, I was very reluctant to spend more time..  The post after this one has the two screen shot of an app with a list picker and a text box , As stated above the companion just winks out after after a pick.  I installed a apk and it allows me to pick a number but does not display it in the text box.   When something doesn't work I always assume that it was a mistake on my part, but this pretty simple.  And I did not try to work with the companion and the RNT ledblinker, went straight to apks and that was how I drilled down to the AfterPick event not firing.   

SteveJG

unread,
Apr 11, 2019, 10:39:34 AM4/11/19
to MIT App Inventor Forum
John, your 'revelant blocks' code works fine on my Tablet.    You might want to change the ListPicker  ElementsFromString property  from 1,2,3,4,5,6,7,,8      to 1,2,3,4,5,6,7,8,9 or what ever.  That won't make it work any better but it will eliminate a blank selection item from your app.  What issue you do have seems unrelated to the functionality of the ListPicker component.  The LP works fine.

 Here are some resources to help you learn to use the AI2 tools  A very good way to learn App Inventor is to read the free Inventor's Manual here in the AI2 free online eBook   http://www.appinventor.org/book2 ... the links are at the bottom of the Web page.  The book 'teaches' users how to program with AI2 blocks.

There is a free programming course here http://www.appinventor.org/content/CourseInABox/Intro  and the aia files for the projects in the book are here:  http://www.appinventor.org/bookFiles  

How to do a lot of basic things with App Inventor are described here:  http://www.appinventor.org/content/howDoYou/eventHandling  .


Regards,
Steve

Chris Ward

unread,
Apr 11, 2019, 10:47:08 AM4/11/19
to MIT App Inventor Forum
Hello John

For simple tests like this, you can use the Emulator on your PC. Ensure you use either FireFox or Chrome. FireFox is the best at this point in time.

Note that your elements list has a value missing.

So, I have tested your code on the Emulator, works perfectly well, even for the empty element.


John Mountain

unread,
Apr 11, 2019, 12:24:52 PM4/11/19
to MIT App Inventor Forum
Thanks for all of the answers.  It must be my phone!  I began the my old phone.   I will give it a try.  I am going to mark this as complete. 

John Mountain

unread,
Apr 14, 2019, 1:55:32 PM4/14/19
to MIT App Inventor Forum
Found my old phone, both of my phones are Verizon Samsung Note 4s,  Model SM-N910N.  Both are android Version  6.01, one rooted and one stock.  The list picker AfterPick event fails to fire on both phones.  Works in the emulator .  But fails on both of the described phones.   Also works with the example program off github by Mayoogh Girish  I assume that it was written using Android developer, but have not dug into that.

Any thoughts on why the list picker would not work on these two phones?  What would be different about the listpicker from Android developer and AI2?

SteveJG

unread,
Apr 14, 2019, 2:12:07 PM4/14/19
to MIT App Inventor Forum
John, what you experience could be an issue w.r.t.  Android 6.01  but more likely is an issue regarding how you use the ListPicker along with your Bluetooth.  You provided some 'relevant' Blocks...several people have tried the 'example' using various Android models with no issues.   That seems to point to an issue with something in your Blocks.

You could post an aia of your 'example' code blocks to see if the Blocks work without issues on Forum member devices.   Perhaps someone will have an Android 6.01 to test?  I have several Android versions but no 6.     You also could post your blocks you use w.r.t. Bluetooth since "it would not make the bluetooth connection."    Are your ListPicker component AND Bluetooth connection on the SAME Screen?   If you switch between screens, a Bluetooth connection is lost.  That is the way the BT components/extensions work with App Inventor.


Reply all
Reply to author
Forward
0 new messages