Integrating 3rd party API with jhipster based webapp - java

I am trying to build a simple web app using jHipster. Currently I am trying to build a simple stock entity that will enable a user to input the stock name and the entity should generate a listing of that stock with open, high, low and close data. I am unable to figure out how to integrate the web app with a third party API that supplies the data. I could not find any documentation regarding this issue online. Thank you.

I found this tutorial on implementing API's that might help.
What you need to do is create an HTTP client that can access your API.
I'm not too familiar with jHipster but finding the proper library to import seems like a good first step. Good luck.
Source:
https://zapier.com/learn/apis/chapter-8-implementation/
If you aren't sure which language to choose, a great way to narrow down the selection can be to find an API you want to implement and see if the company provides a client library. A library is code that the API owner publishes that already implements the client side of their API. Sometimes the library will be individually available for download or it will be bundled in an SDK (Software Development Kit). Using a library saves you time because instead of reading the API documentation and forming raw HTTP requests, you can simply copy and paste a few lines of code and already have a working client.

Related

Client android application for site

I want to write a client application for a site (e.g. to read smth from site, add some comments, likes etc). I haven't got access to site sources and there isn't any API for work with it. So at my Android application I decided to parse this site (it has static pages) using : JSOUP Library
And using this library I'm going to write unofficial, but API for my purposes to work with this site, and then use it in my Android application.
Can somebody tell me, is this good practice or there are better ways to do? Is this good idea at all to parse site in Android device.
As I wrote in comment - in general building your own application on top of the third party www service is not a good idea. If you want to do it anyway you have 2 options:
Use jSoup (or any other html parser if exists) and parse third party content on the device
Set up some middleware server to parse content and serve it in some more convenient way.
The second option has a little advantages - you can fix application without forcing users to update it and probably you'll save a bit of device's bandwidth. Of course disadvantage is that you have to pay for server.
General problem with applications like that is that every single change with layout, skin, server configuration can cause your application to stop working, as well as parsing html needs much more work that just connect to existing API.
More over - publishing your application can cause some legal issues (copyright) and is against Google Play's policy:
Do not post an app where the primary functionality is to: Drive
affiliate traffic to a website or Provide a webview of a website not
owned or administered by you (unless you have permission from the
website owner/administrator to do so)

Creating Magento Site's Native Android Application

I have the following questions which I have researched a lot on Google as well as in SO but found nothing::
I have to create a Native Android Application of a Magento based Site, and I have to use the same database of Magento Site. Now, I have found that we can't Access the PHP files of the Magento project as the access is denied. So how to call a Magento Login Function from the Android Client?
I have come to know that we have to call the function through using XML-Connect file in Magento. Please any one can give me a Example how to call that file and how?
Last Parsing. Which parser would be more handy? (DOM, SAX, SIMPLE XML Serialization parser?)
How to manage the Sessions with the Magento Store So that the user can add to cart items and could do Online Transaction.
Anyone who has worked on Magento Site's App Development provide some direction to move further. I am totally lost and getting nothing from the Online Research.
Any help would be highly Appreciated.
And Regards.
I've not worked with Magento site. But I've worked with similar websites to connect to the mobile applications.
Short Answer: XML-Connect is the best way to minimize your work. And its easy to use API than connecting to the database using php files. For mobile applications, it is always advisable to use a simple xml format, however, in your case, you have to stick to xml-connect's protocol.
For some more information, see this link http://inchoo.net/ecommerce/magento/develop-your-own-magento-mobile-application/

Google transliteration API in Java Swing project

I'm working on a transliteration project in Java Swing. It can access the internet, but I'm unable to set it up. How do we do that? Do we need to download the Google API libraries or just a function call will do?
Here are some useful Transliteration links:
The Google Transliterate API Devloper's Guide
Google API library for Java for download
(I think it has all API libraries of Google:Translate, transliterate, search, etc.)
I spent a lot of time, but Icouldn't find how to set up the Transliteration API, not even at SO.
Seems the transliteration API is deprecated and is not included in the Java client, only in the JavaScript client.
The actual calls the JS library makes are pretty simple and could easily be replicated from anywhere:
http://www.google.com/inputtools/request?ime=transliteration_en_ru&num=5&cp=0&cs=0&ie=utf-8&oe=utf-8&text=prosto
Don't know if doing that is against Google's terms, though. Probably it is.
You could also try running the Ajax client in Rhino. You'll need env-js which provides a pure javascript DOM environment.
It's just hideous enough to work!

Need this particular jar file

I am trying to connect to the bing api through my java application and query bing programmatically. And I found this page online that gives me sample code to just get a feel of how to go about the entire process. But I am unable to compile and run that code because it has two imports namely
com.microsoft.schemas.livesearch._2008._03.search.LiveSearchServiceStub;
com.microsoft.schemas.livesearch._2008._03.search.LiveSearchServiceStub.*;
Could anybody give me a link to get these jar files.
I already googled it, checked sourceforge and everything. So If anyone knows of another site that definitely has this jar file, or if you have a copy of these two jar files please do let me know how I can obtain them. It would be a great help.
Thanks.
By the names of those classes they are just Stub classes, meaning they are just dummy-versions of the classes without any real functionality. You can probably just create your own easily.
Bing provides it search services via Web Services. You can access them from any language that provides a web services interface (or just web access).
Bing API

How to query google through desktop java app?

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.

Categories

Resources