I am trying to integrate Google Cloud datastore into my android app to store and retrieve entities. I have a class which will correspond to a Datastore entity which has several fields which will correspond to its properties.
From my research there seems to be several approaches and having tried some of them they always hit some problem which I have been unable to fix.
What is the simplest approach for this? I just want to store instances of this class (with their properties) in GCD.
Approaches I've tried:
- Endpoints: I followed this tutorial https://rominirani.com/gradle-tutorial-part-9-cloud-endpoints-persistence-android-studio-6e031d6ba7f9#.vuz4izhu7 which worked until I integrated Objectify. When I generated the Endpoint from the class with an Entity and ID annotation the MyBean/MyEndpoint simple example stops working and when I try to view the API i get this
- Cloud Datastore Client Library for Java: (https://cloud.google.com/datastore/docs/reference/libraries)
This seems like it could be nicest approach because in the class I can have a sync method which update/creates an entity however adding the dependancy in Gradle causes the a failure with
:app:transformResourcesWithMergeJavaResForDebug
. I've tried all of the packagingOption exclusions that solutions on SO suggest but no combination I've tried works.
So two questions:
a) What approach is best for my use case? (I.e. simple as possible)
b) For the proposed solution, what am I doing wrong?