Android : Adding a "Shared" module to Android app with App Engine Endpoint backend

on Friday, December 12, 2014


I'm diving into Android development and getting a bit hung up trying to avoid duplicating code.


I'm using Android Studio and have a project with two modules - the app itself, and the GAE endpoint backend.


I want to be able to send objects between the two modules so the approach I'm taking is creating a "shared" module and adding a dependency to it in both the app and the backend modules. In this module I place my shared classes, and when I need to send them back and forth I'm using GSON.


I am not getting any errors until I attempt to debug the app, where the backend build fails with: "Error: package [shared lib namespace] does not exist".


Can anyone describe or point me to an example of how to share code between the app and backend?


Thanks


0 comments:

Post a Comment