2014년 12월 16일 화요일

Having problems importing CSV into fusion tables

Hi, I am importing a CSV file from excel into my fusion table. It all works apart from one column of text. The cells in this column contain a few paragraphs of text with line breaks and spaces etc. I have enclosed in double quotes e.g. "text". but it still does not work.

Can anyone help me out with this? I have tried a few things to no avail..



The way to get advice Johnny is to provide specific information.   In this case it means an example screen capture of your relevant blocks and an example of the cells in the column and a piece of your csv.

Why?  You provided a good verbal description possibly but what you think you did may not be what you actually coded and how you encode the text matters and we on the forum can not see how you did it.




CSV and other text delimited data files

Comma-separated value (.csv) files are a standard way to represent database values in text. Cell values with comma, newline or quotes must be quoted and quotes escaped by doubling. For example: "17"" LCD display". 
By convention, the first row acts as header and defines the names of the columns in the data. However, you can specify which row is the header during import.
Another character (for example, a tab, pipe or semicolon) can be used instead of a comma to separate data values in a text file. When importing a file like this, please specify the delimiter during import.




Hi Steve, I have attached a screen grab of the text in one of the boxes. Taifun, I had read the info on that page and on others. They recommend quoting "" which I have done but it still does not work....




actually that's not an App Inventor question...I would recommend you to ask in a Google fusiontable forum



ok, thanks. i will do. I didn't know there was one!



Just to add to this. I think the issue is to do with when the data goes into ai2 from my fusion table. I select all the data from  my fusion table and create a new list from the resultant CSV list. I manipulate this new table in app inventor2. The lists in Ai2 don't seem to like new lines, quotations etc...Is there any way round this? Or is there a list somewhere of what I can write and what Ican't?. 



this is the block once I have selected all the fusion table data...




I have no solution.  Do you notice you are doing a lot of things in the GotResult block. Generally, doing your processing within a block like this is not always a good idea.

You are possibly dealing with a timing issue ..not all blocks executing as rapidly as you hoped.    App Inventor is event driven, what this means is an action needs to complete before another takes place (actually it is a bit more complicated than that).  Restructuring your processing code to a Procedure or using a clock to stagger events might help.   Communication with a fusion table takes place over your Internet connection, it occurs sometimes rapidly, other times less rapidly.   Your app code may be trying to do things with a data set before the data set arrives?

You might read this exhaustive discussion:

execution order





 I think the issue is to do with when the data goes into ai2 from my fusion table. I select all the data from  my fusion table and create a new list from the resultant CSV list. 

ok, which means, you have been able to import your csv file successfully into a fusiontable
to find out what is going on, use Do it to debug your blocks, see also tip 4 here 

Top 5 Tips: How to learn  App Inventor

you also can deactivate some blocks during your tests
Taifun



Thanks both of you for your replies. It all works fine if I remove the quotes...but it falls down again if I enter a line return or other symbols. I would like to quote the paragraph so it accepts commas etc, but it just rejects the quotations....it's a mystery to me.



Hi Both, I hope you don't mind me reposting on this thread as I'm still stuck with this. After looking more closely my CSV table is sorted using a method that Taifun shared and then I set this as a CSV row. It turns out that the issue is with the amount of text. If I fill a few cells with paragraphs it can cope but if I do more then it falls over. So there must be a limit. I wandered if there was a way round this? I am considering having two fusion tables and then just looking the cells with paragraphs up at the end using job id but is there a way round this?




the sort function does the sort directly in the URI of the webviewer and there is a limit of around 2 MB (max. length of an URI).

you could adjust the sort example and pass the data in the WebViewString property to the webviewer, see also 


Código eliminado (Eliminated Code)

15 days ago That Do not entered my account AppInventor and Friday May Enter I noticed with surprise that the code had generated WAS Eliminated, I can indicate if no way to recover SUCH code and explain Whoever Because WAS Eliminated.



You can reload the project from one of the AIA backup files you created while you were building your app...


Build Error

Since this morning, I cannot build my App and also cant save copy of my app. Is this another server error?



We are investigating an issue that involve project assets. If you can upload your assets again and also make sure that there are no zero length files in your project this might solve the issue. Please reply to this thread, and give us feedback as to whether this fixes the issue.



If your aia source file is larger than 5Mb, that is probably the issue.  You said you can not build my Application (create the apk) or save a copy.  By copy do you mean create an aia or use Projects > Save project as...   ?

