2017년 6월 5일 월요일

MULTIPLE screens app with only 1 screen! using different layout arrangements.


MULTIPLE screens app with only 1 screen! using different layout arrangements.

Use multiple arrangements instead of multiple screens and add a interesting scaling effect to change between different layouts.
tutorial for #thunkable #appinventor #appybuilder
The idea came from user "Brainwork" from Thunkable forum, thanks mate!

The idea is pretty simple, let's suppose you have 3 "screens" 1 with options, 1 with main menu and one for the main app , the app itself. Instead of having multiple screens you can use different arrangements used as containers for your different "screens" , when menu is visible the others are invisible, or when app is invisible menu and options are invisible. The cool thing is the "animation" added from the previous rebound tutorial. So this is a multiple screens tutorial without multiple screens. 
Hope you find it useful. Please share it with your friends!


WAnt to learn about:
making lists in app Inventor? 
https://goo.gl/hWKp7z
using " for each" loop
https://goo.gl/fS5aGt
Mario Run Game in App Inventor
https://goo.gl/XtKoej

From MIT's App Inventor and YCombinator's W2016 batch, Thunkable allows anyone to build powerful native apps. With Thunkable, it's simple to design, and simple to code-- simply drag and drop to create fast, native, reliable apps.
Thunkable makes building Android apps easy for everyone.

Una de las opciones más sencillas para crear aplicaciones nativas para Android, sin aprender programación, es sin duda MIT App Inventor. Ahora llega Thunkable, basada en la primera, que de igual forma es una excelente solución para los que dan sus primeros pasos en el desarrollo de aplicaciones para Android.

Crear apps con Thunkable es realmente sencillo, sólo tenemos que configurar su apariencia, incorporar los distintos elementos de la interfaz y programar las acciones y eventos en un editor de bloques, sólo hay que arrastrar y soltar.

Be my patron: 
http://patreon.com/AzaotlTutorials 
Like my Facebook Page: http://www.facebook.com/azaotl

MIT App Inventor is an innovative beginner's introduction to programming and app creation that transforms the complex language of text-based coding into visual, drag-and-drop building blocks. 
#multipleScreens tutorial


--

RadBeacon USB install


I purchased a RadBeacon USB from Radius Networks and iBeacon Locator on my Nexus 7 says the calibration is: -59. My iPhone 5s sees it, the measured power is: -64, so I press OK to copy this value to the Measure Power field of the beacon settings. You must apply the settings to update the Measured Power on the beacon device. So I press Apply and use the PIN 0000. Apply Settings. It says "Invalid PIN". I use my 4 digit PIN that I use for everything and it says "Connection timed out".
Now in the instructions it says "If you are unable to discover you beacon using the RadBeacon Config App, remove the plastic cover and firmly press the configuration button above and to the right of the battery holder. This will restart the 30 minute configuration window and your beacon should show up in subsequent scans.
1. Define firmly.
2. I didn't think it had a battery. What is a battery holder?
3. Does this button give any kind of tactile feedback when pressed so that I can know that I'm pressing it?
4. There's a square opening on the top-right of both sides after removing the metal cover. Is one of them the button?
5. Is there a product that doesn't have this 30 minute restriction so that I can get it to work the first time as a proof-of-concept, and not have to worry about it being bricked after 30 minutes?

--
Sorry you are having trouble.
You are correct that your RadBeacon USB does not have a battery. We also sell a RadBeacon tag, which does have a battery and it sounds like you are reading the instructions for that model. So please ignore those instructions.
To restart the config time window on your RadBeacon USB, simply unplug it and plug it back in. Then try using the iPhone RadBeacon app to configure it using the default pin of 0000. If it does not accept that pin, and you did not change the pin to something else you remember, contact us at support@radiusnetworks.com and we will arrange a replacement.
Understand that the configuration time window is simply a security feature to keep other folks from trying to reconfigure your beacon. You can always restart the time window by cycling power. So you don't need to worry about bricking your device -- just be careful not to change the pin without writing down the new number.

--

splite the string with ";" to json and how to translate the json to string wi


in the php & js ,
i can split the string post or get to the url as http://abc.com/index.php?selectlist=1;2;3;4;5;&&userid=55555;
in js i can:

$("#abc' tr").each(function(){ 
$("#'abcstr").val($("#abcstr").val()+";"+$(this).attr("value"));
   });
var url3="'.U('Cosplaymanagerview/get_cosplaylistfilterlevelajax').'";
$.post(url3, {
getwhat:"grouplistne",
cosplayid:$("#editcosplayid").val(), befiltergroupidarray:$("#abcstr").val()},function(Result,status){ arr3 = [];

for(var key in Result) 
{ arr3.push({text:Result[key].groupid+Result[key].groupname,id:Result[key].groupid});
liger.get("abc3").setData(arr3); }); }

