2017년 7월 25일 화요일

Bubble sort


I need some help... i used the bubble sort that i found on internet tutorials
You can see the image.

But when then number which has to be sort change of dizain its cames to end of the list.
9 seems bigger of 10, it seems to keep 0 but not 10...    (1)0

Can you help me?

--
you are comparing text instead of numbers
use the numeric < or > blocks from the math drawer to compare

--
Thank you! Very quick answer!!

--

App Inventor for weather sensor




Good Morning. I have a problem in my android app. My app receives data from the 3 sensors (Light Dependent Resistor, Rain Sensor and Temperature Sensor). It's all working when it comes to sending data from the app but my problem is that I want to display an image when for ex. Light sensor sends data with the value of 1000 it means it is sunny. So I will click a button and it will display the image that I set. Then the next thing will happen is that when the sensor changes value. The current value was still there with the new value. Meaning, the old value is still there with the current value. Please Help.

--
Please help me. Thanks

-- 
What I wanted to happen is that when it receives other data like for ex. for light dependent resistor and its value is 1000(sunny) and currently its value is 100(shady). When it display the sunny image then when I click the button for showing the weather  it will display the shady image and the previous image will gone.

-- 
This might help you with the logic Justin
Chapter 18. Programming Your App to Make Decisions
One way to handle the weather icons is to use only a single image control;  when it is shady, set image1.picture to shady.png else if sunny then set image1/picture to sunny.png  perhaps.

-- 

A building error


When I try and build the app Lost_World_Cheats to get it in my phone, it gives me a long error code saying, Build failed! The request to http://newblocksbuildserver.appinventor.mit.edu:9990/buildserver/build-all-from-zip-async?uname=demondsniper33%40gmail.com&callback=http%3A%2F%2Fnb155.399631504715578945.mit-appinventor-newblocks.appspot.com%2Fode2%2Freceivebuild%2Fd6l4b3sq0af5ddvdjqv79i16bl9aeue3k40bou4yc7j7zos7disvhoswo6uhkoc4om0g3rtaccecct97der20csuqqx4lu7jbmy9ntpo6ifucw4wifgxc8d4biqnjnsnz21fssmipi%2Fbuild%2FAndroidexceeded the 10 MiB limit. The other app that I made for cheats for a different game, the layout is the same only different background an different codes, builds perfectly fine. I have no idea how to fix this

--
37 labels 12 horizontal arrangements and one player. If that's my problem than I can easily knock off 15 labels and 5 horizontal arrangements 

that should not
 be the reason 
except for the player what do you use it for
btw. you mentioned background how big is the file@Josephtry to answer in the thread instead

-- 
How big are your files in MB, mp3, background image, icon image...

And please reply in the forum in this thread and not by email

-- 

Fusion table AI2 problem


I have been away from app inventor now a while.  So, I had a fusion table app, that worked perfect, but now it won't store the datas in
the table:

I just wonder, is the  fusiontablescontrol.query command deprecated and replaced with fusiontablescontrol.InsertRow (thats what  I find differrent between pizza party aI1 and AI2)?

--
use the service account method instead of the old API key method
see the Pizza Party tutorial how to setup the service account method correctly

--

Vocal Synthesis (spoken speed problem)


The speech synthesis of the text written on the smartphone is at a speed that is too quick to speak, even if modified from the vocabulary properties menu, does not change.
How can I fix the problem?

--
see the documentation 
http://ai2.appinventor.mit.edu/reference/components/media.html#TextToSpeech and set the SpeechRate property

--

Rename project


I renamed  a project to a new name but the old name showed up as the app name when the project is built and installed in Android. It would be time consuming to redo everything again just to get a new name. Anyone knows an easy way to do it ? Also how do I choose a different icon ?

--
adjust the AppName property in Screen1



-- 
The 'icon' should be a jpg or png image and no larger than 48x48 pixels.


-- 
Thanks I know somethings simple but could not find out.

-- 

Sprites not following their code


Ive been having an issue with my program where i have 4 ships each with their own code and paths. however as soon as the gameplay screen starts the sprites just ignore the coding and move to the right and stay there and get stuck. What am i doing wrong?



--
please add a screenshot of your relevant blocks directly into this thread like this

-- 
In AlienWMove() and AlienMMove() procedures you are changing only the x coordinate of the of the imagesprite and you are not changing the y coordinate. x coordinate defines the position of imagesprite with respect to horizontal axis. So changing it will move the sprite horizontally. To make the sprite move vertically change the y coordinate.

-- 
okay what about the other two procdures? they also go to the right and stop when they reach the edge

-- 
See if you have set the Heading property in Designer view to zero and Speed to any number other than zero. If yes then the sprite moves to the right as the heading is zero (i.e zero degree above the positive x axis).Set the speed to zero and the sprite will not move to the right.

It might help if you take a look at the documentation about the properties of Imagesprite at :

-- 

Help. List csv problem!?


