2015년 1월 6일 화요일

Server connection problem - if 40 students try to connect at the same time....

Hello. I'm an informatics teacher in Korea and now I run some teacher training course with AI2.

There are 38 teachers who want to learn AI and they are all in one classroom.

Today, I told them to connect to AI2 website (http://ai2.appinventor.mit.edu) with Chrome, only half of them succeeded to reach the AI server.

Teachers who could not reach the server tried again and again, but some of them (maybe 6 or 7) could not connect to the server.

And some teachers who connected to server said that their session had expired and they had to reload the page. And some said the server did not answer their command.

Obviously, it is not the problem of network of the classroom. It is built for computer training so it has a broadband network for learning. When they tried to connect other server, it went well.

I think there is a connection issue when many computer access simultaniously.

I want to know what's the problem because I want to use AI in my programming class with students. Generally, there are 20 to 35 students in one class. If there is a connection problem, I have to change the tool, even though I like AI.

Please notice me how to solve this connection problem. 

  • Chrome said "connection time out"
  • When I tried to connect another computer outside the classroom, it worked well.
  • Some teacher close the web browser, other teachers can connect the server. 



1) you said you have a fast connection.  Perhaps this is a firewall issue.   Here is an experiment:   have everyone use their browser to go to a different Web page; can they do that successfully?   If they can not ALL go to that same Web page, have 1/3 of the class navigate to one Web page, 1/3 to another and 1/3 to yet another.  Can ALL of them load the web pages they were assigned to visit?

If the students can not ALL visit a different web page successfully the problem is probably with the school network...some limitation..see your IT department for help.
If the students can not ALL visit 1/3, 1/3, 1/3 you are probably dealing with a limitation on the number of users.

You comments "Some teacher close the web browser, other teachers can connect the server" seem to indicate there is a limitation on your network to how many individuals can be logged in from that particular network.   It might be something else.  We do know that instructors handle a class size of 40 students with no serious issues so we are interested in what might be the problem too.


Please answer the questions, read the documents and let us know the results.   If you still can not get ALL your class logged on, tell us more please.



Help! I'm stuck with this formula

I want to make an app so you can quickly see how much you need to produce something else through recycling. But I cannot seem to get the formula right.

I want to make something like this:

Textbox.1 (number of recyclable objects) Listpicker 1 (objects itself like old cars, cans etc.)

Textbox.2 (number of produced objects)   Listpicker 2 (new products cars, bins, cans etc.)

Calculate button

so you can calculate al sorts of things to get kids interested in recycling.

the formula is supposed to be something like this:

textbox 2 = textbox 1 x 20.000 (listpicker 1 + and listpicker 2 are choosing this value (1 car makes 20.000 cans for example) how do i make this?)

like a sort of converter i tried to make something like this but i can't make it work can anyone tell me what i should do? because i dont know what i am doing wrong. I watched the tutorials and i have a know what i am doing but it is not working for me.



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.




simple example i am trying to get it when i have 1000mm and i want to know how many meters it is how can i tell my computer it has to convert it to :1000 when mm to m is true?


Store data in other screen

I'm doing a botanical App has stored a number of plants where each one has different fields such as weight, height, temperature and relative humidity.

For example ListPicker I select a plant of interest:

Plant: Sunflower
This is me visualize the specific fields of this plant:
Weight: 110 g
Height: 75 Cm
Temperature: 25 ° C
Humidity: 90%

As I need to make new measurements then the previous values will be overwritten by new readings. But how do I use a button that says "new reading" then I open another screen so you do not have to reselect the plant of interest but when the screen is opened recover from automatic way the plant previously selected and there already you can record the new readings for later storage.

Any suggestions as might happen?



first do the tutorials http://appinventor.mit.edu/explore/ai2/tutorials.htmlto learn the basics of App Inventor, then try something and follow the

Data gets updatet wrong from the TinyDB

I'm programming an app in which you mine some coal, sell it in a shop and buy stuff with the new money (At the moment only a worker). I wanted to tel the app that it should update the text telling you how much money and coal you have every second to a value in TinyDB. Sadly, if you sell some coals you get the money, and lose some coals though after the clock ticks it's reset to the amount aou had before. I've tried to set the timer updating to 5 seconds but the same happens every 5 seconds after that. I've looked through the code but can't see why this would happen.

I appreciate that you've read to this point,

PS: I've added the .apk of my app as attachment.




Please post your screenshots directly here on the forum.  Most of us don't want to go to some unknown link...



Open for every action a new TinyDB 
TinyDB1 for Coal
TinyDB2 for Money
TinyDB for Work Amount



@kristijan: there is only one TinyDB in your app
@Vladis: It would really help if you provided a screenshot of yourrelevant blocks, so we can see what you are trying to do, and where the problem may be.


How to install MIT App Inventor on my own server?

