You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cayenne.apache.org by "John Huss (JIRA)" <ji...@apache.org> on 2011/08/22 08:12:29 UTC

[jira] [Created] (CAY-1604) Android support for ROP apps

Android support for ROP apps
----------------------------

                 Key: CAY-1604
                 URL: https://issues.apache.org/jira/browse/CAY-1604
             Project: Cayenne
          Issue Type: Improvement
          Components: ROP
    Affects Versions: 3.1M2
         Environment: Tested Android 2.3, Cayenne 3.1
            Reporter: John Huss
            Priority: Minor


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.

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (CAY-1604) Android support for ROP apps

Posted by "John Huss (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/CAY-1604?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13095755#comment-13095755 ] 

John Huss commented on CAY-1604:
--------------------------------

Ok, I took a stab and pulling these classes into Cayenne itself.  Just talking the necessary files there are about 17 classes; I added them into the reflect package.  They all have package access so they aren't visible to users of the library but only exist to support Cayenne's internal workings.  The changes I made from the original harmony source are:
1) change the package
2) change the imports
3) add a comment at the top of the class indicating that these files came from Harmony
4) commented out one method which wasn't needed that would have brought in a lot more classes

I didn't pull in the tests related to these classes, but that is something that could be done if desired.  This patch doesn't do anything about java.rmi - those are all untouched still.

> Android support for ROP apps
> ----------------------------
>
>                 Key: CAY-1604
>                 URL: https://issues.apache.org/jira/browse/CAY-1604
>             Project: Cayenne
>          Issue Type: Improvement
>          Components: ROP
>    Affects Versions: 3.1M2
>         Environment: Tested Android 2.3, Cayenne 3.1
>            Reporter: John Huss
>            Priority: Minor
>              Labels: patch
>         Attachments: cayenne-android-support.patch, tutorial-rop-android.zip
>
>   Original Estimate: 168h
>  Remaining Estimate: 168h
>
> 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.

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (CAY-1604) Android support for ROP apps

Posted by "Andrus Adamchik (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/CAY-1604?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13090479#comment-13090479 ] 

Andrus Adamchik commented on CAY-1604:
--------------------------------------

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

I wouldn't mind if we internalize the alternative introspectors ... after all Harmony is an Apache project, so we can take and change code from them with no restriction. So if we can have an isolated patch for this change, bringing in a few new classes somewhere to org.apache.cayenne.reflect or org.apache.cayenne.util , we can just apply it, taking a step closer to Android. 

not ready to comment on java.rmi.* just yet.


> Android support for ROP apps
> ----------------------------
>
>                 Key: CAY-1604
>                 URL: https://issues.apache.org/jira/browse/CAY-1604
>             Project: Cayenne
>          Issue Type: Improvement
>          Components: ROP
>    Affects Versions: 3.1M2
>         Environment: Tested Android 2.3, Cayenne 3.1
>            Reporter: John Huss
>            Priority: Minor
>              Labels: patch
>         Attachments: cayenne-android-support.patch, tutorial-rop-android.zip
>
>   Original Estimate: 168h
>  Remaining Estimate: 168h
>
> 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.

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Updated] (CAY-1604) Android support for ROP apps

Posted by "John Huss (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/CAY-1604?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

John Huss updated CAY-1604:
---------------------------

    Attachment: android java beans.patch

> Android support for ROP apps
> ----------------------------
>
>                 Key: CAY-1604
>                 URL: https://issues.apache.org/jira/browse/CAY-1604
>             Project: Cayenne
>          Issue Type: Improvement
>          Components: ROP
>    Affects Versions: 3.1M2
>         Environment: Tested Android 2.3, Cayenne 3.1
>            Reporter: John Huss
>            Priority: Minor
>              Labels: patch
>         Attachments: android java beans.patch, cayenne-android-support.patch, tutorial-rop-android.zip
>
>   Original Estimate: 168h
>  Remaining Estimate: 168h
>
> 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.

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Updated] (CAY-1604) Android support for ROP apps

Posted by "John Huss (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/CAY-1604?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

John Huss updated CAY-1604:
---------------------------

    Attachment: tutorial-rop-android.zip
                cayenne-android-support.patch

Patch and example Android application

> Android support for ROP apps
> ----------------------------
>
>                 Key: CAY-1604
>                 URL: https://issues.apache.org/jira/browse/CAY-1604
>             Project: Cayenne
>          Issue Type: Improvement
>          Components: ROP
>    Affects Versions: 3.1M2
>         Environment: Tested Android 2.3, Cayenne 3.1
>            Reporter: John Huss
>            Priority: Minor
>              Labels: patch
>         Attachments: cayenne-android-support.patch, tutorial-rop-android.zip
>
>   Original Estimate: 168h
>  Remaining Estimate: 168h
>
> 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.

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira