Search code examples
androidgoogle-cloud-endpoints

Primitive types cloud endpoints


I am using Google Cloud Endpoints for my Android application, and I have created a Message entity thanks to the datastore.

However I saw in many threads that primitive types are a known issue and one of my Message's fields is a int[].

Will it work, or do I have to use List (Integer) instead?


Solution

  • You can return Message object which contains primitive fields, but you cannot return primitive field like int, float or even String.

    The endpoint will not compile if you have incompatibile return types so check if it works for you. I'm sure will be provided with meaningful error message when given type is not supported as result type.