I was looking arround, but I didn't found another topic answering for my question.

I downloaded the source code (http://appinventor.mit.edu/appinventor-sources/) and extracted the files, but there are a lot of folders and files and I don't know how to set it.



Cross Screen Interaction(Shop screen and Play screen)?

Hi. Im making my first game currently and i have 2 screens, Shop screen and Play screen. In the Shop screen you buy upgrades which should for example make the speed of a bullet larger by +4.
Buying an upgrade is in my shop screen, and the bullet is in the Play screen. How do i make the upgrade on one screen make a change on the other?
BTW for upgrades i am using Buttons with images on them and when you click on it it shoud take 10 of your credits which you  earn by playing the game, and in return incrase the speed of your bullet.
Thanks in advance. Please help me.



use TinyDB



Thanks man ill give it a go :)


TinyDB

I need to create an app where i can select the date, or it selects today's automatically and then
display a code associated to that date. We have an access code for each day and i would like to
pre-program the tinydb with the codes for each day. Is there a way to import the codes as i have 265 codes
to associate with each day of the year.



yes, you can use the file component, see this answer for a similar problem



One way to do what you want to do does not involve a TinyDB at all.

1) Create a csv file with 365 or 366 codes:   xyz, abc2, w5ad3 ....    and use File to load it in a List called    MyCodes.     An easy way to do this is to put all your codes into an editor like Notepad, then select the entire list and drag and drop it into a Text block.       set MyCodes to  ...that Text block.

Then use the Clock component to figure the day of the year (day number).     Use the day number to associate with the items in the list.


xbmc/kody json post, please help

Hi, i have two llinux. The first one, as a homeserver and a second with XBMC/Kodi. If i execute this on the first one:
curl --request POST --data '{"jsonrpc":"2.0","method":"Input.Left","id":1}' -"Content-type:application/json" http://xbmc:xbmc@192.168.1.54:8081/jsonrpc

Works right. But if i try this:
it doesn't works, allways respond with a 401 error :( I think that i need the header "Content-type:application/json" ... or something ... please help me.



i have somthing working

send me a mail on richard6360@gmail.com and i wil help you further.



and what prevents you to use a header?

RequestHeaders
The request headers, as a list of two-element sublists. The first element of each sublist represents the request header field name. The second element of each sublist represents the request header field values, either a single value or a list containing multiple values.

and an example see here https://puravidaapps.com/spreadsheet.php

@Richard: why don't you just answer the question in the forum? Also other users might be interested in your answer. This is how a forum works.




Try it without the first and last '

and without any password parameters
this is working in kodi

{"jsonrpc": "2.0", "method": "Player.PlayPause", "params": { "playerid": 1 }, "id": 1}



@richardvansoest  thanks!!!!! it works


coding

trying to code a morse code app for a high school project, but cant figure out how to get a string of text to be translated. I got individual letters to work, but anymore than one letter wont work. is there a way to split the text into individual characters and go from there? keep in mind i am new to app inventor.



Hi Brian.   What are you attempting to do?

Convert a string of text     like a b c d     to dots and dashes   . -   _ . . .   -.-.     or play the sounds of morse code.
What you want to do probably can be done several ways.

1) Using  the text  length block.   Check the entire length of the text.  That tells you how many characters in the screen, then use the length to identify the first character 1, the second character 2  and so on.    If you want dots and dashes,   write out the code in a list, with each character of the alphabet   A, B, C, D ....   then write a second list  with  . -, -...,-.-.,-..    for example, then when you cycle through the length of the screen   use the look up in pairs blocks to associate the two lists, the actual characters and the dot dash character representation.   When list item 1 is  Q  have the App print --.-     and so on.   You could print these to a string by using the Text blocks and a join    or directly to a label.     Remember, you will have to handle spaces between words.

2) Create 26 sound files with the Morse character tones plus punctuation?    Instead of having list 1 point to a dot dash sequence, have it point to a sound file and use the sound file to play it?


The AI2 free online eBook   http://www.appinventor.org/book2 ... the links are at the bottom of the Web page, will help you to learn to use the blocks.

Try some stuff.   If you have issues, return and post a screen capture of your blocks and describe the problem.  Someone will provide advice.

73 and have fun


Please enter a vaild order

I have the table id, keyfile and service account email

I have tried to combine the party pizza app with the how to use the serviceaccount. 

on the emulator which has been updated the submit button doesnt work if i add a name and a comment.  If i leave these two out and press submit i get "Please enter a valid order'

i have attached screen shoots








in the initialize event you still assign the keyfile to the webviewer.HomeUrl, that obviously will not work...compare again with the example here

 the submit button doesnt work if i add a name and a comment.  

check your if statement in the ButtonSubmit.click event




I have checked over the if statement in the ButtonSubmit.click event.

It is exactly as the example in the party pizza tutorial



