2017년 4월 7일 금요일

TinyWebDb


Good afternoon, this is my first time posting here and using app inventor 2.  I am looking to create a service technician applications for our service department.  Would i would like to do is post date to a tinywebdb which contains service request tickets for our technicians, who would access them via Samsung Galaxy Note 3 devices.  I have successfully created, written to, and read from the tinyweb db via the devices.  What I am looking to do is to populate the tinywebdb via a pc desktop application.  IS this possible?, and if so, can anyone point me in the right direction for any information.  

--
I believe you would access your particular TinyWebDB database similar to this http://appinvtinywebdb.appspot.com/
using a web browser on the PC or Mac.
I was able to store and read tag 'TGIF' in the test database.
Once the tag name and data have been defined you apps should be able to read that data (which will be in a list, I suppose.)

--
This multi-user app begs for a more powerful platform, like Fusion Tables,
which can store and filter multiple tables.

You can set up tables of 
service requests & their statuses,
service actions linked to service requests,
status updates linked to service requests

This would give you a more auditable and summarizable setup.

Start with the Pizza Party tutorial, and see if you can set up matched tables.

--


Moving an app from app inventor


Ok so my app is getting regular updates and feedback on the Google play store. However it is now over the MB limit on app inventor so it will not build or do anything essentially. Is there any way I can continue to work on this app at all? Or will I just have to recreate a new app on Eclipse? (which I have no knowledge at all)
Anything will help! Please list all options thanks :)

--
try one of the personal servers to build larger projects

--
thanks immensely! 

--


A question about AI2 and Google Image handling


In AI2 using the device camera I take a picture and save it to Google drive using Web component. In the ”GotText” block of the web component I can extract the “downloadUrl” and the “title” of the image and save these data in tinyDB on the device. Later I can retrieve the “downloadUrl” of the image I want from the TinyDB and using the web component download the image and save it to the SD card of the device. This works perfectly. If I wait a few hours an try to download an image I get error 401, In response to that the app starts the Authentication process using Refresh token, get a new Access token and download the image successfully. However, if I wait longer time, say, 24 hours and then try to download the image I get error 403 “Forbidden”. Even if I start the authentication process and get a new Access token I still get error 403. In this situation there is no way for me to use the “downloadUrl” I saved in the tinyDB to retrieve the image. However, if I list the contents of the Google drive and chose the same image, it will be downloaded. But the “downloadUrl” is now different from the one I saved in the first place. So, I am wondering if there is a time limit to the “downloadUrl” one gets when saving an image or video to Google drive. If so, is there any other way than listing the Google drive files and choosing a file to remember the image details and download them when necessary?
--
the downloadURL is a short lived information, see the documentation https://developers.google.com/drive/v2/reference/files#resource
Short lived download URL for the file. This is only populated for files with content stored in Drive.

did you try webContentLink?

alternatively store the image in a public directory on your Google Drive, then you can read it later using its id also without authorization

this snippet updates the metadata of the image to store it a public folder

to get the folder id, create a new folder in your Google Drive and Share it to "Anybody with link" and get the folder id from the Share dialog.

--
I will test this. When it comes to webContentLink, Is it possible to programatically create a directory, mark it as public, and mark the files saved there as public?

probably yes, please take a look at the documentation
if the directory is public, all files inside are automatically public, too

PS: please keep the discussion in the forum. thank you.

--
I apologize if the response i send to you went to your private e-mail. It was not intentional. I use the only button on the forum that allows one to give a response.
I have gone through the documents you referenced and have been able to firstly download images from a shared directory without Authentication and secondly to create a new folder on the Google drive. What I am struggling with now, and seem not to be able to do, is to make the folder public. I have tried to change the shared variable using the meta data manipulation with no luck, see attached screen shot. I have also tried to set visibility to Public with no luck. I do not get any errors but the folder is still private.
I see in the documents that shared is not marked as writable. Maybe that is the reason, but then how can I set the directory to public.
Would appreciate any suggestions.
--

Boutique App


I want to make a boutique app which can be used by my customers to see new updates and images of my clothes n all.
If u hv seen the amazon or the ebay app in which there r sections like men women etc and then v get to select the images n zoom n preview it.
I want to make something on these lines.
Any Help or even a small tip on it is welcome.

