2017년 7월 13일 목요일

How to send App data to excel

I programmed an App in which the user checks a few boxes and writes in a few text boxes.
I wanted to send that data to an excel file in my PC, if possible. If not, then to an excel file in my smartphone.
However, that is just too difficult for me x.x 

I sincerely apologize if there is a similar post,  i did search and found none.
I can post the app here if that helps, but it's in Portuguese.

Excel can read CSV (comma separated value) files.  Export a csv to your PC by using DropBox or emailing it.  Excel can then import the CSV.

You are working in an Android environment.  Why not use the Android Fusion Tables (see Pizza Party tutorial) which is an online spreadsheet similar to Excel?  When data is posted as a spreadsheet, it can be shared with other users, either by accessing the specific fusion table url for your FusionTable part of the project or by AI2 using the Web and or FusionTable control.

Or maybe use a Google spreadsheet?
Look here: http://puravidaapps.com/spreadsheet.php

You can also see below tutorial on using spreadsheets:


putting "open" before an app name

I have been looking for a while on the forum to know if there is an issue in naming an app by putting "open" in front of the name. Can I consider an app made in mit appinventor 2 being open source ? 
The thing is, I am looking for contributors for a certain app which is already working at this moment, but can use some more creative input. 

Giving the app and the aia file, can I call this open source, or is this confusing ? I know what the 10 rules of open source are, but I don't know if an aia file can also be considered as a source code. 

Nomenclature aside, AI2 apps are hard to collaborate on, because there are no
tools for detecting and highlighting differences between one version of an .aia file and the next version.

You might be able to get by if you find an online collaborative editor for 
doc files listing and the code through screen shots, 
but applying the changes in the equivalent of a pull request would
be a tedious error prone manual process.

There's an AI2 Open Source group with volunteers seeking projects
to enhance AI2.  I haven't heard any progress from that group in this regard.

Many thanks for you reaction sir,
I'll think it over. Maybe i have to limit it to a closed group. 

The demand is there. The app itself is a beekeeping software to keep track of hives and bee health. The goal is to make a noob in programming setting up his own online database of hive inspections. To achieve that, I made a website with tutorial.
At this moment, only the app is published as is, not the aia. There are a lot of considerations: every region has his own way to do their inspections, other hives, other climate,...
The idea is to make it so generic as possible and make it possible to adapt the software with textfiles or csv. The hive inspection part works, and publishes its data in a google drive spreadsheet.

But like you said, it is difficult to work with more people on the soft. Maybe I have to think on other ways of contribution: making the website, make the website communicate with the spreadsheet. But than the "open source" idea is gone, and that was what I was hoping to achieve.

Arnot, AI2 Projects CAN be built in a collaborative effort.  There is a tool to do this....

Here is the MIT Project Merger AI2 tool  AI2 Project Merger Tool: combine two App Inventor projects into one   

This may help several individuals by allowing them to develop different screens in a Project and then merge them. You can share your project in the MIT Gallery where users are encouraged to develop improvements to existing apps and share those.

OpenSource means different things to different people.  Do not let the nomenclature stop you and like minded individuals from building a bee keeping app as part of a group.  Sharing may be involve just using a common data base (like a fusion table) to share information about be migration etc.    Have you seen this  https://fusiontables.google.com/data?docid=1-941Px73b_XWWn3pmPHKp6WhbbSVNiEmKMadwe0#rows:id=1      and      this   https://support.google.com/fusiontables/answer/2527132?hl=en  .    Not all the collaboration has to be with the ai2 coding.

I have tried the merger, and indeed, it is a good way for collaboration, since the apphas many different features. Did not think of that, thanks ! I once needed it after a partial data loss.
I had integrated fusion tables in an older version of the app, but abandoned it because I could not find how to link the data from individual cells to another website, but with what you showed me, maybe I could give it a try again. I learned a lot more since I used it and probably I did not test it to the limit. I learned it through the famous pizza party app.

At the moment, I let the users make a form from a google spreadsheet, copy the entrypoints from the html of the form and put them in a list as text, next to the link to the form. Than upload it to the app which synchronises with the text file. After that, the app is linked to the spreadsheet. The hive inspection items are stored offline (no wifi at the beehives), and can be synced later. When there is a software update and the entry points are lost (among other things), it can be synced again with the file. It is not an ideal way, not plug and play, but it makes people understand how this appworks. Bee season is going to start in a few weeks, so I released the app the 3rd of March, joined with a google site with a tutorial, and posted the link on a beekeepers site on Facebook. I have news of a few people already installing and testing. A few things have been disconnected and "under construction" because it needs some maintenance. Those could be done by other contributors. 

