2017년 5월 9일 화요일

Getting input via lists


I want to display a list (of colours) and when the user chooses one, to open a second screen which will be different according to the colour chosen. I've been told off for trying to use too many screens, so I need to use an if..then..else.. statement but I can't see how to do it using listview. I'm sure it's simple but I just can't see it. Help please!

--
Yes, thanks. But forgive me if I'm being stupid. How do I access the code behind your demo?



-- 
I will share it with you tomorrow.

--

Dropbox Upload Error


Hello there. I'm trying to send the recorded audio file to the dropbox. He worked so hard, but I think I broke something today. Is there anyone who can help me?


--
thank you for using my Dropbox example dropbox.aia
as the error message is trying to tell you, your filename is empty, which means, the SavedRecording property is empty... you did not specify it in your blocks... also your local variable list is empty because of the same reason...
what about using your variable sound instead?
use Do it to debug your blocks, see tip 4 here

--
I can not identify the file name in blocks. I struggle day by day but I still get the same error. I do not have any problems with Taifun's imagepicker example. But when I want to send the audio file, I get the "file name is empty" error.

--
you might want to follow the already given suggestions, especially learn how to use Do it...

-- 
I can not understand the examples because my English is not good. But I will try to learn again, thank you.

--

--
thank you very very much. code block Working now.

--

Send a sound track to the dropbox.


Hello there. I want to send an audio file that I saved with app inventor to dropbox. But I am constantly making mistakes. I'm getting your message that it's not a file name. Is there anything I can do to help you assign a file name?

--
see my answer here Dropbox Upload Error

--

Is there a possibility i can execute 2 fusiontable control blocks?


Is it possible i can put two query for fusiontable blocks

like call fusiontable.getrowswithconditions and set fusiontablecontrol.query on one button click?

i have this situation that i need to get the rowid so i used the Getrowscondition block inside button.click. 
and to Update the Field..

I search everywhere.. and i cant find some tutorial on this issue..

--

like call fusiontable.getrowswithconditions and set fusiontablecontrol.query on one button click?

no

first send a SELECT statement to the table to get the rowid and receive the rowid in the fusiontables controls got result event, 
then send your UPDATE statement and receive the result again in the in the fusiontables controls got result event

-- 
See this doc and sample app for multiquery
and multi-step Fusion table handling.

-- 

all bocks in all projects are empty


i'm programming and than suddenly in ALL my Projects the blocks are empty.
Oh my God
I don't know what to do

--
Browser issue ?

-- 
No
when i login with another account all ok.
when login with my normal account all blocks emty

-- 
Error generating Yail for screen 5952869608718336_Screen2: Blocks area is not initialized yet. Please fix and try packaging again.

but how??

-- 
This sounds to me like the Blockly source is not being loaded, or not loaded correctly. Some questions that might help us determine the problem:

1, Do you have the same issue if you try using your browser's private browsing mode?
2, Do you have any plug-ins or extensions that might be blocking JavaScript from running correctly? 
3. If you try a different browser or computer but the same account, do you see the same error or is it browser specific?
4. Try creating a new project, then log out and log in. Does this new project still not load the blocks area correctly? If it works, the last project you tried to open may have been corrupted. We may or may not be able to recover it for you if that's the case, but we will need more info.

Please let us know if any of these things works, or if you run into further problems so we can help diagnose the issue.

-- 
plugin TaifunBilling installed.
creating new project, log out and login the same: no blocks and no PALETTE (All project in the blocks arena with EMTY PALETTE)
But if i save a project and put it into a new account all blocks in the new account

-- 
Can anybody reset my account, Project are saved all. I need this account because same as google and apps released under this account and under new account i can't make updates at googlestore

-- 
anybody knows how to contact the webmaster, my account must reseted because i can't build anything and i must update my apps at store

-- 
We are looking into it.

-- 
The problem appears to be that your backpack contents were corrupted and this was preventing the blocks workspace from loading. I cleared out the backpack in the data store and you should be good to go.

-- 

Stop showing up notification