--
You can start with the tutorials: http://appinventor.mit.edu/explore/ai2/tutorials.html

--
Please reply to the list. Thanks.

--
I hv completed d tutorials.. d problem I m facing is I cannot store al d pictures in d app as d limit is 5 mb..
So do I need to create an online photo catalogue n den access it thru my app..?

--
yes, that could work.

--
If you put the link to the image in an html document, then load that document with the WebViewer you will be able to zoom in and out on the image.
You could also put thumbnails of your images as a Canvas BackgroundImage then if the user touches the canvas have it resize in width and height to a larger size.
Touch again and it could shrink back to thumbnail size.

--
I also want to make an app for my store, but do not understand English at all and that is the first time.
Please someone can guide me?

--
Start by going through the tutorials... The tutorials are located here: http://appinventor.mit.edu/explore/ai2/tutorials

--
There is also a forum in Spanish https://groups.google.com/forum/#!forum/app-inventor-en-espanol
And maybe this page can help you appinventormegusta

--

I can not connect to any form of emulator or companion. Any ideas?


What have you tried so far? What are the specifications of your phone? Your computer? 

Did you follow the setup instructions on the website? Did you try using a different USB cable? Is your companion up-to-date? 

Try restarting your phone/computer and see if that helps.

--
Most of the emulator connection problems we have seen are a result of not having the most current version of the App Inventor setup software, or that software having been incompletely installed.

Still, there can be many other issues that could cause the connection to the emulator to fail.  Please read and follow the document below on connection issues:
Click here for Emulator Setup and Trouble Shooting Instructions

If you still cannot get the emulator running after following that document, please post in the forum and we'll try to help you out.

Also, make SURE the Companion on your devices is up to date.  The best way to do that is to download it from the Google Play Store on each device.  That way, when MIT updates the companion, your device will automatically update it as well...

--
I have tried everything. I've reinstalled all the software at least twice and tried on different networks with the wifi connection. Nothing works. It must have been my profile, because when I made a new account and put the file on the new account, everything worked perfectly.

--

Car game made in MIT App Inventor and Inkscape


Working on a car game for the next tutorial. Here we have 2 canvas. Canvas 1 is the scenario and canvas 2 is used to move the car. I haven't thought in the main objective of the game yet. But I am sure you guys will come up with an idea. Anyway tutorial coming soon.

Car game made in MIT App Inventor and Inkscape


AI2 Companion it´s not working


Hi, I can´t connect my mobile device to App Inventor 2. I´ve tried to fix it (refreshing connection, installing the latest version) and it keeps saying "Companion Connection Error"

It happens when I enter or scan the code, the app (from cell... samsung galaxy s5) do nothing, and then the pc shows the error. 
What can I do?

--
This depends Jimy on how you are connecting and the project you are attempting.   Have you ever connected before?     Did you follow the instructions here  http://appinventor.mit.edu/explore/ai2/setup-device-wifi.html  ?     Do you have the most recent version of MIT Companion (version 2.27) downloaded and installed on your galaxy?      Are both your PC  and android connected to the same network as indicated in Step 2?   Are you trying to connect with Chrome? Perhaps try Firefox.

Do you have Bluestacks on your PC?   Bluestacks gives AI2 severe problems.

--
I´m using the same wifi network. It´s not my first time, I´ve already have develop some apps. 

I´m using the 2.27 version on my galaxy. 

I´ve used Chrome and Safari and it doesn´t work.

I don´t have Bluestacks.

The error happens after I enter the code... it tries to connect, but it fails in the process

--
Thanks for the information Jimy.

"The error happens after I enter the code "      ...you mean the Companion connection Error
"... it tries to connect" ... you are not getting a connection, does this ", but it fails in the process" your Project does not load?     Does this happen with ALL your Projects or just a particular project?   It is important for us to know.    If you can load a simple project; perhaps make a new project called MyTest where you place a button on the Designer and then Connect>AI Companion  ; does that connect?   If the simple project connects and the other project does not connect; it means there are issues with your Project code or aia size.

How large is your source aia file?     Do you have more than ten Screens or are you attempting to load a large audio or image or video file at the app start?