When you look at your Designer screen, do you see ALL the images on your screen or screen(s)?   Asked another way, are some of your images missing from the screen?  If so, you are experiencing issues with the MIT server/Google Cloud issue which MIT is attempting to remedy.

You can 

1) wait until MIT finds a solution (when they do the red notice on the AI2 startup screen will disappear.

2) or proactively, find the 0 byte assets as Andrew suggested.    Look for the images on the screen that are supposed to be there but are not displayed (even though your screens show they are there).  Find the missing image(s) in you Media.  Delete them, then replace them with a copy from your original files (hopefully you saved all the images you use in your app somewhere).  Then go to the controls where the images are supposed to be and set the images you just deleted and restored in Media  and again set them to work with those controls using the Properties section on the Designer screen.  Also, if you have any images in Media (resources) that are NOT actually used in your app, delete them (some users find this helps to ensure a proper compile)  Now you are set to TRY AGAIN.    Your project may run, however, if you get it to run, you may lose assets the next time you try if the server messes up.   Yes, disgusting, however a great team worked the weekend to try to fix this and they are still working.

3) check these other possible reasons you app is not working correctly:
One of the following  possibly applies to your code (all may not apply to your code):

1)  You have coding errors in your blocks.  In the Blocks editor, look in the lower 
left corner of the window for the yellow and red triangle icons. If the red icon has a value larger than 0, 
you have a serious coding error.  Find the block in your code that has a red triangle and 
fix it.   Red triangles always inhibit creating an apk or running a project in the 
emulator or possibly creating an aia file.     Yellow triangles are more forgiving, 
however, sometimes, these need to be fixed because they trip an internal warning and not billing puzzle piece sockets are left un-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 other resources in your Media (resources) that you do not use in the app. 
 All the images and sounds in resources count toward the 5Mb limit along with the source code.    You can program 
apps larger than 5Mb in the browser, but the apps will not compile and might not run in the 
emulator or the project may not save as an aia. If this is the case you need to reduce 
the size of your image and/or sound files.   Most image files can be made quite small 
by resizing them using a photo manipulation program on your PC to less than 50Kb each.

3)  You might have more than 10 Screens in your app.  AI2 becomes unstable when more 
than ten screens are used.  Projects CAN be built with slightly more screen but then you should expect your app to occasionally behave erratically.

4) You might have set a Screen icon in the Designer Properties for your project that is too large. Use an image 
sizeof 48x48 px or 96x96px instead and only use jpg or png images.  *.ico files are not 
supported.  The 'icon' (actually an image) can be as large as 520x520 (I think that is the size GooglePlay apps require).  The smaller 'icons' work fine otherwise.

5) You did not code the entire project using App Inventor 2.   If you used one of the 
third-party AI2 clones,you might not be able to load a Project into the AI2 compiler or 
create an apk with the standard AI2.

6) If you incorrectly modified the project's Manifest files using a third-party tool, you may have issues.

7)  Sometimes, if you have LOTS of Layouts on a single screen,  the apk might not 
compile. How many is a lot?  I do not know, keep adding layouts and buttons, compile and try again...when the server crashes, you got a lot.

8)  The network you are using may be overloaded (possibly a school network), or you have other applications running in the background on your computer, or your virus checker is doing a scan.  Sometimes, just trying to access the MIT server a few minutes later will give you a more favorable response.

9)  If you have BlueStacks on your home PC (BlueStacks is a special emulator that allows Android apps to run on a PC).  The Google emulator on AI2 cannot run unless BlueStacks is disabled and all of the BlueStacks processes are shut down.  On a Windows PC, you use the Task Manager to 'kill' running processes.

10)  Are you using Sensor controls (except for the clock)?   Most Sensor controls or controls related to sms or the phone do not work in the emulators.  They need to be tested on a device.

11) If this is an issue about the Project loading slowly on your device or on the emulator:  Be aware, the more images, layouts, components you have on a screen, the longer it takes for the emulator and Companion to render the graphical screen.  How fast the emulator renders is partially a function of your hardware...how much ram you have, your cpu clock speed etc. Sometimes, with lots of graphics, the emulator will just give up.   Can you develop live using WIFI or using USB? These options almost always render faster than the emulator but will not be at lightning speed if you have lots of graphics.  Be patient.

12)  This happens too:   We have seen instances where it is probable the Google Cloud messed up; other instances where an older PC has had memory issues and caused file corruption of the Project and instances where a user is using a very slow Internet connection (like dial-up) and it is just too slow.

