Hi Dimuthu,
It's unlikely that those libraries are available on Android, I'm afraid.
 So I think you'll need to use the Isis RO applib as a baseline, but you
won't be able to port it all over.

But let me step back a bit.

The RO applib depends on:
- joda-time, for date handling
- jackson, for JSON processing
- guava, for general stuff
- JBoss RestEasy client, for a typesafe client-side interface
- JAX-RS classes (eg javax.ws.rs.core.MediaType)
- JDOM (some XML stuff, I suppose, though can't quite remember where)
- Apache HttpClient for the network stuff

Of these, it seems that most are available on Android
- Joda-time, eg [1] (with some workarounds)
- Jackson, eg [2]
- Google Guava, eg [3]
- JDOM, eg [4]
- HttpClent, eg [5]

HOWEVER, the JBoss RestEasy client-side stuff you will have to dump; there
is no equivalent that I know of.  That means that the annotated
"XxxResource" interfaces, eg DomainObjectResource, DomainServiceResource,
HomePageResource etc, you will just have to ignore.  The JAX-RS stuff
(mostly enums) also aren't available, so you'll need to replace with
something equivalent.

All of the XxxRepresentations, though, you should be able to keep, pretty
much unchanged.  And probably all of the Isis-defined enums you could use
mostly unchanged too.

In terms of accessing the resources, what you need to do is to create
something equivalent to the RestfulClient class.  The methods that pertain
to XxxResource you should ignore.  The methods you want to port over are
the follow(...) ones, that allow links to be, well, followed.

~~~
It might be helpful for you to look at the C# applib that I did [6].
 You'll see that it has a very similar set of representations.  It's
equivalent of Isis' RestfulClient is called ROClient [7]; you can see it
that this API is basically the follow(...) stuff, with methods that
correspond to the templated XxxResource methods that JBoss RestEasy gives
us in Isis.

HTH
Dan



[1]
http://stackoverflow.com/questions/5059663/android-java-joda-date-is-slow
[2]
http://w2davids.wordpress.com/android-json-parsing-made-easy-using-jackson/
[3] http://www.appbrain.com/stats/libraries/details/guava/google-guava
[4] https://github.com/hunterhacker/jdom/wiki/JDOM2-and-Android
[5]
http://android-developers.blogspot.co.uk/2011/09/androids-http-clients.html
[6]
https://github.com/danhaywood/restfulobjects-wsa/tree/master/RestfulObjects.Applib/RestfulObjects.ApplibPCL
[7]
https://github.com/danhaywood/restfulobjects-wsa/blob/master/RestfulObjects.Applib/RestfulObjects.ApplibPCL/ROClient.cs


On 28 June 2013 04:23, DImuthu Upeksha <[email protected]> wrote:

> Hi Dan,
> I looked into applib of RO viewer and I feel that it is better to use same
> applib in Android viewer rather than writing from the beginning. But the
> problem is the dependencies. As an example when I use the code of RO applib
> it gives errors at imports. ex : import javax.ws.rs.GET. It gives these
> errors because my project doesn't have references to those third party
> libraries. How can I find those necessary libraries?
>
> Thnx
> Dimuthu
> --
> Regards
>
> W.Dimuthu Upeksha
> Undergraduate
> Department of Computer Science And Engineering
>
> University of Moratuwa, Sri Lanka
>

Reply via email to