2017년 4월 13일 목요일

OAuth Error while trying to read from fusion table


I am trying to access a smart table that contains information about customers and their car. Each customer is associated with a QR code that contains a 5 digit number. When I scan the QR, I want it to grab the row with their number and bring it back to the app so the user can read the customer data. Eventually this app will be used to determine if a customer has payed their monthly dues for a membership to a car wash. I built a register screen that allows the user to register customers by sending data to the same fusion table, adding a new row. This function works perfectly. I am using a service account, a p12 key file, and the table ID, and I am successfully able to add customers to the fusion table. However, when I try to read from it using a "GetRowsWithConditions" block, I get an 401 unauthorized error. This screen uses all the exact same information as the register screen, and I even tried just using the Query block to send the SELECT command, attempting to get the row information to pop up in a notification. ieven recreated the p12 key file, uploaded it and attached it to both the scan and register screen. I can register but not read the table. Attached I have the error and my Screen 1, home screen blocks. Ignore the warnings at the bottom, those are associated with detached blocks I removed to debug the issue. Any suggestions?


--
use the service account method

and do the Pizza Party tutorial to learn how to work with fusiontables and how to do the setup correctly

-- 
Like I said, I am using the service account method, my table and blocks are set up correctly since I am able to successfully write to my table, and I did the Pizza Party tutorial before I started working on my app but it does not contain any tutorials on sending queries to the fusion table . Still need help on this issue please.

-- 

 However, when I try to read from it using a "GetRowsWithConditions" block, I get an 401 unauthorized error. 

your screenshot does not show this block
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.

-- 
I did away with that block and exchanged it for a query block instead. I can show you what I did previously with the GetRowsWithConditions block if you can help me to get that to work.


-- 
you forgot to quotify the BarcodeScanner.Result

-- 
Whoops, thanks. Regardless the issue remains. Do I need to quotify the table ID?

-- 
Do I need to quotify the table ID?
no
btw. you don't have to quotify the column names (only if you use spaces in column names)...
did you get it running using the SELECT statement?
if yes, why wasting time to do the same with the GetRowsWithConditions block?
you might want to provide an updated screenshot...

-- 
bt. from your error message you can see, that you forgot spaces before and after the tableid...



-- 
I tried both a query block with a SELECT command and the GetRowsWithConditions block separately and they both return the same error. I don't have a preference to either one, I just need one of these two options to work.


-- 
you might want to fix the missing spaces and provide an updated screenshot...

-- 
Of course. Here is what I'm working with right now



-- 
in the blocks screenshot it looks like you still forgot to quotify the BarcodeScanner.Result (but in the error message the query looks fine)... or is the scanner result already quotified?

to find it out, you can use Do it, see also tip 4 here

probably there is a space in the service account email address?
recreated the p12 key file, uploaded it and attached it to both the scan and register screen.

and you assigned the p12 file to the keyfile property in the second screen?
you might want to provide a screenshot of the Designer and its fusiontable control settings...

what happens, if you run the same query in the register screen?

-- 

Making Tabs program; Issues with hiding arrangements using any


I am making a program with tabs.  When a tab is clicked, a special function is called.  This special function, actually two functions (should):

1. hide the last tab's arrangement/s (the arrangements you saw when you were viewing the previous tab)
2. takes care of the coloring of the tabs and disables/enables some tabs
3. shows this tab's arrangement/s (the arrangements you should when you are viewing this tab)

The problem I am occurring is in the first part of the function.  The previous tab sometimes isn't make invisible.

For my particular app, I have some wiggy things set up, and I will try to explain them.

The code in the 3rd screenshot is the code that hides the vertical arrangements components, which are in a list (which is inside of a list).  The 1st screenshot is that variable containing lists of lists.  The notif after the for each / do loop tells me which component is being made invisible.

The 2nd screenshot is a list of the names of the tabs in my program.  In the list they are in the order of the main list of vertical arrangement components.  For example, in the list of tabs the first item is "Menu".  When the "Menu" tab is open and a different tab is clicked, the components in the 1st list in the main list of vertical arrangement components are hidden.

The 2nd to last screenshot does the last two things listed above.  The last screenshot does the first thing listed and then calls the function in the 2nd to last screenshot.








--
Here are the files, sorry:






-- 
Your images lack two things - 

The list of lists holding your outer arrangements does not show the arrangements nested within each outer arrangement.

The Designer image showing the nesting of the arrangements is missing.

Also, those redundant block comments hide important names.
You might as well close them.

-- 
I don't quite understand the first thing I lack.  The arrangements are not nested.  In the Designer, yes, but not in the list.  The lists are nested, though.  Am I not showing the list well?

Sorry about the comments.  I will remove them and re-do the screenshots.  They are attached.  Thanks!




-- 
Still need to see the Designer Arrangement nesting hierarchy, to see what's going on.

-- 
Okay.  The screen shots are attached, as well as the project file.  By the way, the boxes in tab 2's box (labeled Tab 2) do nothing.

By the way, I tried the program with hiding all the arrangements one by one the way I did it in the Initialize function (last picture above).  That made it work.





-- 
Why aren't the images coming in?  Posting them again...



-- 
Glad you got it working.

This is like a radio button.

By the way, you do know that if arrangements are nested, you only need to
turn visibility on and off for the outermost of them?

-- 
Really?  Then all my problems are solved.  When I tried that last time, though, it didn't work.  I'll try it again, then.

--
YAY!  I don't know what happened that other time when it didn't work.  Problem resolved; thanks and sorry!


-- 