in php i can :
$befiltergroupidarray=explode(';',$befiltergroupidarraystr);

i just to ask the question is how to split the string with ";" to json/array   and how to  translate the json/array to string with ";"    in AI2  how to do this? thanks!

--
If you want to build a string 1;2;3;4;5 from an AI2 list L of 5 items 1,2,3,4,5
you would run the list through a csv from list block, then
through a text block that replaces all "," with ";".

Use the text JOIN block to build the URL from the pieces of text, adding more sockets using the blue square.

To pick out the 1;2;3;4;5 from the URL, see https://puravidaapps.com/snippets.php#2parse
parse.aia
and to turn it into a list, reverse the process I described above.


-- 

How do I send pictures taken by the camera to the text of the email?


I use camera elements to take pictures, and use the activity element. I want to "photo" to the text of the text, but app inventor will only send pictures of the link, how can the "picture" to the e-mail in the text?


--
you can't send attachments with the activity starter solution
choose one of the other solutions


-- 

Teleduino


Introduction

Teleduino converts your ethernet enabled Arduino into a powerful and versatile tool for interacting with devices over the internet. Not only that, but it makes it quick and easy.

Teleduino is now available for the Arduino Mega range of boards!

Once your Teleduino is configured, it automatically connects itself to the Teleduino server when powered on. The Teleduino server translates instructions received from the internet into actions on the Teleduino device.

Using the Teleduino platform, you can perform the following tasks with your Arduino via the simple web service:

⦁ Reset, ping, get uptime, get free memory.
⦁ Define pin modes, set digital outputs, set analog outputs, read digital inputs, read analog inputs, or read all inputs with a single API call.
⦁ Define up to 2 'banks' (4 for the Mega) of shift registers. Each 'bank' can contain up to 32 cascaded shift registers, giving a total of 512 digital outputs (1024 for the Mega).
⦁ Shift register outputs can be set, or merged, and expire times can be set on merges (you could set an output(s) high for X number of milliseconds).
⦁ Define, and read and write from serial port (4 for the Mega).
⦁ Read and write from EEPROM.
⦁ Define and position up to 6 servos (48 for the Mega).
⦁ Interface with I2C (TWI) sensors and devices.
⦁ Set preset values for the above functions, which get set during boot. 

Preset values are stored in the first 178 bytes of the EEPROM (413 for the Mega).

Teleduino on MIT app


Hello there. Im using teleduino webserver to control my arduino uno and ethernet shield. I do project to control relays using arduino. Teleduino provide me url to switch on or off the relay. i've already make a simple design and block diagram and when i try lunch through emulator and press the button it's said error 1101: unable to get respond (link). i got attach my block design. anybody can help me to fix it?

--
The best way to debug such a thing is to type the url you are creating in a browser and see what happens.
You did not provide blocks about what happened when the request is complete, like the GotFile event (if you set save response), this can also help debug.

-- 
If you want to open a webbrowser on your phone, you should use the WebViewer component and not the Web component.
If you want to retrieve text from a website, you can use the Web component, but you must use the SaveResponse attribute set to true and use the GotFile or GotText event blocks.

-- 
You wrote:
<<
What u mean by retrieve text from website?
Is that mean i just press the button that link to url but not opening the webrowser?
Is there any guide to that?
>>

Please do not send me private email!

Look here: 
www.appinventor.org/bookChapters/chapter24.pdf


--

AI2U keeps building the wrong, old apk


I have a big app of 19MB.
I can't build the app to an apk so I use the offline version of MIT app inventor 2.
When I build the big app (offline) and I transfer the apk to my phone, it just stays installing an old version of the app, not the newest one.
How can I fix this?

--
This is the wrong forum to ask.
Here we would try to convince you to fix your app and make it smaller ;-)

You can maybe try here: https://groups.google.com/forum/#!forum/ai2u

-- 
Well, I fixed the problem, but now I have a another problem: when I install the apk on my phone, it installs just the old version, without things I changed.
Is this the correct forum to fix this problem?

-- 
Ok, thanks!
-- 

how to get a json split to the checkbox multiselect


1,how to get a json from url split to the checkbox multiselect item


2,and how to post a  json from the  checkbox multiselect item  to a url?

--
You will have to be more specific about what your json should look like and what your checkboxes look like.
Read also: Working with XML and Web Services (XML and JSON are used similarly in AI2)

-- 

Working with XML and Web Services


