I am trying to sort a Google Spreadsheet with the Java API but unfortunately it doesn't seem to work. The code I am using is really simple as shown in the API reference.
URL listFeedUrl = new URI(worksheet.getListFeedUrl().toString() + "?orderby=columnname").toURL();
However, this does not work. The feed returned is not sorted at all. Am I missing something? FYI the column I am trying to sort contains email addresses.
EDIT: I just realized that the problem only happens with the old version of Google Spreadsheet.
maybe this happens. The query is performed on the spreadsheet xml and xml tags are in lower case, for example the title of my column in my spreadseet is "Nombre" and the xml <gsx:nombre>is not working so instead of using [?orderby=Nombre], use [?orderby=nombre] with a lowercase "n"
The correct query for this is.
URL listFeedUrl = new URI(worksheet.getListFeedUrl().toString() + "?orderby=nombre").toURL();
Related
I am trying to build my new App and I need some data for it.
so I was wondering if I can get JSON data (or query link or any source file) of any site for now and for future.
I need to get data from this site:
https://study.ekb.eg/ - https://www.ekb.eg/
Note: https://www.ekb.eg/ is the main source data for https://study.ekb.eg/
Thanks
The site needs to be specifically programmed to return JSON data for you. Regular, normal sites are not like this. They generally just return HTML
So the site owner would need to set up an API for you to consume
I am writing a code in which I need to access a particular column of a spreadsheet, already uploaded on my GDrive. I have found the Java API that is required for my project.
https://developers.google.com/google-apps/spreadsheets/#fetching_specific_rows_or_columns
I have have already installed : Mercurial, Maven and Google PlugIn for eclipse, as well.
Now when I run my code, the following error comes : " The type com.google.gdata.client.GoogleService cannot be resolved. It is indirectly referenced from required .class files".
According to me this error is might be because of the path/URL given in the google API to access a particular spreadsheet :
URL SPREADSHEET_FEED_URL = new URL(
"https://spreadsheets.google.com/feeds/spreadsheets/private/full");
PLEASE HELP!!
Do you have the required Google Data API Client libraries downloaded or not? If not, make sure those libraries are downloaded and check this link
It seems this is the dependency: http://mvnrepository.com/artifact/com.google.gdata/core/1.47.1
Hope that helps!
The Google Spreadsheets API documentation (Fetching specific rows or columns) suggests the following...being worksheet the specific worksheet instance of your spreadsheet, and let's say 6 the column list of values that you want to get:
URL cellFeedUrl = new URI(worksheet.getCellFeedUrl().toString() +
"?min-row=2&min-col=6&max-col=6").toURL();
CellFeed cell = service.getFeed(cellFeedUrl, CellFeed.class);
for(CellEntry eachCellEntry : cell.getEntries()){
// prints value of each cell in column 6 but the title
log.info(eachCellEntry.getCell().getValue());
}
I don't like the passing of the hard coded arguments in a String manually for the URL when using CellFeed...like min-row, min-col, max-col...I am trying to find a better way to do this, perhaps using a query.
I m new in Android development and never been in JAVA before.
With online tutorials and stackoverflow help I managed to generate a list with XML,
Now I m making it work like if I clicked on list item, it will open other activity.
With php I managed to generate xml I want on request but now in android I want that single entry XML
<item name="something"><description>Item description</description></item>
like this. But I'm not sure how can I read this remote xml and store values as a string
String name = Name attribite value & same for description.
You should use a parser like as Pullparser, Saxparser or something what you need.
You can follow the following: Parsing example
Make one SOAP Web service and call it from Android application. Please find tutorial here
Regarding SOAP:- http://suda.co.uk/publications/MSc/brian.suda.thesis.pdf
And regarding how to use with Android:- http://androidtestexample.blogspot.in/2012/02/soap.html
I am doing an application where I have to read a URL from a webpage as a String[Its not the address of the page]. The URL that I will be reading contains query string, and I specifically need two queries from that URL. So I am using the Uri class available in Android. Now, the problem lies in the encoding/format of the URL and the query. One of the queries that I need is always an URL. Sometimes the query URL is %-encoded and sometimes not.
The URLs can be like the following :
Case 1 :
http://www.example.com/example/example.aspx?file=http%3A%2F%2FXX.XXX.XX.XXX%2FExample.file%3Ftoken%3D9dacfc85
Case 2 :
http://www.example.com/example/example.aspx?file=http://XX.XXX.XX.XXX/Example.file?token=9dacfc85
How do I get the correct Url contained in the file= query?
I am using the following [to accomplish the said work universally] :
Uri.decode(urlString.getQueryParameter("file"));
Is this the correct way to do it?
UPDATE
I have decided to first encode the whole URL regardless of its value and then get the query parameter. Theoretically, it should work.
If you are uncertain about the type of URL you would get then I would suggest you to decode every URL you get from the parameter. And when you need to use it then you can encode it.
As per my knowledge, you are doing it right.
First of all, I am using playframework 2 with Java.
I have a Bootstrap-lookahead input field in a view and I want to use a json array as source for it, as described here.
I can generate json at server-side with:
Json.toJson(users)
or on client with:
#{Json.toJson(users)}
However it generates strings with " and when I try to create the bootstrap-lookahead field with this data, it gives me
Uncaught SyntaxError: Unexpected token &
Could someone help me with that?
Thank you
You can prevent escaping by using #Html(Json.toJson(users)) in template.
Docs, last paragraph