Uploaded image for project: 'Cayenne'
  1. Cayenne
  2. CAY-1604

Android support for ROP apps

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Closed
    • Minor
    • Resolution: Abandoned
    • 3.1M2
    • None
    • ROP
    • Tested Android 2.3, Cayenne 3.1

    Description

      I tried out Cayenne ROP on Android and this is what I found: it doesn't work out of the box, but it can be made to work with a bit of effort.

      The Hessian library refers to a few classes that are not present in Android:
      java.rmi.Remote
      java.rmi.RemoteException

      Cayenne itself refers to a few other classes missing in Android:
      java.beans.PropertyDescriptor
      java.beans.IntrospectionException

      So references to these need to be dealt with. Here is what I did:

      1) Use the existing open source"hessdroid" library instead of the regular hessian library
      2) Remove reference to java.rmi.Remote from org.apache.cayenne.remote.RemoteService
      3) Change RemoteException to IOException in org.apache.cayenne.remote.RemoteService
      4) Use the java.beans code from Apache Harmony repackaged as com.googlecode.openbeans. I created the "openbeans" project on Google Code to host this code.

      Only the cayenne-client library needs to be changed in this way. The server can stay the same, but it needs to have access to the openbeans library so that those classes are defined.

      With these changes I was able to run the ROP client tutorial code in an Android app. I've attached the patch so you can see exactly what was needed. I don't know what the proper course of action would be to integrate something like this; presumably these aren't the kind of changes you would want to make to the core library, just to an android-only version. So maybe you have an idea.

      I've attached the patch and the example project.

      Attachments

        1. tutorial-rop-android.zip
          1.85 MB
          John Huss
        2. cayenne-android-support.patch
          5 kB
          John Huss
        3. android java beans.patch
          174 kB
          John Huss

        Activity

          People

            Unassigned Unassigned
            johnthuss John Huss
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Time Tracking

                Estimated:
                Original Estimate - 168h
                168h
                Remaining:
                Remaining Estimate - 168h
                168h
                Logged:
                Time Spent - Not Specified
                Not Specified