2017년 4월 22일 토요일

display a web page


I want to display a web page using a button click. How to I do that?

--
This example uses ActivityStarter
This one uses the WebViewer
Both work well.

We want you to have fun with App Inventor so here are some resources to help you learn to use the AI2 tools  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  .

Does this help you program.    Please continue to ask questions here however if you read the information above, you will not have to wait for answers.

Just try some blocks John and have fun.

--

Collect Data via DeviceHub.net API


 followed this wonderful tutorial and successfully programmed my NodeMCU (ESP8266 WiFi board) to post data onto DeviceHub.net, but I am having trouble scraping the data from DeviceHub.net onto my Android phone via MIT App Inventor 2.
Basically when you set up an account on DeviceHub.net you add a project, device, and sensor and they give you an API key as well as device UUID. I used this info to successfully post data onto the database, but I can't retrieve it with my phone, because I am not sure how to implement the API key. I want to be able to open the app and grab the last data point that was entered on the phone. The link I used in the Arduino IDE code to post data to was like this:


but it had an API key header.

Here is what I have so far for MIT App Inventor 2 (obviously with the info filled in):

Basically, whenever someone hits the "Refresh" button I want to grab the very last data point that was stored onto the database by the NodeMCU module. Again, I really don't know what to do with the API key. When I paste the URL into my browser I get {"detail":"Authentication credentials were not provided."}

Any help would be much appreciated.

--
The capitalized words in the URL are probably meant to be replaced by actual values for your project and device,
as registered at their web site.

Notice how they appear twice, once capitalized and another time lower case.

If that doesn't help, post your sketch code here too.

See the Web Services section of this FAQ:

If you get it working, come back here with your solution and I'll add it to the FAQ.
That's a nice tutorial.

--
Yes, I just left those unfilled so I wouldn't give away my API key and the other info (heard it's bad practice). I filled those all caps places in and successfully was able to push data to the database.
I think I am very close to getting the app side figured out, I am trying to parse through the web response.

--
I finally got it working!

What I did was I had to add a "Request Header" block to include my API key. Then I used the HtmlTextDecode block and from there I just split the data to get rid of delimiters (quotation marks, commas, etc) so that everything was spaced out by exactly 1 space. From there I found a starting and ending index in which the actual number I want has to lie within. Here is the updated block diagram:

Since I only needed the last value, I added "?limit=1" at the end of the web URL's that have the whiteouts. This makes it so that we only receive 1 value, and it made the app a lot faster.
As I mentioned before, for the NodeMCU part for POST and GET to the API, please see this great tutorial that I followed

Hope someone will find this useful!

--

How to notify user if the app is not connected to Wifi?


How to notify user if the app is not connected to Wifi? 

--
What I wanted to happen is that when I click a button at the same time when my app was not connected to wifi I want to be notified that my app was not connected then, when I receive data from wiifi and I click the button there is nothing to happened.

--
If you want to check the internet connection follow the guide here :
http://www.imagnity.com/tutorials/app-inventor/check-internet-connection-in-app-inventor/

If you want to check if the device is connected to a WiFi network , use WiFi Manager Extension by Taifun:

To download the extension use the link below:
http://puravidaapps.com/wifi.php


com.puravidaapps.TaifunWiFi.aix

(added to Web Services section of my FAQ)

--

Save a generated barcode as file


I generated a barcode with a taifun extension. But for it's just shown in a webviewer. It's not possible to store the barcode in a file.

As I noticed that google "chart api" is deprecated, has someone an idea how to save a barcode? 

I also tried to make a screenshot and then crop the image but this doesn't work because of all the different screen sizes of smartphone devices.

--
use the Google Charts API instead https://google-developers.appspot.com/chart/

--
What can you do with a bar code image in a file?

Why not just save the text?

--
...send, print, share it to others, use it in advertisement...

--
Sorry, but I don't understand your answer respectively links. Could you please give me another hint?

--
For saving, get the barcode result, create a new barcode image and set it as background of a canvas and finally save it, irrespective of any screen size

--
Also, if you would be OK with qr codes see here (courtesy of Hossein):


and some blocks, which give an idea of how to save the canvas
--
(added to Web Services section of FAQ)

--

Q&A for Web Services Examples


Fusion table database query error


Hi, Can anyone please tell me how to solve fusiontable query error 2601

--
tRIED EACH AND EVERY THING qoutify, sql query  etc but nothing worked same issue again and again.  check every spcae as well...

-- 
It would really help if you provided a screenshot of your SQL query including Do it result, so we can see what you are trying to do, and where the problem may be.

--

-- 

-- 
it seems to be, you do not know how to use Do it...
see tip 4 here 
Top 5 Tips: How to learn App Inventor

also you still did not quotify your value in the SELECT statement
also in case there are spaces in column names, you also have to quotify those column names
btw. you could have found these frequently made errors also after reading this


... WHERE 'Email Id' = 'sarahkan@gmail.com'

same for 'Your Name'and 'Contact Info'
-- 
It worked thanks

--


Trying to create a Link on app inventor 2


I'm trying to create a link in my app but I don't like the look of having an empty button box on the screen, Is there a way for me to make a link to a website using the label palette? Any help is greatly appreciated.

--
You mean that you want to color a part of the label blue and link to a website, or?

-- 
More or less

--
This isn´t possible without a button.

-- 
Do you want a label when clicked, do something? if so, use a button and make its background color to "none".

-- 
Or change the visibility of the button until you need it (so when you "make the link" the button appears

-- 

Como descargo extension File (How do I download Extension File) ???


I AM TRYING TO DOWNLOAD THE FILE EXTENSION FOR MY MUSIC PLAYER APPLICATION AND UNTIL NOW I CAN NOT DO THE PAGE DOES NOT WORK AND DO NOT CHARGE ME PLEASE!
AND SOMEONE KNOWS HAPPENING INFORM ME

THANKS GREETINGS

--
what exactly happens, if you download the extension from the download section here https://puravidaapps.com/file.php? do you receive a file in your download folder? 
com.puravidaapps.TaifunFile.aix
testCopyDelete.aia
filelist.aia
size.aia
jukebox.aia

Please no CAPS LOCK next time. Thank you. 


-- 
The problem is that the puravidaapps.com page does not load
Could not open it

-- 
I just tired to open the page without issues... you might want to try another browser...

--