The Dutch version of the site : https://sites.google.com/site/openhoneybeeapp/
The English version is not entirely up to date yet. Misses illustrations. It should be finished in a few days : https://sites.google.com/site/openhoneybeeappeng/

The aia will be available too, but I have to clean up the code. Too much repeating, too little variables. Being no hero in programming I used the bulky way to make the internal interaction. 

I'll look into the fusion tables again. Thanks for the info !!


search results for sound file error 703

I've created a simple app, with a screen, button and sound file (mp3) it works perfectly on demo on the MIT app. However when ... I get a 703 error (on soundcomponent) and 701 error (on player component). I'm using a Google Pixel ...
I've been trying to add sound to my app but every file type my sound guy tries gives me this error on the first play attempt. It always plays the sound on ...
Convert your media file. ... I first received 703 errors... i converted to wav files to m4a files and received 701 errors. I changed ... The errors occur on the "Shake" portion to play a random sound file. The file on the initial load plays fine.
(1) the sound buttons which have initial sound components and wav file setting in the Designer section play no problem. (2) the additional sounds must be touched a second time each to overcome a 703 error, but the interesting thing is *after that * they all play just fine. In other words, after you play each ...
After i followed the steps on making an app that tells me my latitude and longitude , for some reason my sound wont play at all. And when i try to play it says Unable to play "Error 703:". Please help .. and i can give a link to the apk file if needed. the video i was following the same steps as ...
I uploaded a wma. sound file to the program however when i needs to play on the android device it gives me this message "error 703: unable to play ...
My app is working well when .wav files are used for a sound, but when I try to use .mp3 files I receive Error 703: unable to play sound. I have tried Mp2 ...
... instead of the sound playing, i get an error message saying: > > Error 703: Unable to play windowserror.wav - or the name of any other wave file that ...
What does it mean the FIRST? I played a sound once and changed to other mp3 file. and then comes up error 703...
I have a problem with viewing pictures and playing sound from my hard disc on my phone. ... my phone there isn't any picture on the background(on my application in appinventor it works correctly). when i try to play wave file on my phone there show this message:error 703, unable to play mp3 file. there ...
Sure enough, I got "error 703: Unable to play eaglesound.zip" when I loaded the app to my phone. ... At this point, all I can see is a bad sound file.
Are you trying to stream music or to play a sound from a file in Media (resources) or the sd card on your device. This link explains how to use sounds: ...
If the tech team wants to have the project file, just take it, or I will send it. I'm not going public with it, because the sound files are copyrighted. AI2 seems to have the ... And now the complete error report of the crash with a Samsung S6 Edge. java.lang. ... MTracks.Screen1.lambda221(Screen1.yail:703).

sound file error 703

My little quiz is so close to working it is driving me crazy.  I started with the MyQuiz tutorial and added my sound and my composer pictures to make an app for my music memory kids at school.  It shows a picture of the composer, plays a short mp3 and asks student to id the composer.  Yesterday it all worked on the emulator but won't work on my phone.  Everything works but the sound.  Today, on the emulator, it plays the first song but won't go on to the next, get error 703.  I don't think I've changed anything!   I am very new at this so any ideas would be appreciated.

can you send me the sound file?

I am so new at this stuff.  I feel like it has something to do with the files not uploading with the app, but I don't know what I'm doing wrong.  I thought that was all packaged together.  All the picture media works...

Kay, that is a bug that was introduced a few updates ago.
The work around is to load all the sounds in the screen 1 init.
Then the second time they are loaded where you need them they work.
ok i check out the sound files and they are ok. I didnt know about the sound file issue. I'd do like tony said and add the files in, in the screen 1 int.
Tony do have a link to that issue off hand, it will save me some time looking for it.

Not right off hand. Our of town so I can't get to a puter to search.

Dont worry I'll find it. I have been having the same 703 issue but only one sound out of 4 sounds. It dont 
make much sense. but I will figure it out and find a good work around.
KAY, do you mind sending your source to me at roger...@gmail.com and let me try on yours. My game, the blocks are slow due to app size.

