2017년 1월 15일 일요일

App Inventor offline


Is there any desktop program or any way to use AppInventor offline? There's nothing wrong with the online version, it's just that I don't have the best Internet connection and sometimes it doesn't save the changes in my app.

--
See thread HERE that shows all the online / offline versions

-- 

Bug: Gallary shows same apps several times on page after MORE APPS


I search for apps containing "brain" and it says there are 24 and shows 8. When I click MORE APPS I get the same apps, and then the same again. The apps also have the same developer so this are not other version. One of the apps that show up three times is my new: Hippocampus Game (clone of Brain Game/Simon Says)
http://ai2.appinventor.mit.edu/?galleryId=5803489607548928

I have Other OS: Windows 10, but I don't think this is the problem because Chrome works well.

Skärmbild (5).png 표시 중

--
I thought maybe someone was 'gaming' the system but that does look like a bug in the search results as some look identical in every way.


-- 

Backpack: copy and paste blocks to different screens and projects


The Backpack allows you to carry around blocks throughout your project repositories, allowing blocks to be transferred between projects and between screens.  The contents of the Backpack persist throughout an App Inventor session.  (NOTE:When you quit your App Inventor session or refresh the App Inventor page in the browser, the Backpack will be emptied -- i.e., re-initialized.)
Click here for a video demo.

How does Backpack work?

The Backpack is a copy-and-paste feature that works between projects and screens. The Backpack icon is located at the upper-right corner of the workspace.


Copying Blocks. Blocks from the workspace can be dragged and dropped into Backpack. This is the copy operation -- the blocks are copied (duplicated) in the backpack.  When blocks are dropped into the Backpack, an animation and sound will occur to confirm for the user that the operation was successful.
Viewing the Backpack Contents. The contents of the Backpack can be viewed by clicking on the its icon (upper right corner of the workspace).  A scrollable flyout will pull out from the right edge of the workspace, displaying the Backpack’s contents. The flyout of the Backpack works the same way as the flyouts in the Block drawers.
To close the flyout without pasting any blocks, you can click the workspace or click any empty space in the Backpack with no block highlighted. Note that if you click on a highlighted block in the flyout, that block will be pasted to the workspace.
Pasting Blocks.  Blocks can be pasted from the backpack into the current workspace by clicking on the Backpack icon (upper right corner of the workspace) and dragging the block from the flyout to the desired location in the workspace.  
As long as you do not close App Inventor, the blocks in the Backpack will be transferrable throughout your project repository and to other screens within the current project. When you refresh the browser, a new session of App Inventor will begin and the Backpack will be empty.  

Background Menus

In addition to the drag-and-drop functionality, a right-click on background menus on the blocks and on the workspace can be used to perform Backpack functions -- as shown in the following image.


[right click on a block] 


 [right click on the workspace] 

Right Click on Block

⦁ Add to Backpack: You can add this block and all of its contained blocks to the Backpack by doing a right-click on the block and selecting this option. The number in the parentheses indicates the total number of blocks in the backpack.

Right Click on Workspace Background

Paste All Blocks from BackPack: this will paste all the blocks from the Backpack to the current project. The number in the parenthesis indicates the total number of blocks in the backpack.

Copy All Blocks to Backpack: you can add all blocks in the current workspace to Backpack.

Empty the Backpack: you can empty the Backpack when you no longer need its blocks. NOTE: Currently the Backpack will be emptied when you exit App Inventor.  When you restart App Inventor, your Backpack will be empty.

What can be added to Backpack?

Function and procedure definitions.  These will be renamed if a duplicate definition exists in the destination workspace.
Lists, strings, and other data
Variable definitions and references.  Variable definitions will be renamed if a duplicate definition exists in the destination workspace.
Blocks Containing Components: Ideally, your destination project should have matching components with the same name or you will need to add components into the destination project after pasting from the Backpack. Reference to a non-existing component will cause red error triangles to be raised.



Initializations that duplicate existing blocks in the destination workspace will be automatically renamed.  For example, if you try to paste a variable initialization block for global variable X and the workspace already contains an initialization block for X, the variable will be renamed X2 in the pasted block.
Similarly, if you try to paste a procedure definition for procedure foo and the workspace already contains a definition of foo, the pasted procedure will be renamed foo2.
Can you paste blocks into any project or screen?
Yes. However, there are instances when pasting blocks from the backpack to a new project or screen will cause red error triangles  to be raised.  For example, this will occur when a block refers to a non-existent variable or procedure in the destination project. The errors can be removed (fixed) by defining the missing variable or procedure.  It will also occur when a block refers to a non-existent component in the destination project.  The errors can be removed (fixed) by adding the missing component and giving it the same name as the one referred to in the pasted block.



how to copy and paste blocks from one app to another