13)  Do you have an AVG, Eset or AVAST virus checker.  Some versions of these products have been reported inhibit running the emulator unless (in the case of AVG) the Advanced Link settings on the software are set to allow AI2 communication.


pizza app fusion table

Is there anyway where by  the user can use the application with out inserting their email address. As the application cuts out towards the end as soon as they submit



 use a service account and follow the description of Ketaki here https://groups.google.com/d/msg/mitappinventortest/OqWxT8qIUnw/S-OiDJHonzUJ



how do you add the Keyfile?  Also, the service cloud  email  this is my email that ive set up within the developers console or my gmail.com



here are the steps:
  • Developers Console: create a Service Account. after creating a service account in the developer console you get a p12 file to download.
  • AppInventor: This file must be uploaded as asset into App Inventor and this is the file referenced to in the Keyfile property. Then set up the FusionTable to be accessed through the ServiceAccount.
    Instead of defining the 3 values keyfileservice account emailand Use Service Authentication in the designer, you also can do this in the blocks editor, but of course both methods require the keyfile to be uploaded.
  • FusionTable: share the FusionTable with the ServiceAccount Email address and set the permissions to "can edit".



thank you..... i will try this



I created a service account, (I am not to sure as to which email i should use in app inventor)  

used the same page to create an public API Access (Applied to blocks and now there is a question mark) I also applied it in the Designer screen

I uploaded the p12 file in the designers screen

created a new fusion table...

Now when i am testing in the emulator on select it goes to the second page but does not select product.

the page is out of line... app inventor had a notice about images not showing but are there


can you advise



I created a service account, (I am not to sure as to which email i should use in app inventor)  
after creating the service account in the Developers Console, you get a service account email to use in App Inventor

used the same page to create an public API Access (Applied to blocks and now there is a question mark) I also applied it in the Designer screen
can you provide a screenshot?

Now when i am testing in the emulator on select it goes to the second page but does not select product.
the page is out of line... 
what does that mean "the page is out of line"? 
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.



hi please see attach





if you use the service account option, you do not need the ApiKey anymore
your KeyFile name looks strange, are there spaces in the file name?




Hi please see attach










your screenshots do not help very much without Do it result...

probably first you like to answer a few questions?
Now when i am testing in the emulator on select it goes to the second page but does not select product. the page is out of line...
1. what does that mean, can you elaborate? 
2. your KeyFile name looks strange, are there spaces in the file name?
3. what kind of error do you get after inserting a row into the fusiontable?
4. did it work successfully using the ApiKey instead of the service account option?



hi can you take a look at my apk 



please answer the questions and provide a screenshot of your relevant blocks including Do it result
to look at an apk file will not help, posting an apk file is also against the posting guidelines
see screenshot how to setup the different parameter for the service account in the Blocks editor correctly





hi have followed every instructions that you advised. I have created an service account, uploaded my p12 file.   there are no errors but it just not selecting product from the list picker and you cant submit 



ok meanwhile you answered question no. 3, the other questions still are pending.
what does that mean, you can't submit? is the button disabled?
my recommendation for you is to go one step back and do the Pizza Party tutorial do learn how to work with fusiontables




i managed to get the pizza app working along with the fusion table.   I then used the same concept to build another app  which worked perfectly, loading the results on to the fusion db.   now like you know i have set up an service account so that the user does not have to enter their email address..  i have uploaded api key file . Now all the buttons are disabled. 



Please see attachments for screen shots















sorry, that's not the way to go, ignoring questions and just posting everything you have
looking at the first screenshot I would check the UseServiceAuthentication checkbox, I did not check your other screenshots...
Good luck!



i have tried with the useservice checkbox tick and untick ..  how can i remove all screen shots



i re started application everything is working fusion db and tables.  The only problem is the application will not accept the key file and service account email.. Once I apply these to the app.. the image does not display.. the buttons does not select and you can not submit.


error del componente visorweb (webviewer component error)

I have a problem before leaving Webviewer component view google maps now obscures me the map there any solution thanks





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.


Still having problems with missing images in Viewer Display

At this point I'm just reporting the problems showing up in the Viewer.  I have an application more or less running but every time I come back to work on the Project (Hide_and_Seek_v0305) the View of the Project shows a different set of missing (blank) images.  All of the "missing" images are Button Images and all of the actual images appear to still be part of the Project.  Sometimes I can get the images to re-appear by just changing the image to a different one and then changing it back to the correct one.  Other times I can do this many times and have it never appear.