Your e-mail address was, well, incomplete.  How shall I send this?  I thought I included my stuff in my first post.  I'm sorry I don't get it, and I really appreciate your help.  I got it to work again on the emulator, Then it would play every 4th song.  You're right.  very strange. Just tell me how to get it to you.

roger...@gmail.com is my complete address

I had this problem in an app too.  I just ended up getting a new sound file and re uploading it.   Its a little buggy on things.  The initialize sounds and screen (if you have any tables)  is a good Idea too....rep to BigDaddyApp for that one.

Thanks for that input. I have found that it happens with the first sound. and I fix mine by getting a new mp3 file.

After going through the whole quiz the second time through it plays most sounds...then the third time it skips different sound files.  I can tell this is going to be way hard to debug.  What I have should work!  Gerrrrrrrrrrrrrrrrr.  AND now I have three image files that don't show up.

wow, when it rains it pours. How big is your app?

As far as I know, this bug has been there forever.
From my own experience writing apps that use the Sound component, here's what I've needed to do to get multiple sounds to play reliably:

In the designer:
Add a Clock component to the app. Check TimerEnabled and set TimerInterval to 100.


In the blocks editor:
Define a global variable named Sounds to hold a List of all the sound file names.
Define another global variable named SoundIndex with the value 1.
Use the Clock1.Timer event block: Each time the timer goes off, set the Sound.Source property to a different sound file. After you've set all of them, disable the timer.

Each time you want to play a sound, make sure you set the Sound.Source property to the specific sound file name before you call Sound.Play.

Each Sound component should be able to hold 10 sound files. If you need more than 10, you should use more than one Sound component.
Also, each sound file should be just a short sound. The Sound component is not meant for whole songs. The Player component is the better choice for playing music.

Thanks Liz.

