google-cloud-endpoints

How to return a list of custom objects on Objectify

痴心易碎 提交于 2019-12-11 01:28:15
问题 I'm working on an Android project which uses Google App Engine for backend as described here: Using Android & Google App Engine on Android Studio. I have some model classes on the backend side like User and Item, and I'm trying to return a list of Items user has. public List<Ref<Item>> getItems() { return items; } When I try to Sync Project with Gradle Files , I get this error: Error:Execution failed for task ':backend:appengineEndpointsGetClientLibs'. There was an error running endpoints

Using http instead of https in AppEngine endpoint to avoid SSLHandshakeException

我的未来我决定 提交于 2019-12-11 01:08:07
问题 My problem is the same as SSLHandshakeException when trying to reach app engine endpoint (so yes, it's a duplicate to that extent). The answer there says that I need to change from https to http. So how do I do that? I am using java app engine. My web.xml does not have anywhere <user-data-constraint> <transport-guarantee>CONFIDENTIAL</transport-guarantee> </user-data-constraint> Also in the android client, I connect to the server with MyServer service = MyServer.Builder builder = new MyServer

Setting parent key but not child key while using endpoint-proto-datastore

一世执手 提交于 2019-12-10 20:21:05
问题 How can I set a parent/ancestor for an EndpointsModel and have the entity ID/Key generated automatically by datastore? I've tried to adapt the keys_with_ancestors sample but seem to be hitting a bit of a block because it requires both id and parent to be specified. I'd like to do something similar except provide only parent id or key and have entity id/key auto-generated by the app engine datastore. This following shows how I would do it using just NDB. class Parent(ndb.Model): name = ndb

How to access specific Google Cloud Endpoints API versions on android clients

本小妞迷上赌 提交于 2019-12-10 18:17:01
问题 Six months ago, I wrote my Google Cloud Endpoints (GCE) as a module of my Android project on Android Studio (following this tutorial) , everything was going right, but the last week I had to make some significant changes on my API, so I followed the recommendations of the documentation and create a new version of the API . Now that I have this new version of my API called "v2", I'm not sure how to connect it to the Android app, it seems that the generated .jar of the API is for the first

Approach to serialize cloud endpoint model class to Android file system

£可爱£侵袭症+ 提交于 2019-12-10 17:13:27
问题 I have successfully created a cloud endpoint model that allows for easy retrieval of information from App Engine. To reduce the roundtrips and provide a faster user experience, I have identified one instance I wish to store to local storage. Throughout the rest of my app, I am using ObjectInputStream to read and write the objects such as: FileInputStream fis = context.openFileInput("PRIVFILE"); ObjectInputStream ois = new ObjectInputStream(fis); AppModelState s = (AppModelState) ois

Testing google cloud endpoints locally

那年仲夏 提交于 2019-12-10 16:54:51
问题 I been trying to write some code using google cloud endpoints IN app engine and I've also signed up for the trusted tester program but my request is still pending, so as far as I know i can access the endpoints only when they are hosted in the appspot domain so is there any way to consume the endpoints locally so that I can continue development until my request is being considered for cloud endpoints as a trusted tester? 回答1: This isn't well documented publicly (all the documentation is

How to Unit Test Google Cloud Endpoints Java Using Android Studio 0.8

眉间皱痕 提交于 2019-12-10 15:35:29
问题 I've found a few posts, but they either refer to front-end testing, or python. There is one tutorial for java GCE but there's no specificity on how to set it up in Android Studio, just a few random references to Eclipse. eg Unit tests in Android Studio 0.8 https://developers.google.com/appengine/docs/java/tools/localunittesting#Java_Writing_Datastore_and_memcache_tests https://www.youtube.com/watch?v=z47B1nhC3K0 Feel free to yell at me if I've missed some relevant post and direct me to it.

Do we HAVE to generate and use client libraries to use Google App Engine's Endpoints?

故事扮演 提交于 2019-12-10 11:55:18
问题 I am currently developing an Swift iOS app with GAE Endpoints for the RESTful API. It seems like all the tutorials and documents make you generate and use client libraries if you need to use the API on the client side. I was wondering if it's possible for me to use the API by just using plain url request or Alamofire and get the result in JSON format? 回答1: Yes, it's totally possible to access endpoints via HTTP requests. The client libraries just help you to generate those requests without

Returning an empty list on Google App Engine behaves differently on the dev server and when deployed

流过昼夜 提交于 2019-12-10 10:47:28
问题 I've created an endpoint that returns a list of items. When the list is empty, I was expecting to see an empty list in the JSON, but the list field was instead omitted. That's not what happens on the dev server. Ex: @ApiMethod(name = "udinic", path = "udinic") public List<UdinicResponse> getUdinics() { List<UdinicResponse> list = new ArrayList<>(); UdinicResponse res = new UdinicResponse(); res.bla = "sds"; list.add(res); return list; } static class UdinicResponse { String bla; public String

Why don't Google Cloud Endpoints Support Simple Object Return Types?

左心房为你撑大大i 提交于 2019-12-10 10:23:42
问题 Most of my methods return Strings, Integers, Booleans, etc and I bet that holds for 99% of developers, sure we sometimes return complex objects, arrays, etc. but most of the time something much simpler will do. Why would Cloud Endpoints not support this? Thanks! 回答1: So there are workarounds for returning "simple object types", in java you could return a StringResponse which would look something like this: class StringResponse { String value; setter, getter... etc } 回答2: Because they are