This problem just started showing-up yesterday.  Before that the displayed images always seemed to be stable.

If there is something I can do differently to work around the problem I'm cool with that.

Thanks,



Whenever there's an issue with App Inventor, or an announcement you should see, we post it in App Inventor's Splash Screen.  It seems that few people bother to read the things posted right before their eyes... you don't even have to search for it.. it's right there in front of you, every time you start App Inventor!

PLEASE PAY ATTENTION TO THE SPLASH SCREEN AND THE MESSAGES POSTED THERE.  

If you're seeing this post, then please reload your AI browser tab and READ the message!

An example of the splash screen is below... Notice the RED BOX???




Advice: Before posting, it's a good idea to search in this forum. Many others have likely run into problems similar to yours. How to search see screenshot.


SMS lenght text

I wanted to ask whether it is possible to receive SMS from a number of characters greater than 160 characters. I know that the myth inventor app can send SMS larger than 160 characters.



Texting sms messaging

There is a limit to the character count of a sms message you send with App Inventor 2.    Sms allows 140 bytes:  this translates to 70 16 bit wide characters (non ascii languages); 140 standard ascii characters; or 160 7 bit ascii characters.  The character count is determined by the mode you send the data.









ok, but if it is possible to change this? Standard text message windowin the Android allows you to answer an SMS more than 153 characters,even this can be 250 characters. Is there a solution?



This worries me because the longer text should be processed.



ok, but if it is possible to change this? Standard text message window in the Android allows you to answer an SMS more than 153 characters, even this can be 250 characters. Is there asolution?

no, there is unfortunately no solution

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


AI Starter

Is there any way to download the update files "offline" and install them , so that when a pupil starts the program for the first time they do not have to go through the process of updating the software
This is proving somewhat of an issue



When you say download files offline and install them I'm assuming that you are talking about the setup tools? You may install these first before anyone uses App Inventor. No need to have to do right before you start AI.



Let me try again. There are updates to the setup tools and then there are several tools in the setup tools that on occasion need to be updated for instance the emulator image. As we update the MIT AI Companion App for a component change we turn on a auto update feature that downloads this file for you. Currently we don't have an offline download and install for this but, I will think about it to see what we what we can do to make this easier. Our stance on this issue in general is to try and limit the number of updates to the setup tools to make it easier for large installations to have to update tools that don't need to be updated. I am making changes to the setup tools to fix a few issues we have found and will be including a new emulator image, but again I will give this some thought and see if we can streamline the process to make it less of an issue. There are trade offs to consider.


App Market "debes añadir un icono a tu APK" (App Market "must add an icon to your APK")

I want to publish my app but after I've uploaded the images, every data, etc. we've got to upload the app in .zipAlign and it returns this error (screenshot). But I've uploaded all the images (even the icone one).
Any suggestion?




Please read this announcement...  It's linked from the Red notice box in the App Inventor 2 Splash Screen...
https://docs.google.com/document/d/1wQy_1uCsZDAXY51wElbMyfy8AJid_EOqklIX_ggzBJY/pub



Thanks for your answer, Enis! 
I've read there are some problems so I'll be patient.



MIT App Inventor still has issues with the Google Cloud Storage, as mentioned in the red splash screen which results in missing assets, see also here https://docs.google.com/document/d/1wQy_1uCsZDAXY51wElbMyfy8AJid_EOqklIX_ggzBJY/pub

What you can do meanwhile is 
1. wait until these issues are fixed, or
2. install a personal server and work completely offline. 

Krupong just updated AI2U, version 2.3 is now identical to the MIT App Inventor version nb139c as of Dec 13. Just download the 32 or 64 bit version here http://sourceforge.net/projects/ai2u/files/ai2u%202.3/, install it, start AI2U and your own personal server is up and running! Then just open your browser using the address http://localhost:8888 . That's all.
And btw. with your own personal server you also will be able to build projects larger than 5 MB. So what are you waiting for?



Also THIS offline version is now based on MIT AI2 Dec 16th 


Splitting text with the condition


I am looking for help in take on, I have to split the text into 2 parts. The main textbox has the condition: lenght-text-max.20 characters, the next

TextBox1 = 1-5 characters, and texbox2 = 6-20 characters, almost like in the picture.

I do not know how to set a condition for TextBox2 = 6? infinity, as much as a character, so move.





DzielenzieTekstu.aia