The Web.XMLTextDecode takes a given XML text string and decodes it to produce a list.   If the text is not well-formed XML, it will signal an error and return the empty list.
The list returned by XMLTextDecode contains one pair for each top-level tag-delimited structure in the input string.   For example, decoding
<hello>123</hello>
returns the list of one pair (hello, 123) and decoding
<hello>123</hello>
<goodbye>456</goodbye>
returns the list of two pairs (hello, 123) and (goodbye, 456).
For each pair, the first element is the tag, and the second element is the decoding of the string delimited by the tag.  Here are some examples:
Decoding
<hello>everybody</hello>
produces the pair (hello, everybody).
Decoding
<hello>everybody out there</hello>
produces the pair (hello, everybody out there), where the second item in the pair is a string “everybody out there” that contains spaces .
Decoding
<greet>
   <goodbye>nobody</goodbye>
   <hello>everybody</hello>
</greet>
produces the pair (greet, data) where data is a list containing the pair (goodbye, nobody) and the pair (hello, everybody).   The pairs in a decoding are listed in alphabetical order by tag, regardless of their order in the original input sequence.  Each pair consists of the tag, together with the decoding of the data delimited by that tag.   As this example shows, if the items delimited by the tag are themselves XML-delimited text, then the data items for the pairs in the decoding will themselves be lists of pairs.
If the XML string contains both delimited and non-delimited items, then the non-delimited items will all be extracted processed as if they had been a sequence of items delimited by the tag “content”.  For example, decoding
<greet>
     <goodbye>nobody</goodbye>
     happy
     <hello>everybody</hello>
     sad
</greet>
will produce a pair just as in the last example above, except that the list of pairs will now include an additional pair (content, (happy sad)) where the second item in the additional pair is the list of strings “happy” and “sad”.

XML and Web services

Many Web services have APIs that return information in XML format.  To process these with App Inventor, you can decode the result with XMLTextDecode.  Then extract the desired items from the resulting list, using the list operation block  lookup in pairs.  Here’s an example.
Weather Underground’s Weather API is a free service that you can query for weather information at specified locations.   We can use this service use this together with the App Inventor Web component to retrieve the Fahrenheit temperature in San Francisco.   We start by getting the complete weather for San Francisco, by doing an HTTP Get with the URL:
http://api.wunderground.com/api/YOUR KEY/conditions/q/CA/San_Francisco.xml
You’ll need to replace the string YOUR KEY by an actual key that you can get by registering with the Weather Underground Weather API service.  See the Weather API documentation for information on how to do this.
Note: The Weather API can also return information on in JSON rather than XML, which App Inventor can manipulate using the Web.JsonTextDecode block, leading to an example similar to the one described here, but done using JSON.
Here are the blocks that perform this GET when a button (GetWeatherButton) is pressed.   When the result is returned, we set the text of the label SFTemp to the temperature.


The main work is done by the procedure extractTemperature.  It processes the response from the Web service to extract the Temperature.   The Web service response is a complex XML structure like this:
<response>
 <version>0.1</version>
 <termsofService>...</termsofService>
 <features><feature>conditions</feature></features>
 <current_observation>
        ...
        <temp_f>68.2</temp_f>
        <temp_c>20.1</temp_c>
        <relative_humidity>66%</relative_humidity>
      <UV>1</UV>
        ...
 </current_observation>
</response>
(There’s a lot more in the structure that is not shown here, as indicated by the ... .)
Decoding this with XMLTextDecode produces a list, where the sublists correspond to the delimited XML substrings.  Observe that the order of the sublists does not match the order in the XML text: it is now alphabetical by tag (case-sensitive order):
((response
   ((current_observation
      ((UV 1)
        ...
       (relative_humidity 66%)
       (temp_c 20.1)
       (temp_f 68.2)
        ...)
      ))
    (termsofService ...)
    (version 0.1)))
We can extract the temperature in the following steps:

⦁ begin with the list above, which is a list of pairs (with only one pair)
⦁ extract the data that is tagged with “response” to get the list of pairs ((current_observation) ...)
⦁ from the result, extract the data that is tagged with “current_observation” to obtain another list of pairs ((UV 1) ... (temp_c 20.1) (temp_f 68.2) ...)
⦁ from that result, extract the data that is tagged with “temp_f”
⦁ the final result is the temperature


Notice how this procedure is structured with successive calls to lookup in pairs, each lookup operating on the result of the previous lookup.  The procedure is written in the way it is, with successive assignments to the local variable answer, to make it convenient in App Inventor  to build up the procedure step by step, starting with the [do ...] block empty, add the next
 [set answer ...]  block at each step, while checking the result at each step.  Constructing procedures step by step, while checking intermediate results, is a good idea when extracting data from complex XML structures, where there might be many steps and it’s hard to get a procedure correct on the first try.