I use and combine the project FilebyFile_Drive and Import CSV to make the list for the variable listFilename. I get error : list to large...
Somebody can tell me where i have to look to repair the error.
Thank you very much for your time and help.



--
my guess is, the error message is "list index too large"?
so if listFilename is empty, how do you want to get a filename from that list?
you might want to import the csv file first  covert it into a list and assign it to listFiename before starting the download
--
Thank you for your help. I was trying another method, but is the same error. Why ?

--
It would really help if you provided a screenshot of your relevant blocks and a screenshot of your error message, so we can see what you are trying to do, and where the problem may be.

--
It is simple.  I want to replace   listfilename and listfiledrive with csv to escape the lag of the block  make list when have a lot of items. Thank you for your  quickly response.

--
yes, it's simple
so what prevents you from doing it?
you might want to import the csv file first, covert it into a list and assign it to listFilename, same with listFilenameDrive before starting the download

--
Ok. i import csv,convert to list and assihn to filename, but something is wrong. What ?




--
Look at where you set up global variable listFileName.

That's not much of a list.

I don't see any blocks any where else to load it as a list either.



--
Any suggestions ?

--
yes, but the suggestion is still the same...
you might want to import the csv file first, covert it into a list and assign it to listFilename, same with listFilenameDrive before starting the download
you might want to start trying something

--
I am trying, but i dont succeed.



--
I get error list index smaller than 1. Why ?
I get the list and now i must attach to variable listfilename ? How ?

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

--
Where is the File1.GotText event block to accept
the contents of //import.csv ?

