https://code.google.com/p/jsonengine/
I have uploaded it to my app engine, I can see the Admin Panel but i'm not sure how I can use it to make json requests.
Do I have to write my own classes or does it do it automatically?
Can someone explain to me how this library works. I have read the wiki many times and I don't get it.
Can I use this library to make json requests from my mobile app to list/update/create records on the server?
JSONEngine is a RESTful database. It is not a library to make JSON requests, it is a library to store/retrieve/handle JSON requests. Its not a library, its a server.
You can read/write data to it by making HTTP calls, as documented in their Usage Guide. Its up to you to decide how (or what library) that you want to save/retrieve data from this JSONEngine. There are dozens of Java libraries for accessing REST API, such as UniRest for example.
| Can I use this library to make json requests from my mobile app to list/update/create records on the server?
Nope, again this is not a library, its a server. You can use any Java REST library to make calls to store/retrieve data from this JSONEngine server.
EDIT: Additional clarification
Related
Android web view is not what i looking for.Android interface is completely different from the web view.Do I want to make my Web and Android app to use REST web services? I am designing my web using springMVC.
What data are you expecting to exchange from and to the website? Does this mean you will be adding, deleting, updating the data or just simply retrieving
Regardless I would look at Json data if your website is capable of providing that. If Yes, I would recommend using retrofit to download the data onto your application and use it however you like. Retrofit is also capable of working in conjunction with CRUD methods as well.
I need to know if I write Rest API in JAVA using Spring framework and I will be using it in angular js front end, is it possible to use the same API's for Andriod app later. Is it a good to use same api's for both web and app, I have no idea about android development, please help.
If your API is RESTful, and by that I mean at least stateless and resource based. Then yeah, it doesn't matter what program you're requesting data from.
If your are able to process the response into your front end (reading the format, etc). It'll be fine. Just make sure your API's endpoints work correctly and are configured to handle the request your programs will be using to communicate with your API (most of the times these are http requests)
I need to a JSON REST-Client to send json via html
DELETE
PUT
GET
POST
method, and get json response, to be able to set headers as well.
I want to use the minimum of dependencies and 3rd party jars.
From my search in the web I found a code samples using local web server like tomcat, and dynamic web projects.
I want to use a simple java/maven project, with the minimum 3rd party jar and without any server (I don't get why should I need one, I just need to connect to remote server and server of my on).
Thanks
btw. the samples use spring or jersey, it's best to use just HttpConnection of Apache?
If you don't mind working against your existing server for development, then you certainly don't need your own.
Java provides an easy enough to use HttpUrlConnection class that can you can readily leverage to make HTTP requests to your server.
But I would suggest any of the multitude of JSON libraries (json.org, jackson, gson, etc.) to help manage marshaling the JSON. It's simply easier to pick one of those up than rewrite that wheel.
Other than that, you don't need any 3rd party jars for a project like this. You certainly don't need Jersey or Spring.
Currently i have a website offering some product. The webserver sits on the same system as the database and directly accesses it to retrieve the required information for the HTML frontend. Now i think it is good to separate the database from the webserver via an API server. The reason why i want to use an API server is that it might be possible that future applications, other than the website, will need access to the information on the system.
The system which i want should consist of the following components:
A database which will store all the required information.
An API server which will be implemented in Java and should use oauth2 for authorizing user requests. The API server will have the only direct connection to the database.
A webserver.
So basically what i have in mind is that i want to build my website on top of that API server. The user will register/login/... over the website and the website implementation will internally query the API server as a webservice on behalf of the user. The API server would then return the data from the database. That way the HTML frontend is just an application using the API server and will never itself be in direct contact with the database.
I think that this is an often encountered problem for which a good solution exists. I am unsure if this solution is the way to go though. Could you help me out and/or point me in the right direction from here?
Thank you.
As far as I know, it is not advisable to have a separate API server for a couple of reasons: decreasing performance and increasing compexity of a system. So basically you should avoid this type of solution for as long as possible.
You should definitely read M. Fowler: "Enterprise Architecture Patterns" for inspiration.
Returning to your question: have you considered making this API layer as a module (library)?
If I haven't convinced you, try reading Java RMI documentation (http://www.oracle.com/technetwork/java/javase/tech/index-jsp-136424.html)
I'm developing a Java ME app and I want to give it social features. Is it possible to connect to Facebook or Twitter directly from the app, without an intermediate server?
These API's are just HTTP when it comes down to bits-on-the-wire. Java ME supports HTTP with the classes in the javax.microedition.io.* package.
http://java.sun.com/javame/reference/apis/jsr118/javax/microedition/io/Connector.html
http://java.sun.com/javame/reference/apis/jsr118/javax/microedition/io/HttpConnection.html
It's been a while but ISTR having to use GET and POST for everything when using these, no RESTful PUT and DELETE.
Java Client Libraries for the Twitter API
Facebook access for Java
Those should get you started.
You don't need to use any type of middleware or anything to access services that expose an API, but you will need a client library that either you or somebody else has built (like the ones linked to above).
Good luck!