Have you added an adblock program to your browser? or recently added any other plug-ins.  Some plug ins on the browser can cause Companion and AI2 to misbehave.

If your app does not appear on your device, the most likely problems are:
⦁ You may have an outdated version of the App Inventor Companion App. Download the latest Companion App for App Inventor 2 from above. OK, you said you have 2.27 on your Android.
⦁ Your device may not be connected to wifi. Make sure you see an IP address at the bottom of the AICompanion App screen on your phone or tablet. Do you see the IP address?
⦁ Your device may not be connected to the same wifi network as your computer. Make sure both devices are connected to the same wifi network name   
Anything above familiar?   Please answer the additional questions and we might figure this out together.   For most people, using WIFI and AI2 is very easy...and it has worked before so something appears to be blocking the connection.

--
Steve, it happens in all my projects. I say that it´s trying to connect because when I scan the code, in my pc, the code dissapears as it is going to connect, but after a while (5 secs aprox) an error appears "Companion Connection Error"

My projects aren´t so big... I´ve tried more than one now.

I I´ve disabled now all my chrome plugins and nothing... I dont have plugins on mozzila and it didn´t work there.

It has an IP adress whie I´m trying to connect.

I really think now that the problem it´s in the phone, maybe an app it´s blocking the connection. Do you have any list of apps that can be causing this?

--
What virus checker are you using on your phone?  That could block.    Have your Firewall connections changed on your PC recently?

Here are a large list of things to think about, please do gtry steps 1 to 3 if you can.

Connecting the phone over wifi

I'm using wireless and the phone won't connect to the blocks editor.
Try the following steps to troubleshoot your wireless connection.
1. Try to reach http://rendezvous.appinventor.mit.edu from your computer.
2. Try to reach http://rendezvous.appinventor.mit.edu from the phone itself.
3. If the steps above both work, try using the "ping" command to ping to the IP Address of the phone (displayed by the MIT AICompanion in its startup window). If you are using windows, type "ping" + *IP address of the phone* in cmd.exe window, if you are using mac or linux, type type "ping" + *IP address of the phone* in terminal window. Detailed instruction see http://www.wikihow.com/Ping-an-IP-Address
4. If all of these steps succeed and Wireless App Inventor *still* doesn't work, then there may be a firewall between the computer and phone that is blocking ports 8001 and 9987. If you have a "telnet" program you can attempt to telnet from the computer to the phone on these ports. If the connection won't complete, then there is likely a firewall in place that is blocking connections to the phone.
I installed the MIT AICompanion App before and it doesn't work now.
You must use the latest version of the MIT AICompanion App. If you attempt to use an older version of the Companion App with App Inventor, you will be prompted to update it.
I followed all the wireless instructions and my phone is connected to wifi, and I still cannot connect to App Inventor via wifi.
If you have trouble connecting using these wireless instructions, make sure your phone is using WiFi and not the cell network. On some devices and in some locations, even with WiFi enabled, the phone continues to use the cell network for Internet connectivity. If this is happening to you, you can disable mobile networking (cell phone carrier based Internet connectivity) from your device's Android settings menu. More information about how the wifi connection works.

Communicating with the device

App Inventor says: You must be connected to the companion or emulator to use "Do It".
This message means that App Inventor believes that it's not connected to any device. If you are using the USB cable, first check that the phone is plugged in. You can also check the connection by using the Connection Test Page. One the phone is connected, stop the Companion software on the phone and try connecting again. If this does not work, or if you are not using USB, try the solution shown under "App Inventor says: Metwork Error Communicating with Companion."
The phone (or emulator) shows a notice -- Security error receiving blocks from browser.
A likely cause for this is that the browser loaded a new project and the Companion didn't recognize that. (Perhaps the phone was unplugged?) Reset the Companion by using the menu key (on the emulator) and select "stop this application". Then reload the browser page, and try connecting again.
The Companion started to run, and then said "Connection error."
This can happen if App Inventor tries to connect and start the companion, and the companion is already running on the device (perhaps from previous project). Go to the running Companion app, press menu, and choose to stop the application. Then try reconnecting again. If this keeps happening, try rebooting the device.
Something you might want to do in the meanwhile is install the setup software and try the emulator...   does that work?   http://appinventor.mit.edu/explore/ai2/setup-emulator.html   