a blur Background in Horizontal or Vertical Arrangement


when i make an image like background of an Horizontal or Vertical Arrangement the result is a blur background. but if I make the same image like background of a screen it seems clear.
what should i do.

--
Please prepare an example as small as possible, which demonstrates this issue and add the project (aia file) into this thread together with exact instructions for how to elicit the error, so someone can take a look

--
thank youTaifun. this is the  (aia file) 


-- 
you are displaying a screen background image  and additionally the same image in the horizontal arrangement
so if the horizontal arrangement is visible, then just set the background image of the screen to empty string...
-- 
thank you so much Mr Taifun . but i made the same image in background of screen and horizontal arrangement just to show you the difference between the clearness of each background. i need to make a different image in the background of the  horizontal arrangement.
 and even if i let the screen with no background . the image of background in  horizontal arrangement seem blur. (please see the new  aia file) 


-- 
be sure to use the correct size and aspect ratio of the image of the displayed area

-- 
please i want someone to take this image and try it as
1- background of a screen
2- background of a horizontal or vertical arrangement.

the same image looks clear when we make it like background of a screen.but it looks blur in  background of a horizontal or vertical arrangement.
does that meen that the background of a horizontal or vertical arrangement is less clear then background ofa  screen?


-- 
try to set a background image in the horizontal arrangement OR in the screen background but not in both at the same time

-- 
Tested your image on Google Nexus 7 (real device, using Companion:

screen background only
horizontal arrangement (fill parent) image only
both

All three as clear and crisp as you would want.

-- 
thank you so much Tim Carter 

-- 
thank you so much Mr Taifun

-- 

getclip ERROR 2001 The file could not be found on your device


I have created an app for an Android Samsung cell to record lat. and long. and date-time plus some additional text and post the info using the share function. The app allows you to choose between a photo or a video.
The app works correctly with photos.
With video clips I get the following: ERROR 2001 The file could no be found on your device.
file://content://media/external/vedio/media/548

The above address looks a bit strange to me.

Most of the posts that I have found are closed. Is there a solution?
Is there a way to manipulate the address so that share will find the file?

--
Show some of your code, particularly the part where you try to retrieve (use) the video's  .  Where are you storing the video's.?..App Inventor MUST know the entire path to the file.

You probably have not correctly named the path to the video file you want.  Be aware, Android files are case sensitive...what this means is if you request  MyVideo.mp4     and the video is named myvideo.mp4,  AI2 can not find the file because you have not myvideo file.

Because you are using the Share component, is it possible that the video has not yet been transferred to your device?

Do you know how to use the debugging tool called  DoIt .... it is part of the AI2 system..  Using DoIt might help you identify the issue and knowing if the file you are trying to grab comes from the Sharing component links.

Post some blocks and someone will probably provide you with specific advice.

--
With video clips I get the following: ERROR 2001 The file could no be found on your device.
not possible currently

-- 

search for Error 2001


With video clips I get the following: ERROR 2001 The file could no be found on your device. not possible currently. see also this thread ...
the sharing component only can share files from the sdcard, but not from the assets or the private data directory. you could read the file on first run of ...
the path file:///mnt/sdcard is a generic path and should work with both of your devices. Taifun.
do you use the Sharing component? currently you can't share videos with the Sharing component. Taifun. Trying to push the limits of App Inventor!
... SET Date='11.02.2015 16:23:59', Pizza='Pepperoni', Drink='Cerveza', Comment='and beer' WHERE ROWID='2001'. worked fine for me (note: the ...
this (see screenshot) results in error 2001, the file can't be found on this device, but after checking with a file manager, the file is there. this works.
As soon as I try to share a test.txt, I get an error message: Error 2001: The File file: //test.txt could not been found on your device. For some reason I cant ...
I used AppendToFile because it doesn't exist so it has to be created. Here's and example : I think it is correct, but I always get the Error 2001.
..need to share the camcorder file after camcorder records but i keep getting error 2001.
The way I have my app programmed is that you can share photos with people using the share function, when I select an image using the image ...
Hello, Im new to this, but some how i dont get the sharing to work. I have read many topics such as file:///nmt/sdcard etc..... Im now back to the cat and ...
When i long click the button, there comes the Error 2001 on my phone...file:// scream could not be found on device. I dont know what the problem is.
i get an error 2001: the file cannot be found on your device. I'm not sure if this is possible or not?
File "measured_data" or taav_file.measured_data" i get Error 2001: The File file// measured_data could not be found on your device. Please help me ...
PS: I found another thread up here on the forum with a related question, through Error 2001 about file not found. I hope the answer in that thread is not ...
When I click the "button1" on the phone, this message appear: "Error 2001: The File file://15.jgp could not be found on your device." But the image is ...
and when i click to share: "Error 2001: The file file:///storage/emulated/extsdcard/ xxxxxxxx could not be found on your device. any ideas? best regards.
public static final int ERROR_FILE_NOT_FOUND_FOR_SHARING = 2001;. // File errors. public static final int ERROR_CANNOT_FIND_FILE = 2101;.
Every time I press the share button, it gives me a message saying, "Error 2001: The File file://18 could not be found on your device" 18 is the current ...
I have the exact same problem.... I tried sharing a video instead of an image using Camcorder instead of Camera but it failed giving me Error 2001: ...
When I handle the button appears the message: error 2001: The File file://done. wav could not be found on your device. Do I have to specify some path ...
However, ever time I try to access the file it is giving me either a 2101 or 2001 error. I am using a Galaxy S6, which does not have an sd port. I wasn't ...