i have made a few apps. now i want to copy afew blocks from one app to another. please guide me , how to do it. 



--

Change button background, wait 500ms, change it back doesn't work.


I've attached my approach for simon says.  I'm trying to do something simple which is when a button is pressed, the following will happen:

1.  The button changes color
2.  The sound is played
3.  We wait 500ms (since the sound event doesn't pause program execution)
4.  We change the button color back.

It looks like everything works except the first step - temporarily changing the button background color.

Can anyone see why?


--
If you are asking for help, I recommend you to make it as easy for others to be able to help you ...
You probably will get more feedback then...

which means in your case post a screenshot of your relevant blocks...


To download the aia file, upload it to  App Inventor, open it, do some bug hunting for you, etc... this takes time, and most people will not do that...
Thank you.

--
The problem was with the clock.
I added 3 more clocks & some blocks to enable/ disable the clocks.


--
Thanks for your help but why are four different clocks needed?  Logically, it seems like my approach should work.

--
Here' are the relevant parts of my program.  
--
use the Player instead of the Sound component
there is a Player.Completed event available you can use instead of your waiting procedure

--
I agree with Taifun's asessment.

Another solution might be to use the Button TouchDown and TouchUp events.

The button is touched and held down (TouchDown) , triggering a sound and color change.
(The color will stay changed until the button is released)
The button is released (TouchUp), triggering a change back to the starting color.
So no delay is required or Clock Timer.
'Here is what I came up with along these lines...
If the sound is long in duration, Taifun's suggestion of using the Player.Completed block may be best to insure that the sound effect finishes playing before changing the color back to it's original value.


--
Thanks for the article about wait procedures.  The main gist of the negative part is that nothing else can happen during the wait and the UI will appear unresponsive.  I don't think that 1/2 second wait that matches the sound length is really a problem here though.  I've made tons of apps and never had to use a wait before so it's not a common thing for me to do.

Anyhow, I think the player completed event is the way to go.  Thanks for your help!

--
When you decide on what approach that you will use, please show us the relevant blocks.

--
Well, I used the player completed event to change the color back. That works great.  You can press any button you want, get the highlight and the sound as you'd expect.  Trouble is, if you want to play a sequence (the test button does this at the moment), they all pile up on each other because there is no wait event slowing it down. Curious what the proper approach is to this problem.

--
You can avoid the pile up problem by adding a couple of lists...

A queue of notes remaining to be played, 
initialized at the start button press and depleted 
each time a note ends.

A list of lists naming the player components, their sounds, and their before and after colors.
Set that list up at screen initialization time, when the components are available.
Refer to the appropriate component slot when starting or ending that sound.

--
Thanks very much for the answer.  I understand a little of what you're saying but not really.  I think this is becoming way to complicated - I'm trying to teach middle school kids here.  Starting to not like event-driven programming.  I think that's the C-programmer in me speaking out.  Going to think of another project to teach.

--
Before you quit on this, check out this similar
app that tries to sing "A Modern Major General"
using the speech block, one syllable after another.

The queueing is similar.


--
Thanks Abraham, that document was helpful.  I modified my program to match that model and that works.  The trouble I then had was that if I clicked on a color button instead of the sequence button at the bottom, it would still call the "iterate_through_list" function which, in that case, I didn't want to do - I just wanted that one note to play and then stop.  To avoid the playing of the sequence, I added an instruction in each button click that makes the index go way over the list size (100), that causes the iterate_through_list function to not really do anything even though it's still being called.

Interesting brain exercise but a bit advanced for my kids I think.  Especially since I haven't even added any of the actual game logic...
--
You don't want your four players to automatically progress through the tune each time they end a note.
Since they are triggered by buttons, they should be single-shot.

If you devote another player, say called TunePlayer, to the context of automatically playing through a tune,
say as a user prompt, only that Player's Completed event should contain any code to walk thru a tune.
You would have to swap its next sound file in as it walks the note list.
Beware an old Player bug that might appear as a 7xx error.  It requires a 'rehearsal' phase at app startup
where all possible sound file names are loaded into Players one after another, to avoid surprising the Player at performance time.

--

Tested Wait Method...


I finally tested my wait method... it works but it locks up the system... Does anyone know how to do a "DoEvents" in the delay loop? In VB6 and C# there was a DoEvents method that let the system do stuff while your app was in a loop....


--
Yes. Put the blocks to be executed inside a Clock Timer event block.

--
I was trying to make an app that converts SMS messages to morse code... it would be very hard to do this with a timer...

--
what about reading the answers in your other threads?

a wait method, which locks the system is probably not the best solution, is it?
how many other threads do you want to post about that "solution"?

I was trying to make an app that converts SMS messages to morse code... it would be very hard to do this with a timer...
why? message is coming in in the Message Received event, then convert then message and display it
you do not need a clock component at all

--
What do you want to do with the Morse code?  Sound it out?
Record a few mp3 files named dot.mp3, dash.mp3, space.mp3
and queue up the sound file names as you encode each letter.

Play the sounds one at a time using a Player, deleting it off pos 1 of the queue,
and starting the next sound only after when the current one ends.

--
I wanted to scan an SMS one letter at a time and use the phone's vibration to sound it out...

--
According to https://en.wikipedia.org/wiki/Morse_code
the dot length governs the speed, and the lengths of the dashes, gaps, letter gaps, and word gaps are all multiples of the dot length. which you can use as your Clock interval and the length of a vibration.

If you encode the vibrations and pauses as 1 and 0 respectively, you can queue them all up in a list.
So ABG would code as:
(In Morse:  . _   _...      _ _ .   )
(On the queue:)
1,0,1,1,1,0,0,0,1,1,1,0,1,0,1,0,1,0,0,0,1,1,1,0,1,1,1,0,1,0,0,0,0,0,0,0

Say a dot is a leisurely 500 ms.

Set the Clock to 500 ms, always fires, enabled, and the sound to vibrate for 500 ms per shot, initially quiet.

Clock fires:
If queue is not empty.
  set local n = 1st element of queue
  remove 1st element of queue
  if n > 0 then
    start vibration for 500 ms.
  else do nothing (silence)
end clock routine

That's the entire service routine to play.
It's all in the coding for how to build up the sound queue from the letters.

I haven't tried this myself yet.
I'm betting three  consecutive vibrations will melt into one long vibration.

--

How do I queue sounds in a soundboard?


Hi, I'm just getting started with AI and I'm doing the basic soundboard app. What I can't figure out is how to queue up sounds instead of just click-and-play. Any response or guides are much appreciated, but keep in mind that I'm new at this.

-- 
see these threads soundboard

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  .

Also do the tutorials http://appinventor.mit.edu/explore/ai2/tutorials.html to learn the basics of AppInventor, then try something and follow the
 Top 5 Tips: How to learn App Inventor

You will not find a tutorial, which does exactly what you are looking for. But doing the tutorials (not only reading a little bit) help you to understand, how things are working. This is important and this is the first step to do.

-- 

soundboard


I am using the PLAYER media component (documentation here) to play MP3 files , about 20 or so, that make up a soundboard within my app. Lately ...
1월 2일 작성자: Travis Bennett - 작성자 2명의 게시물 3개 13회 조회
On my soundboard page, I have a button to go back to the main menu. Is there a way when pressing that button, to stop the sound (from player1) as ...
16. 8. 2. 작성자: Vesh88 - 작성자 2명의 게시물 3개 16회 조회
Hi, I develop a soundboard for my self with App Inventor so far so good but I can't instal it on my phone. When I start the apk the screen tourns black ...
16. 6. 17. 작성자: Oekie - 작성자 2명의 게시물 7개 29회 조회
see these threads https://groups.google.com/forum/#!searchin/mitappinventortest/ soundboard%7Csort:date. A very good way to learn App Inventor is ...
16. 4. 1. 작성자: Taifun - 작성자 2명의 게시물 2개 10회 조회
I made a soundboard and I want it to send the audio through phone calls but it says "error 709 unable to grant lock" or something. Does anyone know ...
16. 2. 6. 작성자: Logan Thresher - 작성자 2명의 게시물 2개 19회 조회
Hi! My name is Tuan and I'm working with my partner James to create a soundboard app using App Inventor 2 for our Computer Engineering class.
15. 11. 13. 작성자: Tuan Nguyen - 작성자 3명의 게시물 3개 29회 조회
I want to make a soundboard of computer game for my friends and me, but the TableArrangement is kinda out of order in the app:.
15. 8. 27. 작성자: Jano schürmann - 작성자 2명의 게시물 2개 17회 조회
I've used MIT App Inventor 2 to make a fairly basic app, basically a soundboard, which simply plays certain sound files when I tap related images.
15. 8. 22. 작성자: Greg Edwards - 작성자 2명의 게시물 3개 35회 조회
OK your soundboard. Could be neat if we can get the development environment working properly. I am running out of ideas. Thanks for running the ...
15. 5. 22. 작성자: SteveJG - 작성자 3명의 게시물 22개 244회 조회
How to swipe to go to another screen by Scott. The recommended method of switching screens in App Inventor. Taifun.
15. 3. 10. 작성자: Taifun - 작성자 2명의 게시물 2개 13회 조회
use only one player component and set player.source of the sound you like to play in the button cick event, for example. set Player.Source to ...
15. 3. 7. 작성자: Taifun - 작성자 2명의 게시물 3개 36회 조회
Hi. I'm wanting to create a soundboard app for playing sound effects in our drama class. When the app starts, I'd like it to parse a folder on the SD card ...
15. 2. 11. 작성자: Ewan Stevenson - 작성자 2명의 게시물 2개 130회 조회
Hello. So I have been asked by my school to create an animal soundboard for a project. I have all the basics but I need help with a certain requirement ...
15. 1. 30. 작성자: bennjclark - 작성자 5명의 게시물 6개 39회 조회
This is ok for normal projects, when you just have less than 10 files to upload but if you have an app that needs several files like a soundboard it is ...
14. 11. 26. 작성자: Eduardo nuno hernandez - 작성자 1명의 게시물 1개 112회 조회
... how it uses the buttons to evoke sound files http://www.howtogeek.com/63397/ how-to-build-your-own-soundboard-app-with-android-app-inventor/.
14. 10. 13. 작성자: SteveJG - 작성자 2명의 게시물 3개 76회 조회
Hello, junio.. I would like to do the samw, were you able to fix ???? I have a soundboard (already in playstore look for Fala Galvao) and I would like to ...
14. 5. 29. 작성자: NoobAI2 - 작성자 4명의 게시물 8개 905회 조회

How can I create the timer that can automatically stop after a few meters?


Can someone help me to make the timer automatically stop when we move away for a few meters from where the start button is pressed. Everything else is just fine except that I have no idea how to make it stop automatically .

--
You could set the starting lat,lon then have a clock timer that tests if the distance exceeds x meters using the great circle formula with the current lat,lon coordinates.
When  that distance is exceeded then stop your timer.

-- 

AI1: Distance between two GPS locations


Changes log:
Converted  project to AI2 and attached the aia project file.
No testing or debugging was done on the converted project.

This project uses the Great Circle formula to calculate the distance between two points.
I tested it for accuracy compared to the very complicated Vincenty inverse formula which is very accurate. I could not get Vincenty to work.
I tried Haversine which is fairly simple and based on the Great Circle formula and did not get any better results than this very simple formula.
For the distance from LA to NYC, the error was 16km.
For the distance from my house to my neighbor's house (37m), the difference was 15cm.
So...here it is...

Pass the latitude,longitude pairs and the units for the return value in a list to the DistancSCR library screen:
(units are kilometers, meters, miles, yards, feet)
The result contains the distance in the units that you specified.
If you specify an incorrect unit name, the list of units is returned.
--

upload on google drive an download from google drive


I wanna ask that how i can make app where we upload file on google drive and user are able to download that just by clicking a button download.. maybe there is a appcalled GS_CSV

--

Auto Arrange Blocks Feature


Auto Generated Inline Image 1 표시 중
Ok. This is the usual right click menu in the AI2. Now some of you might remember I complained about a bug that wouldn't allow me to download blocks as image. After I re-arranged blocks using Arrange blocks horizontally or vertically, now I CAN download blocks as image, although now everything is everywhere. What I mean is that the blocks do not seem to be in any logical order. What do the arrange commands take into account while arranging? Any ideas?

--
first click "Sort blocks by category" and then arrange them (horizontally or vertically)

-- 

Runtime Error for Tinywebdb search


Lyn, thanks very much. Works just as advertised. (Proving once again, I suppose, the invincibility of Caption Abstraction.) The Google folks keeping ...
14. 3. 30. 작성자: TJ - 작성자 2명의 게시물 3개 96회 조회
Okay I did it using the test database app inventor uses rather than my custom one and it worked. What is the guide for setting up the web db again?
14. 1. 11. 작성자: Vincent Russo - 작성자 3명의 게시물 15개 133회 조회
Hi Taifun,. I made the changes as you said, main issue was that I was updating both the buttons on same name. I fixed it and it works well. But now I ...
16. 12. 21. 작성자: Rachita - 작성자 2명의 게시물 6개 29회 조회
Hola a todos, soy nuevo en el foro, tengo un problema con mi aplicacion, y es que cuando ingresa a una Tinywebdb me sale un mensaje de Runtime ...
16. 4. 12. 작성자: David Guerrero - 작성자 2명의 게시물 2개 12회 조회
OS - Windows 10. I followed all steps from http://ai2.appinventor.mit.edu/ reference/other/tinywebdb.html (Creating a Custom TinyWebDB) and got a ...
15. 12. 12. 작성자: Peradev - 작성자 3명의 게시물 5개 22회 조회
Attachment 1 demonstrates my attempt to Store a TinyWebDB flat string. Attachment 2 shows a demo copy of this string, WebSave. You'll see several ...
15. 1. 29. 작성자: Charles Schwedes - 작성자 2명의 게시물 6개 37회 조회
Let me take this one picture at a time. LoginScreenBlocks. For the login button, you do a check to see that there's data in the username/password ...
14. 6. 21. 작성자: Stephen Zipprich - 작성자 2명의 게시물 8개 82회 조회