I never had this tough reading content from online with other language, I am developing an android app, It's need to read some JSON data from online. But I googled it and gave it a try on my own, but nothing is working as I expected
I want to read that JSON from the web, is there any good way to do that?
Please do a search on volley or ok http for android on google. (Though ok http is obsolete but volley is surely a good alternative)
Use Retrofit + GSON libraries. They can satisfy wide range of expectations and have perfect samples.
Related
I read one answer here (How to use Google Translate API in my Java application?) and started to use java-google-translate-text-to-speech api as it is free.
But when I use this api in a standalone java file, I am facing an issue : "Your client does not have permission to get URL /translate_a/t from this server. That’s all we know." HTTP Reponse Code 403-Forbidden error.
Do I need to use API key to use this api ?
Is there any sample code which uses API key ?
I am posting a question for the first time so apologies if the formatting is incorrect.
Thanks in advance !!
The official API is 20$ for 1 million characters (proportionally), so you could still consider using it as it's quite cheap.
The project you're referring to hasn't been updated in a long time, so it could just be broken due to changes by Google....
In the comments they also referenced this project, you could try using this, but I would still recommend the official API's.
Background
I'm using the Clean architecture in my android app. My domain and data layer are heavily RxJava-based (RxAndroid).I'm also using Parse(BaaS).
Question
I know that the Android Parse SDK is doing a lot of work under the hood like caching and encrypting data. Is it really stable to use its synchronous calls with RxJava's Schedulers?
I know that Retrofit works well with RxJava. Should I drop the Parse SDK and use their REST API instead ?
Help me, I'll give you a cookie !
I know that the Android Parse SDK is doing a lot of work under the
hood like caching and encrypting data. Is it really stable to use its
synchronous calls with RxJava's Schedulers?
Parse has plenty of android SDK samples on git etc. If your Rx is friendly with Curl maybe you could also look at REST api from parse.
Otherwise, in the 'Rx' request/response circuit you should try to expose the http traffic ( headers that contain parseAppId, and parseUserToken )
The token mention in the exception
scroll down till 'handling invalid session token'.....
How to I send tweets to Twitter from java, looking for the simplest current solution please. As twitter always seems to be changing Im not even sure if this is possible and if there are any restrictions.
So I found that twitter4j was the most comprehensive and uptodate api, to access anything on twitter you need to use oauth and I didnt find the twitter4j documentation on this very clear.
However this excellant blog post http://www.javacodegeeks.com/2011/10/java-twitter-client-with-twitter4j.html clearly explains how to use oauth and update your twiiter status (send a tweet). Read through it carefully and it tells you exactly what you need to do and is really quite simple.
Does google provide a Java server side api **(NOT java script).**I dont want the ajax api which works at clint side.
What i want is that the result returned for a keyword should return me search result in some specific data structure.Like List or set data structure.Then i want to manipulate the result according to my need in java code.
I had used such a java server site api for youtube.
They used to but is discontinued. Most likely because you can remove their ads ;-)
From Google's terms of service
You may not send automated queries of any sort to Google's system
without express permission in advance from Google.
So, no - use their AJAX API. The SAOP API is discoutinued, but I think you should be able to use it, unless it requires a key, in which case you are tied to the AJAX API
Technically, the statement quoted above doesn't mean you can't use some sort of server-side API - there are examples of that if you google around. It means you shouldn't do it, because sooner or later you will be blacklisted (banned), as violating the terms.
What you would be looking for now is the CustomSearch API:
They used to have a different API developers could use but it has been depreciated (Nov. 2009 I think) so this is a for cost service now. I am not aware how long it might have been a free service. The new API allows 100 free searches a day, but you have to be signed up for billing else anything above 100 searches will fail, here are the details:
http://code.google.com/apis/customsearch/v1/overview.html
And sorry yes, this would still be using Java Script but you could use this:
http://www.json.org/java/
There is at least a SOAP API that I'm aware of: Google SOAP Search API
I don't think Google wants 3rd parties to use their search engine for their own services/applications. You would get "we think you are a robot" error page as a result if Google thinks you are not a real person.
You can however try Google Custom Search
I'm trying to write a simple Java desktop app to query Google and get the results. I've read so many articles in the past few days. I know that I have to do it through the GWT (Google Web Toolkit), the API that Google offers to programmatically query its search engine. My problem is that the GWT seems to be useful only to construct AJAX applications. I just want to write a simple desktop app. I am not interested in Javascript, XML or any server side application. Isn't there a way to do it?
Sure, take a look at this approach.
The general idea is that you make an HTTP fetch (using vanilla java.net.HttpUrlConnection or Apache HTTP Client). The magic is in the forming of the URL with the search term, and in the processing of what you get back from Google.
For the exact details on how to do this, see Google's REST search API documentation, including this section.
You can always get a license for the webservice and get the results returned through SOAP, however you did say that you were uninterested in XML. Shame, thats the quickest way. There is always doing a direct request to google through the query URL, since it uses HTTP get.