--
Thanx Steve for your help... i´m still in trouble with aicompanion.

I think the problem it´s definitly my phone, because i couldn´t ping it succesfully (i tried other sites and devices and it worked)

I´ve tried to change configs on Avast (on my phone and my pc), but I haven´t solved it yet. 

It didn´t work either using the emulator, it says it´s out of date and then I had trouble with the update package.

I don´t want to give up on app inventor... I hope you could help me again

--
In the past, Avast users have had problems with that virus checker blocking AI Companion activities.  This could be your issue.  Check Avast to see if that program has the possibility of selectively unblocking what it considers suspicious urls.  I do not know if that is your issue or not, only reporting some AI users had that difficulty several months ago.

You have Avast on both your phone and the PC?  Perhaps try the free AVG or the free McAfee on your Android?

You said you could not update Companion on the PC either to use Companion.  This appears suspiciously something is blocking AI..my guess is it might be Avast.  You could try another virus checker.     However, first try this with respect to the Companion update.  First, make sure you are running your Win8 PC using Administrative privlidges.  Then  from the AI browser screen,  Connect > Hard Reset.  This attempts to 'manually' update Companion on the emulator.  You should see a pop up menu after Hard Reset.  This does not always happen.  If you do not see the pop up immediately, then close your browser; reboot your PC then reload the browser and try to use the emulator again.   What happens?  Let us know.

Also please confirm that you did install using Admin privileges .  

--
Hi Steve, definitly: I dont know whats wrong with my connection.

I´ve uninstalled avast, du booster, and nothing... 

I still can´t connect the companion or even ping my phone.

If you have any ideas, they are welcome

--
Hopeless perhaps Jimmy.

Let us try again.   WIFI is the easiest thing for most users to do.  Since you cannot connect, the problem is one or more of the following:

1) There is a hardware problem with your PC.  Since you can connect with other things, this is unlikely.
2) There is a problem with your Android phone.  Borrow a phone and try?
3) There is a problem with your dsl router  .    Is your PC connected via a cable?    Perhaps your WIFI is a guest connection and not connecting to the same IP as your computer?
4) There is a problem with your PC software.   You seem to have deleted the usual culprits that inhibit AI2 activity.
5) There is a problem with your installation of Companion 2.27 on your phone.  You say you have version 2.27 so that should be OK.
6) There is a problem with the project you are attempting to load.  This is highly likely...see below.
7) Your version of Chrome is not up to date or you need to clear its cache.  This is possible.
8) The phone is connecting via network and not thru WIFI.   This is very possible.
9) You have a virus.  Perhaps but the others are more probable.

You said you have created apps with AI2 before and you cannot get any to load using WIFI  Connect > AI Companion and you cannot ping.  For the moment, forget about the emulator and let us try to get WIFI working for you again.  To use WIFI, you do not need aiStarter.  You do need a Project on your Project screen that is known to work and to follow all of these procedures:

Connect your Phone or Tablet over WiFi

You can use App Inventor without downloading anything to your computer! You'll develop apps on our website: ai2.appinventor.mit.edu. To do live testing on your Android device just install the MIT App Inventor Companion app on your Android phone or tablet.  Once the Companion is installed, you can open projects in App Inventor on the web, open the companion on your device, and you can test your apps as you build them:
The following steps will walk you through the process.

Step 1: Download and install the MIT AI2 Companion App on your phone.

Open your device's QR code scanner and scan the QR code on the left below to download the Companion App from the Play Store. If you can't use the Play Store, use the QR code on the right to download the Companion App directly to your phone.

Play Store

Recommended: Automatic updates

APK File

Manual updates required

Scan this QR code (or click this link)
to get the app from the Play Store

Scan this QR code (or click this link)
to download the app directly