After update version Galaxy J7, the notification show alert stop showing up. It used to show up with old version. Is there any extension or new procedure to upgrade the app.


--
the notifier shows up only on the first or the last page
you might want to use Do it to debug your blocks to find out, which value does your variable nr have, see tip 4 here

-- 
I do it but it is the same.


-- 
Even the first page and last page it doesn't show up.

-- 

Even the first page and last page it doesn't show up.
well, following your blocks these are the only 2 pages you get a notifier showing up...

how many pages do you have... again: use Do it


-- 
I have 600 pages.
The notification alert show with some mobiles. I have J7 and it work very well before but after updating mobile version it stop showing notification. I just worry why it stopped showing the notification after updating the mobile system.

-- 
as already said, the notification only shows up for the first and the last page
as test you might want to add a notifier show alert block outside of the if else statement to always display the current page number...

-- 
When I tested with anther phones such as hawawi it work at first and last page. It means that not all phones it work with. Or maybe when update the phone it doesn't show up the notification.

-- 
as test you might want to add a notifier show alert block outside of the if else statement to always display the current page number...

-- 
Can you please show me please how can I take notification out of if else.

-- 
add a Notifier.ShowAlert get global nr block here to always display the current page number

what about finally doing some tutorials to learn the basics?

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 App Inventor, 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.

-- 
I have added the notification show alert but still the same.


-- 
try an example app as simple as possible, just add your canvas, the Flung event your nr variable and a notifier and try again


-- 
I have tried it and it doesn't work at all.

-- 
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.

-- 
Attached is the block that I have changed and it is still the same.

-- 
the suggestion was to create a test project as small as possible for you to find out, if the notifier works of not
it does not look like you followed that suggestion

-- 
In fact, I don't know how to make a small example to let notifier works.
At the end I feel that I am a failure to do a small thing.
Don't worry my friend I have got a good lesson to not ask any question any more.

-- 
you might want to read my answer here Stop showing up notification
and: 

-- 
Thank you so much for advise and help:)

-- 

CONNECT APP INVENTOR TO MYSQL DATABASE


Connect App Inventor to MySQLIn this tutorial I want to show you how to connect App Inventor to a MySQL database using PHP. I tried to keep everything as simple as possible while at the same time teaching enough so that you can do anything.
You’ll be able to submit to, update and then receive a CSV file from the database using the PHP files below. You’ll also be able to limit access to data simply by creating a different PHP file for each person that would need to access the database. Everything you need can be found below.






If you like videos like this, it helps my search results if you tell Google Plus with a click here 


MySQL Database Setup 

App Inventor MySQL Design View

App Inventor MySQL Blocks
Click the image below a few times to view it full screen

PHP Code that You’ll Upload to a Server
01<?php
02
03DEFINE ('DBUSER''YourDatabaseUserName');
04DEFINE ('DBPW''YourPassword');
05DEFINE ('DBHOST''YourDatabaseHost');
06DEFINE ('DBNAME''YourDatabaseName');
07  
08$dbc = mysqli_connect(DBHOST,DBUSER,DBPW);
09if (!$dbc) {
10    die("Database connection failed: " . mysqli_error($dbc));
11    exit();
12}
13
14$dbs = mysqli_select_db($dbc, DBNAME);
15if (!$dbs) {
16    die("Database selection failed: " . mysqli_error($dbc));
17    exit();
18}
19
20$result = mysqli_query($dbc"SHOW COLUMNS FROM customer");
21$numberOfRows = mysqli_num_rows($result);
22if ($numberOfRows > 0) {
23
24/* By changing Fred below to another specific persons name you can limit access to just the part of the database for that individual. You could eliminate WHERE recorder_id='Fred' all together if you want to give full access to everyone. */
25
26$values = mysqli_query($dbc"SELECT * FROM customer WHERE recorder_id='Fred'");
27while ($rowr = mysqli_fetch_row($values)) {
28 for ($j=0;$j<$numberOfRows;$j++) {
29  $csv_output .= $rowr[$j].", ";
30 }
31 $csv_output .= "\n";
32}
33
34}
35
36print $csv_output;
37exit;
38?>


