Implementing Rest Api JAVA client android eclipse - java

I am a newbie to Android development so apologies if i am missing something obvious here. I am using Eclipse to put together a simple Android program that will consume a couple of Rest web services. I am attempting to use the Resting API to accomplish this.
I have copied the Resting JAR file into the libs folder of my project and its in the build path however I can't reference any of the Resting classes, i attempt to include the appropriate imports but they fail to resolve.
Has anyone got a complete sample of using Resting to consume a restful web service? Should I look to use a different library perhaps? Simplicity is key for me so the lighter the library the better.
Thanks hugely for any advice you may have

I think the resting jar file may be an archive file which in turn contains all the jar files required to use resting. You need to open the archive using a tool like winrar, extract all the jars inside, put them in the lib folder of your project and reference.
Resting seems fairly simple and lightweight. Mostly, one step.

I haven't used Resting API but I have used Jersey and it is easy to use. Give it a try. As per the referencing things, things should resolve once you add the dependencies. You might need to read a bit how Eclipse handles that.

Resting sample code:
List products = new RestingBuilder("http://myapis.com/productservice",Product.class)
.setPort(8080)
.setVerb(Verb.GET)
.setTransformationType(TransformationType.JSON)
.setConnectionTimeout(3000)
.build();

Related

Plugins to add features to java

I'm working on a project that requires to add some features to an existing java application using Netbeans. After searching the net, i founded that I should use "plugins". I didn't hear of plugins before.
I have a java application that I should download it from the net, then lets say I have to add a button, when clicked, calls a function that is written in some class in the application. In other words I want to make a new class that is able to access the classes and functions that are written in this application.
What I understood from searching the net is that:
-In the downloaded project's folder there is a folder named plugins.
-This folder contains zip files that contains classes and other stuff.
-I should make a plugin and add it to this folder in order to add a specific feature to the application.
That's what I know, if there is something wrong in what I said, I'll be thankful to correct to me.
Now, my question is that I want a link or website that can teach me how to create and add a plugin to an existing java application. Thank you :)
That entirely depends on the java application you're talking about. Not every application has a Plugins functionality. And not every Java Application uses the same Plugin API. The best bet is to go to the site of the App you're talking about and see if they offer a documentation about their Plugin API.

Need Jar Files for Appengine Samples

I need to run code samples that are on this page:
https://cloud.google.com/appengine/docs/java/datastore/queries
I've been able to locate jars for all but the following:
com.google.appengine.api.datastore.Query.Filter;
com.google.appengine.api.datastore.Query.CompositeFilter;
com.google.appengine.api.datastore.Query.CompositeFilterOperator;
Can anyone point me to where they are located?
I'm also a bit concerned that because I'm getting jar files individually
that I might run into some compatibility issues. Is there one
location that has jars for all the samples on the page I mentioned above?
Thx,
Steve
You need to download the GAE SDK and include it on you project. All those classes are included in there.
GAE is a pretty complex PAAS product. You'll need to setup the whole platform in order to use it, you cant just use some bits of it on its own.

How do i merge two or more project file into one project for a java based web app?

i got a web project.i used gof[struts,hibernate,spring,.,.]pattern. actually i not good in struts so my friend taking care of the struts part.well, the problem is ,*
how to merge our project and
we both want to see our code every time whatever the change happen
* .bec we are beginners
You may want to actually keep your project split in modules and use a Code Versioning System(CVS). At the moment, most popular/used are Git and SVN. If you don't have a server, you can use BitBucket to host your code in private or GitHub/Google Code if you want to open source it.
Use SVN or CSV if you have server. other wise you can use online Repository like GitHub.

Where to place META-INF in Android project

I'm writing an app that needs to load dinamically plugins from external libraries.
My first idea was -with very little immagination- to use Java's ServiceLoader and googling a little bit I found documentation that states that this kind of action is supported by Android: http://developer.android.com/reference/java/util/ServiceLoader.html
However I really don't understand where to place my META-INF folder (I'm used to Maven, but I can't use it in this occasion).
Could someone tell me where to place the META-INF folder and what to do to have it working in the usual way?
Stefano

Build a JS server inside of Java for Google AppEngine

I just needed to create a little interface for a project. So I decided to take given code and to run it on Google AppEngine. My problem is, that I'm experienced in JavaScript and got some basic knowledge of Java, but I got no clue how a Java webapp has to be structured. I started Eclipse and installed the AppEngine-addon, downloaded Rhino and env.js (which is necessary for the bunch of code I need to run) but then found me in the situation of sitting on this files not knowing where to put them.
It would be great if someone could tell me in which directory to put which files for Rhino (I assume it's "/war/WEB-INF/lib/"), how to add the env.js-file and how to access all these files inside the .java-file which is the index of the app.
I don't know about app engine in particular, but I have had good success using Rhino jsc to compile script files which extend the Servlet API. The end result is a nice WAR file which you can deploy in any servlet container, and perhaps App Engine as well. See here for my relevant blog post about this technique, and here for a sample Eclipse project.
Have you taken a look at this tutorial on running Rhino on GAE?
It's a link from the official "Will it play in App Engine?" thread.
http://www.appenginejs.org/ may be of interest as well.

Categories

Resources