If you need a QR code scanner, you can get one at the Play Store (e.g., ZXing).
After downloading, step though the the instructions to install the Companion app on your device.You need to install the MIT AI2 Companion only once, and then leave it on your phone or tablet for whenever you use App Inventor.
Note 1: If you are unable to use the QR code, you can still install MIT AI2 Companion on your phone or tablet. Use the Web browser on your device to go to the Google Play Store; look for MIT AI2 Companion in the store. Once you find Companion, click the INSTALL button for the Companion app.
Note 2: If you choose not to go through the Play store and instead load the app directly (aka "side load), you will need to enable an option in your device's settings to allow installation of apps from "unknown sources". To find this setting on versions of Android prior to 4.0, go to "Settings > Applications" and then check the box next to "Unknown Sources". For devices running Android 4.0 or above, go to "Settings > Security" or "Settings > Security & Screen Lock" and then check the box next to "Unknown Sources" and confirm your choice.

Step 2: Connect both your computer and your device to the SAME WiFi Network

App Inventor will automatically show you the app you are building, but only if your computer (running App Inventor) and your Android device (running the Companion) are connected to the same WiFi Network. See a more detailed explanation of this here.         Take the time to read what is said on this link; since you last were able to run a Project using WIFI, perhaps something has changed with your WIFI network.  Is it possible your phone is attempting to connect to the Internet using a network connection, and not WIFI? You can turn off the network setting on your phone in the Settings.
Some router software require you provide and setup the router password in your Android?    Have you done that?             Another test, after you are sure your are not using a network connection on your device, connect to the Internet using your device's default brower.  Can you surf the Internet?    If you cannot, it probably means you phone is not connecting via WIFI to anything.
In the settings in your phone, do you have USB debugging turned on?    If so, turn it off.  Attempting WIFI and USB at the same time will confuse either AI2 or Companion.

Step 3: Open an App Inventor project and connect it to your device

Go to App Inventor and open a project (or create a new one -- use Project > Start New Project and give your project a name).    Please create a NEW project;    call it JimmyCompanionTest.
Place a button on the Designer Screen.   Set the Button.Text to   Hello Jimy    .    That is the entire project.    Please do    Connect > AI Companion .    Does the project load and the button render on your phone?
 Then Choose "Connect" and "AI Companion" from the top menu in the AI2 browser:
A dialog with a QR code will appear on your PC screen. On your device, launch the MIT App Companion app just as you would do any app. Then click the “Scan QR code” button on the Companion, and scan the code in the App Inventor window:
Within a few seconds, you should see the app you are building on your device. It will update as you make changes to your design and blocks, a feature called “live testing”.
If you have trouble scanning the QR code or your device does not have a scanner, type the code shown on the computer into the Companion's text area on your Android device exactly as shown.  The code is directly below where the screen on your PC shows "Your code is" and consists of six characters.  Type the six characters and choose the orange "Connect with code".  Do not type an Enter or carriage return: type just the six characters followed by pressing the orange button..

Troubleshooting:

If your app does not appear on your device, the most likely problems are:
⦁ You may have an outdated version of the App Inventor Companion App. Download the latest Companion App for App Inventor 2 from above.
⦁ Your device may not be connected to wifi. Make sure you see an IP address at the bottom of the AICompanion App screen on your phone or tablet.
⦁ Your device may not be connected to the same wifi network as your computer. Make sure both devices are connected to the same wifi network name.
⦁ Your school or organization may have network protocols in place such that the wifi connection is not allowed. If this is the case, you can still use App Inventor with the emulator or you can use a USB cable to connect your device (Yuk). Go back back the main setup page for these options.
I'm out of ideas.   Can you access your projects from another PC or from a friend's PC using your log in?   If you can visit with a friend, try that or borrow a phone or a laptop.     Try the simple project, what happens?   The only way to isolate issues inherent with your phone for sure s to try another phone.

Tell us what happens, we can either celebrate with you or cry together.

--
Thanks Steve, you´re awesome... thanks for your guide and patience.

It works!! I started doing 2 steps at once, so I don´t know exactly which was the problem:
- I used Clean Up to delete all cookies and stuff
- i disabled all usb debug options in my phone

And then i tried to connect one more time and it worked... only by entering the code... when I try to scan it, the app closes, but I dont mind

Thanks again for all your patience and help...

--
Great.  You might have required both steps to get running Jimy. Regards using the QR code, you might just try cleaning fingerprints off the Android's camera lens..yes, that works.   Since you used WIFI successfully previously, you probably have a bar code scanner on your phone ...some users have issues scanning because they need to add the bar code app.   In your case, next time you start a connection, wipe the lens clean and try the scan.

thanks for letting us know you are up and running 

--

How to store and track details of student budget in budget program


I'm currently creating a budget program for university students to track their budgets and stuff...

I was wondering if there is an easy way to store the budget total as well as any updates to it..

I need to track these updates as they will be in the format of: Date - Description - Amount (Added/Deducted)

--
Have you done the tutorials... Please do... In particular, the Pizza Party tutorial.  The tutorials are located here: http://appinventor.mit.edu/explore/ai2/tutorials

Fusion Tables will help you with your issue...

You could also do it with lists, saving them locally into a TinyDB...

--
If i use fusion tables - then it is only limited to one user

--
@ Ryan.  That is essentially correct, there are ways others could share the table, however, why would anyone want someone to be able to look at their personal budget.  Yes, it could be set up where everyone has their own personal fusion table -- individuals can set up a basic table using the Web and keep it personal.  With the fusion table you will have some tools available to the app that you would not with a TinyDB because the table is SQL and the TinyDB is not.

I would use the TinyDB and keep the app totally on the device.  Remember, though, your budget program should be simple... phones are NOT PCs though you can probably do all the number crunching necessary with no issues on the Android device.

--

Monetizing Ads Campaigns for My LookFind App.


I’ve published an app LookFind with ads from MobPartner embedded.
After launching the application with ads I started to get updates for the campaigns I’ve subscribed, which to suspend or new ones to add.
Then I realized that every campaign update requires to issue a new version of my app in order to comply with MobPartner requirements.
The solution: I wrote another app AdsManager (source attached) which essentially store the campaigns links in a TinyWebDB and enable to me to remove or update campaigns without modifying my app LookFind.
I attach the source and of AdsManger App and a source for sample code how to access the campaigns from a different application.
In addition I attach a document that explains how to implement AdsManger with a customized TinyWebDB service.
Please read the resources that were essential to my apps development.
I hope it will be helpful and useful.
Doc for Monetizing Ads Campaigns for My LookFind App

--
great job :)