01<?php
02
03DEFINE ('DBUSER''YourDatabaseUserName');
04DEFINE ('DBPW''YourPassword');
05DEFINE ('DBHOST''YourDatabaseHost');
06DEFINE ('DBNAME''YourDatabaseName');
07
08$dbc = mysqli_connect(DBHOST,DBUSER,DBPW);
09if (!$dbc) {
10    die("Database connection failed: " . mysqli_error($dbc));
11    exit();
12}
13
14$dbs = mysqli_select_db($dbc, DBNAME);
15if (!$dbs) {
16    die("Database selection failed: " . mysqli_error($dbc));
17    exit();
18}
19
20$FirstName = mysqli_real_escape_string($dbc$_GET['FirstName']);
21$LastName = mysqli_real_escape_string($dbc,$_GET['LastName']);
22$Street = mysqli_real_escape_string($dbc,$_GET['Street']);
23$City = mysqli_real_escape_string($dbc,$_GET['City']);
24$State = mysqli_real_escape_string($dbc,$_GET['State']);
25$Zip = mysqli_real_escape_string($dbc,$_GET['Zip']);
26$Email = mysqli_real_escape_string($dbc,$_GET['Email']);
27$Phone = mysqli_real_escape_string($dbc,$_GET['Phone']);
28$Recorder = mysqli_real_escape_string($dbc,$_GET['Recorder']);
29
30$query "INSERT INTO customer (first_name, last_name, street_address, city, state, zip_code, email, phone_number, recorder_id) VALUES ('$FirstName', '$LastName', '$Street', '$City', '$State', '$Zip', '$Email', '$Phone', '$Recorder')";
31
32$result = mysqli_query($dbc$queryor trigger_error("Query MySQL Error: " . mysqli_error($dbc));
33
34mysqli_close($dbc);
35
36?>


01<?php
02
03DEFINE ('DBUSER''YourDatabaseUserName');
04DEFINE ('DBPW''YourPassword');
05DEFINE ('DBHOST''YourDatabaseHost');
06DEFINE ('DBNAME''YourDatabaseName');
07
08$dbc = mysqli_connect(DBHOST,DBUSER,DBPW);
09if (!$dbc) {
10    die("Database connection failed: " . mysqli_error($dbc));
11    exit();
12}
13
14$dbs = mysqli_select_db($dbc, DBNAME);
15if (!$dbs) {
16    die("Database selection failed: " . mysqli_error($dbc));
17    exit();
18}
19
20$FirstName = mysqli_real_escape_string($dbc$_GET['FirstName']);
21$LastName = mysqli_real_escape_string($dbc,$_GET['LastName']);
22$Street = mysqli_real_escape_string($dbc,$_GET['Street']);
23$City = mysqli_real_escape_string($dbc,$_GET['City']);
24$State = mysqli_real_escape_string($dbc,$_GET['State']);
25$Zip = mysqli_real_escape_string($dbc,$_GET['Zip']);
26$Email = mysqli_real_escape_string($dbc,$_GET['Email']);
27$Phone = mysqli_real_escape_string($dbc,$_GET['Phone']);
28
29$CustomerId = mysqli_real_escape_string($dbc,$_GET['CustomerId']);
30
31$query "UPDATE customer SET first_name='$FirstName', last_name='$LastName', street_address='$Street', city='$City', state='$State', zip_code='$Zip', email='$Email', phone_number='$Phone' WHERE cust_id='$CustomerId'";
32
33$result = mysqli_query($dbc$queryor trigger_error("Query MySQL Error: " . mysqli_error($dbc));
34
35mysqli_close($dbc);
36
37?>
38
39<!-- http://newjustin.com/updatecust.php?FirstName=Sue&LastName=Banas&Street=123&City=Pittsburgh&State=PA&Zip=15222&Email=derek@aol.com&Phone=4125551212&CustomerId=14
40-->