use Do it to debug your blocks, in your case the values in your if statement...



hi  I can not figure it out, how to make this statement with the button submit

Do It

You can perform the action for a block with Do It . In debugging a program like MoleMash, you could select Do It for MoveMole and see if the mole moves on the phone.
Do It not only does the block's action, but also puts up a balloon that shows the value returned. The figure below shows the use of Do It on an addition block to show the result of addding two numbers called this and that .

Result balloons are attached to blocks at a point indicated by a small equals sign. You can click on the equals sign to hide and show the result. Moving the mouse away from the block makes the result balloon go away.  



see tip 4 here

Top 5 Tips: How to learn  App Inventor




I did manage to find the function on a mac. it didnt change. please see attach im still getting the error sign.... Secondly, is it possible to Re-name the Screen1





Please see attachment with DO IT string

Will app work... it seems to work with just one screen when i add another it does not function




as already said earlier, in the initialize event you still assign the keyfile to the webviewer.HomeUrl, that obviously will not work...



do you remember: you already mentioned the same problem in your other thread https://groups.google.com/d/msg/mitappinventortest/t7tOrtMOPYE/M9Id0OqpWcMJ
do it step by step and fix that issue first before continuing

this is wrong


this is correct



please see attach 

it just not working




I already asked this in your other thread but probably I misunderstood your answer?
did the example (see link) work for you?

How to use the Service account option to connect to a Fusion TablesFusiontable




the problem in the end was 
1. you forgot the space after INSERT INTO
2. you wrote "Tyre Width" without underscore instead of Tyre_Width for that column name

unfortunately the error message does not help at all in this case for the service account method... remember the error message is just "Error" (see screenshot)...

for the API key method, the error message would be something like this "400 Bad Request Invalid query: Parse error near 'INTO..." @MIT: could you change that and provide a better error message for the service account method, too?




If possible, could you generate a and send a simple example that exhibits  this problem?    All App Inventor is doing here is passing along an error message that came back from a lower level module, so it would be good to have a clear repeatable error before I ask someone to dig into this.



you can use the attached simple example, just modify the select statement to get an invalid query and remove for example the space after FROM to get the "Error" result
Taifun




ip camera app


I want to build a ip camera viewer, only for use not for sell..and without commercials.
what I want is I have some ip camera's and one ip doorphone (m different brand.) but I want to use 1 app.
the most important is the ip doorphone..
it have 2 ip address both I can do the same with.
it give a image and the door button is a I/0 from the camera and the door open button is also a I/o from the camera.
the original software is very un stabile becours I have to connect to a server and lose many time connection..
so thast wy I want to build a simple app
to view that cam... and use the both I/o
can some one help me.. ore do some one have a template ore tutorial how to start..
I tried different thinks.. video stream but get I/o error , web viewer...but I get stucked..
so I hope some one can help me..

--

App at background

The complain is that you cant use the app at the background.

You allways need to have you screen unlocked to use the app. I hope you could add a feature that you can run the app at the background.



star issue 32 https://code.google.com/p/app-inventor-for-android/issues/detail?id=32

to star an issue means, to click onto the star in the upper left corner of the issue to vote for it and to get an email in case there are news


displaying live camera feed


Can someone help me in displaying live camera feed inside a box in the app please.

--
How to stream a video using the videoplayer component by Hal


--

Thanks but it didn't answer my question, because I want to show the real time feed from my own camera on my phone.
Is it possible?

--

Yes it possible!
It depend what media you OWN camera send out. That mean how it configuration is made.
You can conf. it differently, it depend what camera you have.
If only  .jpg pictures: Sample: http://www.veebikaamera.ee/fl/live/teletorn_1_levira.jpg it easy.
or rtsp stream:
or .m3u8 stream:
Some streams are playable through AI2 Video Player but some you need to play with Activity Starter.

--
Thanks,
I mean the camera of my phone.
I want to make an app for my galaxy s5 that shows what the camera sees.
Is that possible?

--
in this case the answer is: unfortunately not possible, you can't access the camera to take a picture or show what the camera sees programmatically

--

apk loading only after deleting APPINVENTOR directory!

I just completed my 1st app with AI - just so impressed (especially in comparison to Android Studio!)

The testing worked fine but installing the app not :(

I came across:

https://groups.google.com/d/msg/mitappinventortest/i2cMfzygxR8/eqY8ns-PBy4J

and low and behold: deleting the APPINVENTOR directory worked - my apk installed immediately :)))

I thought this might help others but was not able to post this on the linked post,

so hopefully this will help someone :)


Ad inserted, but error when click on it

I've inserted ads with leadbolt in my app and it's ok but when you click on the ad I expect to be redirected to the web announced. Instead, it appears an error saying "You don't have permission to open this web". I attach screenshot with the mistake and the blocks added, maybe there's something missing there. Any ideas?