--
Sorry i forgot to put the new picture. :(
I post now.
The error it says : cannot get the item 1.



--
Where is the place where global listFileName  changes from a piece of text
to a list?

--
I put in File1 got text. 



--
Why it says: List idnex smaller than 1 ?
Select list item: Attempt to get item number 0, of the list((//import.csv)). The minimum nr is 1.
Why ? Any suggestion how to fix ?



--

to convert a 1 column csv table into a list, use the split block and split at \n (new line) to get a simple list

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.

--
it does not look like you are familiar with Do it?
see the 4 here
--
You must learn the difference between a thing and the image of a thing,
the famous Rene Magritte painting This is not a pipe.

The text that came from the file may look like a list,
but is not a list.

--
Another example of the difference between things
and things that look like things ...

courtesy of the Road Runner.

--
I am but my emulator has lag, and the windows cant find my device.

--
Now i learn new thing. Thank you.

--
ok. I did.
Next what should i do ?



--
ok. Thanks. I get it. :P

--
I have spend many hours but i am not succeed. Maybe if you give an example how can i done this.  Please help !?

--
See attached.

You were wrong but lucky.

You split the text from the file at \n, and that gave you a list.
(Read the tool tip for the split block, don't believe me.)

If all there was in each line of the file was just a single file name,
that was all you needed.

You inserted a block that was not needed, forcing extra conversions to happen
behinds the scenes ...

The list from csv table block wanted a piece of text, so 
it converted the list back into a piece of text before trying
to convert it into a list of lists.

That was unnecessary.

I'll bet you could remove that block and it will still work.

--
Still not working. Any suggestions ?




--
See attached for what you have in import.csv.

It is a good idea to look at what you eat before putting it into your mouth.


--
I don't understand. Those  is the names of the files to be downloaded.  What is wrong?

--
import.csv contains a single row of items (your filenames) separated by commas (,) not new lines (∖n) ?

You are creating a list by splitting at new lines (∖n), of which there are none!

--
Thank you.  I modify this file so many times... I miss that. My mistake.  Thank  you all for your time, help and understanding.

--
I still have this error: "Select list item: Attempt to get item number 0, of the list (). The minimum valid item number is 1."
Why ?

-- 
It's time for you to get the Companion working in an emulator or on your device.

Look in the Companion and Emulator section for how to install one of
the other emulators, like GenyMotion or the Chrome add-on.

Working without the Companion is like working
with one eye tied behind your back..

-- 
Thank you ABG,Thank you All.
I start from 0.
Somebody help me to transform this lists to csv, please.
Thank you for your time.





--
I found half of the solution.
1 Picture have half of the solution.
The problem is in 2 picture. What i have to change to work ?



--
Read the file using a file block.
Use the Do It to see what is in the global list.

--

Can I use Wifi-direct(Wifi P2P) in AI2?


Wi-Fi peer-to-peer (P2P) allows Android 4.0 (API level 14) or later devices with the appropriate hardware to connect directly to each other via Wi-Fi without an intermediate access point (Android's Wi-Fi P2P framework complies with the Wi-Fi Alliance's Wi-Fi Direct™ certification program). Using these APIs, you can discover and connect to other devices when each device supports Wi-Fi P2P, then communicate over a speedy connection across distances much longer than a Bluetooth connection. This is useful for applications that share data among users, such as a multiplayer game or a photo sharing application.
Now, I wonder I can use Wi-Fi peer-to-peer (P2P) in AI2? any ideas will be welcome.

--
App Inventor works only up to API level 3 currently, being upgraded soon to level 4.  Probably not possible.


--
Thanks for your reply! 

--

Center Screen Title


Being a new user and still learning I would like to know if it Is it possible to center the Screen Title.

--
Sure!
Drag a Web component into the designer. Use the block HtmlTextDecode and enter this html text:
<p style="text-align: center;">MY APP</p>

-- 
That is not an answer  to the question. You can center the screen content, but without trying I am not sure it includes the title. Try it!

--
You could hide the Title (Screen 1 properties), then recreate it with a label.

Sadly centering is not in Taifun's excellent Tools extension (yet? - you might want to sponsor it if it can be done)

-- 
|Ivan wrote:
|Hi Nico,
|
|Thanks for your idea, however it didn’t |work for me.  The solution I tried was |to hide the screen title and then add a |label with the title in the label.


Yes, that's the best idea. Set in the label HTMLenabled to true and enter the HTML Text above in the Text property of the Label.

--
@Tim Carter
You're right, that's a good additional function for TaifunTools!

--

search results for Server Error - Could not upload file


Sometimes the file is save, despite that error message, so check. It this happens persistently, please ... Could Not Upload File. Please Try Again Later.
Speed was ok. Apologies. Am working on Mac, not my normal env. There are two users on this machine. The file was created under other user's ...
@David: what you can do is to open the bly file with a text editor and remove these very large comments carefully, then save the project and upload it again. and: if you use Do it, you also can delete a created Do it comment again if you do not need it anymore... see also the following links which help you ...
For this case, please attach the project file that cannot upload. We don't plan to do ... Server error: could not upload project. Please try again later!
It's not working. The problem is that when I try to import the .aia file into MIT App Inventor, I get an error message "Server error: could not upload project ...
... I'm trying to send a archive .mp3 to my project, but I'm not having success and this message is showing up: Server error: could not upload file.
I've been attempting to upload an image but always appear Server Error: could not upload the file. Please try again later !. what's the problem with ...
app save .apk to computer. not respon and server error:could not upload file.
I can't seem to load my recent project and I don't know what the problem is. Is it a general server problem or is there something wrong with my file?
I just got this error message when trying to uploading a media, but my connection was fine! No any problems at my internet connection. Probably ...
I always get a "Server error: could not upload project. Please try again later!" after trying an upload. First of all, I thought that my aia file was corrupted, ...
"Server error: could not upload project. Please try again later!" when I click on ... way to create an .aia file from an .apk file? How can I find out what the ...
Import .aia file, but got . The file size is quite small. Server error: could not upload project. Please try again later!
ListPicker, properties, when uploading an .ico file this error is displayed: Server error: could not upload file. Please try again later!
Hello, I have already asked about this, but I have not received a solution that works, so I am enquiring again. I am using MIT App inventor 2
There is only one way of knowing if it works or not. ... If the MIT server times out is the Google Play server going to > time out when I try and upload the project there ? ... Maybe taking out a few assets of the aia file >> and uploading them again after the project has been loaded could do >> the trick.
Also it would not hurt to look into a solution for large numbers of assets. Here is an idea. What if there is a message once the assets reach a certain limit that ask the user to export the current assets in order to upload new ones.
I have made no changes at all to the project since my last post. However, I took the aia and tried to upload it to the test server. The test server refused ...
Server error: could not upload file. Please try again later!
Yes, I do have an earlier .aia source file. ... I realize that this discussion has gotten abstract but I am not able to export these specific files from the server to send to you... I work in other ... I had to upload a keystore file from AI classic to keep an older app current on the Google Play Store. Could that have ...
However, when I tried to upload my aia yesterday, it said "Server error: could not upload project. Please try again later!" So I waited 24 hours and tried ...
not filled. 2) Your source file (the aia file) is larger than the 5Mb limit allowed in AI2 (the aia can not. be larger than 5Mb). You may have put images or .... developing on the device, upload the latest Companion from Google Play.
I've been attempting to upload an image but always appear Server Error: could not upload the file. Please try again later !. what's the problem with ...
try to upload your latest backup (aia file) to see if that works... Taifun.
Server error: could not upload project. Please try again later!" My project is a big poject (2,22 MB) (file *.aia) on my computer. Please help me!
... is NOT saved" mean? You cannot create QRCodes (to upload the apk to your device?) . ... 2) Your source file (the aia file) is larger than the 5Mb limit allowed in AI2 (the aia can not be larger than 5Mb). You may have put images or ...
I was wondering whether or not someone could help me out with a problem I am having. Basically, the only thing that my app does right now is take a ...
每每當我要上傳影片時都會顯示 (Server error: could not upload file.)請問要怎麼 處理?
Server error: could not upload file. Please try again later! pls help !!