Search code examples
androidgoogle-app-engineandroid-studiobackendgoogle-cloud-endpoints

Connecting different Android project to an existing Google-Endpoints Backend


I am working on an Android project that needs three versions of the same application (for example: Admin version, User version, Custom version). I have already created a Google-App-Engine endpoints backend in the User version of the app. I have to start working on the other two versions now and I want to connect these two versions to the backend I created in the User version. I have tried finding the answer to this on the internet but I haven't been successful in doing so. I believe it is possible to connect the other versions of the app to the backend by importing the endpoint libraries from the cloud into the android projects somehow but I haven't been able to find a way to do so yet. I did come across a way to import an existing module in the Android project but if I do that, then any time when I make changes to the backend in the "User" version, I will have to re-import the module in other versions of the app. I am so lost and confused.

Any help will be deeply appreciated.

Thank you!


Solution

  • Are all of your Android applications in the same Android Studio project? If so I think you might be able to just add compile project(path: ':{yourBackendModuleGoesHere}', configuration: 'android-endpoints') to each of your Android apps build.gradle.

    You could probably also make it work even if your backend is in a separate AndroidStudio project as long as they're part of the same gradle build.