Mike James Johnson
Mike James Johnson

Reputation: 734

Have Android app users create and change objects on Google Cloud Storage

I am looking for a strategy to have global objects that can be accessed across all users on all devices. My idea is to create an object or file and put it on Google Cloud Server, and using Datastore, Blobstore, or Cloud Storage (or maybe something else?), and have the object/file change as different users interact with it and alter variable values.

Now, how in the world can I do this - I am having a lot of trouble understanding the documentation that Google offers. Are there any convenient APIs for this? If so, how can these API's be accessed? Currently, I have followed the Android Studio "Hello Endpoints" setup, and I have a working backend module running on AppEngine.

So far I have learned how to create an API and API methods:

    @Api(
        name = "myApi",
        version = "v1",
        namespace = @ApiNamespace(
                ownerDomain = "backend.myapplication.Mike.example.com",
                ownerName = "backend.myapplication.Mike.example.com",
                packagePath = ""
        )
)
public class MyEndpoint {

    /**
     * A simple endpoint method that takes a name and says Hi back
     */
    @ApiMethod(name = "sayHi")
    public MyBean sayHi(@Named("name") String name) {
        MyBean response = new MyBean();
        response.setData("Hi, " + name);
        return response;
    }

}

So this shows I have successfully created a Cloud Endpoints / backend that goes with an App Engine project.

So, what I was hoping to do with this set up is to create an API method to save data to the cloud server, and then have other users on other devices to be able to retrieve that data.

Upvotes: 1

Views: 122

Answers (1)

JJ Geewax
JJ Geewax

Reputation: 10579

If you're looking for something like "a big shared object" that lots of people can all change collaboratively, you might want to check out Firebase, which does this and keeps everyone in sync (and integrates nicely with Android and iOS).

Upvotes: 1

Related Questions