Android : Sharing POJOs between Android project and java backend project

on Wednesday, September 3, 2014


I was wondering what would be the best way of sharing same POJOs in Android project and in back-end project.


At the moment when I have POJO in back-end, then this POJO has Hibernate and Jackson annotations. On top of the class there is HQL sentences as @NameQueries. When I need the same POJO in the Android project then copy the POJO and remove all the annotations. At the moment I use GSON in the Android project.


So my question is that what would be the best way to get rid of this tedious work when I create the new POJO in back-end and I need it in the Android project too.


So far I have thought about the creating lib project but I have not figured out how I can control the annotations. In Android side I can work with Jackson too, but I would like to get rid of Hibernate stuff.


0 comments:

Post a Comment