--
you have to calculate the length, in your case it's the length of GlownyTextbox1.Text minus 5

length


Returns the number of characters including spaces in the string. This is the length of the given text string.

--
Tks Taifun, I do not know how to understand it. If you can help me please help from you. I gave the project the AIA. I do not know how to calculate the function. It's too hard for me today.


-- 

I want to automatically move data text if text lenght> 5, + lenght text that is entered in the textbox, different lenght


-- 

I want to split the text into two parts. The first part of the trim but what's next?

-- 

if you do not understand this

you have to calculate the length, in your case it's the length of GlownyTextbox1.Text minus 5
I recommend you to first do the tutorials http://appinventor.mit.edu/explore/ai2/tutorials.html to learn the basics of App Inventor, then try something and follow the

--
Ok, but how do you type text with different lengths, I want to keep the application itself could split the text into two parts, the first part is my declaration in length, the second part of the text is automatically transferred to another textbox. Is it possible?

--
yes, it's easily possible, just calculate the length as already said

--
it helps to use Do it to debug your blocks

--
Thank you, I'll try to build something. Write if successful

--
I want to thank you for your help Taifun;). Your solution to my problem,is perfect and really helps me. The text is properly divided, as expected.It turns out that, of course, this is not as difficult as I thought.



--
great, it's working for you now
you also can simplify your blocks a little bit, see screenshot
also you could use an if then else statement instead of 2 if statements


--
Hi,  You're right, Taifun, less code in the project is a better job;) and the solution is the same.

--

--

max text lenght in variables and textbox

Do you know how is the max text lenght a variable or a textbox can contain?



I tried it recently with 4500 words of lorem ipsum here...
just try it with more words and let us know, what you find out...


Error al abrir proyexto (Error opening proyexto)

I lose pictures

please help



Several possible issues here Carlos.

You may be experiencing the server issue that is described with the Red message that shows up on the AI2 pop up start screen.   Please read that.  The MIT statement is also here: https://docs.google.com/document/d/1wQy_1uCsZDAXY51wElbMyfy8AJid_EOqklIX_ggzBJY/pub        This issue affects people using lots of images in their Media folder and it might also be text.  There are temporary ways to get the blocks to run if you peruse the posts for the past few days, however, MIT hopes to have a fix soon.

It has been suggested that you might delete all your Media images, then reload them and try again.  This reportedly works sometimes but then later pictures disappear again and that will happen until MIT fix the issue.  This server issue apparently is not affecting projects that do not have images etc. in the Media.

Watch for the color of the message in the App Inventor splash screen to change from RED to another color or monitor this forum.   Yes, for the moment, AI2 is broken for some users...sorry.



MIT App Inventor still has issues with the Google Cloud Storage, as mentioned in the red splash screen which results in missing assets, see also here https://docs.google.com/document/d/1wQy_1uCsZDAXY51wElbMyfy8AJid_EOqklIX_ggzBJY/pub

What you can do meanwhile is 
1. wait until these issues are fixed, or
2. install a personal server and work completely offline. 

Krupong just updated AI2U, version 2.3 is now identical to the MIT App Inventor version nb139c as of Dec 13. Just download the 32 or 64 bit version here http://sourceforge.net/projects/ai2u/files/ai2u%202.3/, install it, start AI2U and your own personal server is up and running! Then just open your browser using the address http://localhost:8888 . That's all.
And btw. with your own personal server you also will be able to build projects larger than 5 MB. So what are you waiting for?


fusion table

Ok two things when ppl enter data into my apps fusion table it is posting at the bottom of the list I need all resent posts at the top where do I change that. Second is there a way of alerting users when a new entry is entered



are you talking about the webviewer displaying your table?
you always can define your own SELECT statement, for example if you have a column datetime, you could order the result by datetime like this:
SELECT * FROM <tableid> ORDER BY datetime

There is no alert feature, you have to execute a SELECT statement regularly, then check in the FusiontableControls.GotResult event if there are new records



Forgot the DESC ...
SELECT * FROM <tableid> ORDER BY datetime DESC
to get latest at top.



thanks ABG for spotting this



please clarify some more gentleman im still lost as to what you are exactly saying i should do can you show me a screen pic of blocks if possible thank you



are you talking about the webviewer displaying your table?



no the table itself when someone posts anew post it is posting at the bottom of the list i want all new entries at the top



new records always will be added on the bottom of the table
as already mentioned, you can execute a SELECT statement and order your records descending...



How do I do that?



use a SELECT statement