--
where can i found a guide to create my own TinyWebDB on appsspot.com ?

--
See HERE.

--
thank you

--
You can find the updated version for AI2 in the following link:
TinyWebDB

Create a customized service here
Customized Web Service

--
I've just attached an updated version that looks for ads availability to act as an example how to integrate ads from MobPartner in your app.

APKs are NOT allowed on the site.  Please don't post another again.  The APK attachment has been removed.  Please read the Forum Posting Guidelines available from the home page of the forum. 

ExampleCode.aia

--
Just downloaded the source code and built it on my phone, works great! Could you possibly explain a little how it works (a lot of code which I would have to study).

The reason why I'm asking is because I am using MobPartner ads as well (in a different way). I would really like to know how you managed to get results (2222,3333,4444) when the ad actually loaded as in my app I sometimes (very rare but happens) call the activity when the link is not loaded.

Would it be possible you could help me out? I know you provided the source but I am using their automated scrollable ads, if you have the time I would provide the source for it so you could take a look.

For now here is an app that I made which uses my current ad system:

https://play.google.com/store/apps/details?id=appinventor.ai_addictive_gaming_android.coc_defence_calculator 
(ads are on tab 1 and 3 due to the 2nd tab being Screen2 (had problems with multiple screens calling the ads))

--
The results you see are the text output for lables tha I've insreted to show the flow of the app.

If you follow the source - you can see how the ads are feteched and displayed

To get rid from the results load the AIA in the designer delete Trace01 up to Trace05 - build the APK and run it.

I'm using TinyWebDB service to store the ads on the web. You can grasp how the app works by ging thru the 1st post and read the attached doc.

I don't know how to deal with scrollable ads - only with ads gifs links.

--
Thanks for the reply, if you are storing the ads on TinyWebDB I don't think it will work very well as I'm using pools to display ads (different ad each day) so there would be no point of storing the data on a server.

If you are interested to find out how to I got the scrollable ads then I can make a new project for you.

--
I'll appreciate if you can provide an AIA for your implementation for scrollable ads.

--
Annotated screenshot with the AIA (to check pre-defined values):

-- 
Thanks a lot, I definitely look at it. Have a nice weekend

--
Thanks a lot, I've implemented it and it is working very nice.

--
No worries, enjoy your Sunday :)

--