Wow, yeah, this sounds very similar to an issue I have logged (#2463).  My app will work for about five minutes and then start skipping sounds randomly.  I reprocessed all of the sounds at a lower bit-rate (dropping the file sizes down about a third) and it ran for about 15 minutes before skipping sounds (on a Gen 1 Kindle Fire it skips sounds right out of the gate though).  I'll try changing the app to preload and call sounds using the the method described here.

I am using Liz propossal for a app with 13 mp3 sounds, I have two Sound components, two Sound global variable lists (one with 8 files ande the second with 5) and two indexes, above is what I am using at the blocks editor and the error I am getting at the emulator

Any ideas?


Sound files error 703 and 701

I've created a simple app, with a screen, button and sound file (mp3) it works perfectly on demo on the MIT app.

However when using it as a packaged app...I've tried using the sound media component and sound player component. Neither works. I get a 703 error (on sound component) and 701 error (on player component)

I'm using a Google Pixel phone, I suspect this is the problem. 

Can anyone help? Thanks.

first set the source of the sound, then call the play method

set Sound.Source to "example.mp3"

in case this does not help, try this Workaround for error 703 in sound component (App Inventor Classic)

Hi, thank you, yes I did all that and the live test works fine, but error when the app is installed. 

I think it might be the phone.

Fixed it, new google drive didn't have the .mp3 on it when uploading it, so I renamed it and now it works :-))


How to separate the answers from a bluetooth

Hello guys,
I have a little problem , i am trying to do an app for my project at school . I need to send commands from my phone to a computer using Bluetooth.
The computer answers with a terminal connected to Bluetooth. When i get the answers in the phone it displays in 2 differents labels in place of one and i dont know how to separate them

ps : The picture is a screenshot of my app and blocks

Make a global variable called last_sent, initially blank text.

In each of your button click events, when you send a command text,
also set last_sent to the text you just sent.

You only need one clock, Clock1.

In Clock1.Timer, decide which label to fill with the received text based on
the contents of the global last_sent .

If connected then
   if bytes available > 0 then
      if last_sent = 'cdcd' then
         set verif.text to receive bytes ...
         set freq.text to receive bytes ...

Apparently you are under the impression that by having two clocks you will get separated messages.
That very much depends on the timer interval you have set for both and on the frequency that your BT-device sends the data.
What you have to do is this:
- Delete Clock2
- instead of setting the labels Verif and Freq, create a global variable called dataReceived or somethin g similar and set the variable to what you recieve.
- Split the text using the "split at" textblocks. This depends what the message you are getting really looks like.
- Set Verif and Freq

There are some more points: you did not say anything about the sketch you have and what the received data looks like. You may have to read things differently, setting the number of bytes to read to -1. This will make sure you get a complete message, but it requires that you send a line-end from the BT at the end of the message (use println() will work) and you should make sure the delimiter byte is set properly. Set it to 10.


Word Filtering

I'm looking to add a filter to a function where the app requests the user to input text. This filter bans specific words or combinations of words, and I figured the easiest way to do it was through a .csv.

The image is the block I have attempting to filter the words, and as you can imagine, it's not working. 

The .csv is set up like it should be, being like this:

Any help is appreciated! 

I think you should use "In the list? thing USEROUTPUT    List BLACKLIST" 
The block is in the list blocks.

If your blacklist is constant, you should avoid constantly unpacking that csv
by doing it just once in the initialization of another global, blacklist.

You are missing a for each word in blacklist block surrounding the
containment test, where you would test for the current word being in
the user text.

@Vipul, your solution works only if the user input was only one word.
If a complete sentence were input, it would need to be broken down
to individual words, and the individual words feed to the is in list blacklist
block one at a time.


Help error!

use Do it to debug your blocks, see tip 4 here

This just says that you are trying to compare things that you cannot compare. Make sure that the length of your data is > 6 for example.

Your error message looks like it contains pieces of more than one message, back to back.

What kind of component are you using for communication,
and does it support Delimiters like \n between messages?


The operation * cannot accept the arguments: ,[0.15 -0.38].[-7.1]

I am having this problem. Please help :( When I remove the set ImageSprint, the error is gone then. Is it that imageSprint X and Y can't accept decimals?

use Do it to debug your blocks, see tip 4 here
Top 5 Tips: How to learn App Inventor

as you can see from the error message, the second item from your list are the 2 values 0.15 -0.38
to be able to multiply, you obviously need only one value...

Also see https://puravidaapps.com/snippets.php#2parse
for how to deal with variable length input with markup.


New help - server error

Hello guys... I have another problem.... I created an app, with 6 screens... 3 of them has 40 labels in the same layout (and are invisible).
The labels are empty right now.
But now I am having an error message of server error could not save......
I saw some solutions.. but in my case: I no have image, have less than 10 screens, the icon is small (6 Kb), the aia file is 67,8 kb..
What do you think about this?

Take your latest good .aia file and continue work on

Maybe the alternative back end might make a difference.

No, same problem :-(

What I have to do is work as normal... then save the project and then refresh the browser... then I can downlod or have the QR...


AI2 Procedures

A procedure is a sequence of blocks or code that is stored under a name, the name of your procedure block. Instead of having to keep putting together the same long sequence of blocks, you can create a procedure and just call the procedure block whenever you want your sequence of blocks to run. In computer science, a procedure also might be called a function or a method.

Procedure Blocks
⦁ procedure do
⦁ procedure result

procedure do

Collects a sequence of blocks together into a group. You can then use the sequence of blocks repeatedly by calling the procedure. If the procedure has arguments, you specify the arguments by using the block's mutator button. If you click the blue plus sign, you can drag additional arguments into the procedure.
When you create a new procedure block, App Inventor chooses a unique name automatically. You can click on the name and type to change it. Procedure names in an app must be unique. App Inventor will not let you define two procedures in the same app with the same name. You can rename a procedure at any time while you are building the app, by changing the label in the block. App Inventor will automatically rename the associated call blocks to match.
When you create a procedure, App Inventor automatically generates a call block and places it in the My Definitions drawer. You use the call block to invoke the procedure.

procedure result

Same as a procedure do block, but calling this procedure returns a result.
After creating this procedure, a call block that needs to be plugged in will be created. This is because the result from executing this procedure will be returned in that call block and the value will be passed on to whatever block is connected to the plug.

Need additional help with the topic of Procedures? Check out the Procedures page.

Where procedure

I just began to use MIT 2 App yesterday. Just for lerarning, I'm using this tutorial: Map It: Displaying Locations on a Google Map

This tutorial uses WHERE/DO procedure/control but I can't find it in the blocks list. Where can I find it? Sorry, it's really a basic question, once I am an beginner. 

what procedure are you talking about?
any screenshot?
probably you are talking about a custom procedure, you have to create yourself?
see also AI2 Procedures

Dear Taifun, the WHERE control used in the attached figure is not included in my the block list.

I just need to build this WHERE rule (as shown in the figure), but I don't know how and I didn't find this information in the help.


Does this graphic help Julio?   That block is part of the Screen controls

are you talking about the Screen.Initialize event?
you find it in the Screen drawer

you probably might want to start first with the beginner tutorials...

Ok, Steve. This Screen control was not collapsed. That's shameful! 
Thanks a lot.


you need to 'create' this block.  Go to the Procedures, then find the block circled in read and type over the word procedure  with initData.  After you do that the call initData block is created.

This free book in AI2 programming explains all kinds of interesting and non-intuitive programming tricks similar to this one for procedures.   http://www.appinventor.org/book2      Read the chapters under   Inventor's Manual.

Thanks Steve and Taifun, I'll take a look in this AI2 book. At any way, I got to run the example in the tutorial.


Maximum number of items in a list?

For a simple app that displays a random string of text when a button
is clicked -- is there a maximum number of items that can be placed in that list?

Assuming I'm missing something relatively obvious (entirely possible,
as I'm pretty n00b to this) -- is there a better way than


for displaying one of any number of random text strings? (but again:
what's the upper limit of "any number"? and is there an efficient way
to have an upper limit that's in the hundreds, not the dozens?)

Check this thread: http://groups.google.com/group/appinventor/browse_thread/thread/c708b24339ec5b3c/0034be0d8649f895

There's some arbitrary talks about this very topic and it appears to
be restricted only to the available memory of your phone.  As for
picking a random item from a list, I'm not sure that it gets any
easier than say "pick a random item from this list".  The block
functions the same as "from 1 to X, where X is the upper bound of list
L, select random N form list L".  Again, one block does the functions
of several (if you were to do it yourself) so I'm not sure how it
would get any easier. 

Thanks, pupooh ... it does appear that the limit is 56 -- because that
maxes out the available space on the blocks editor landscape.

So, to simplify the issue: If I have a button in the app that says,
"click here to see a random baby name" then the maximum number of
random names available to choose from appears to be 56

To be honest, there are two ways to do this to bypass limitation I

Both involve the use of TinyWebDB.

The first would be use the TinyWebDB to load TinyDB with data. Then
when the button is pressed, a random number helps generate a tag that
you can get that can be use to pull a baby name.

The other would be to just use TinyWebDB with the getvalue function on
the server simply returning a random name.

The ideal way to handle this would be to have a TinyDB or similar that
you pre-populated with data that you can include with your
application. As far as I know, that is not yet possible. 

No, no,no

You can have a list of 1000+ items

set up a While Loop , while i < 1000
i = i + 1
Add item to List, listname=name, item to add="abcd' + i

you can even make a 2 lists of 56 items and use Append to list to make
a list of 112'

see https://sites.google.com/site/blocks123/lists
and https://sites.google.com/site/blocks123/playing-with-colors 

Yep -- APPEND TO LIST is what I was looking for, and should work well
for my straightforward purposes: I can create multiple lists, append
them all to my main list, then have the app pull randomly from that
main list. Here's how I'm doing it (tested on my Samsung Galaxy and
it's working perfectly)


Good site, by the way, Ed: Thanks for posting and sharing! 

ah so that's what you were going after.  :)

either "append to list" or "add items to list" blocks work.  with "add
items to list" you don't need to create multiple variables to store
your list.  just have a multiple procedures instead that makes the
"additions" and have those procedures be called in the
Screen1.Initialize event. 

I have several iterations of my app that has data in one or more
lists. The data comes from a spreadsheet with 144 rows. Each row has
10 columns. That ends up as over 1400 list items.

The last version loads the data as a string and uses the split block
to split the rows with a '#' between each row and a '|' between each
cell from the spreadsheet.

Here is a draft of my list of lists tutorial

My next versions will (probably) use TinyWebDB. You would have to set
up a Google App Engine (GAE) to run your version of TinyWebDB, but
that is not hard. Then you could use the web interface to load your
data and get a random key from a list of the keys.

That cuts down on code blocks
May be a bit easier to code (may...)
and requires the user to be online. Hmmm...

Using TinyWebDB and GAE lets me do the editing with a web interface
and AI will work with the rows I am using as needed. That seems to be
a better way to split the load. The phone does the stuff the user
wants and the web page does the editing.

The current version does not need to be online. Using TinyWebDB makes
it necessary to be able to have a connection. Not a problem for now,
and I will look at TinyDB to persist a copy on a phone once I have
TinyWebDB working as I want it to work.

I think I got carried away with this post :-)