Is it possible to use the Google App Engine as a b

2019-04-23 15:17发布

I would like to write a client application for Android that uses the Google App Engine as a database backend. My Android client would connect to the App Engine to save information, then it would connect later for reports. Is it possible to use the App Engine as a backend like this?

5条回答
叼着烟拽天下
2楼-- · 2019-04-23 15:59

No.

In your response to Laurence, you said you want a direct DB connetion. A client cannot connect directly to the GAE datastore. You must write web handlers to interface between the client and your data. It doesn't have to be much, but it must be something.

查看更多
乱世女痞
3楼-- · 2019-04-23 15:59

Yes, it is very possible. You would not connect directly to the GAE database though. A better architecture would be to make your app hit a URL that writes to the DB. For example, you could set up a Struts 2 action that takes the values of your query parameters and then mutates and validates them as necessary before persisting them.

查看更多
何必那么认真
4楼-- · 2019-04-23 16:00

If you're looking for something like the remote api that the App Engine has in python, then you'll be disappointed to find it missing in Java.

That said, absolutely nothing stops your from hitting your app and posting data either through POST / JSON / XML / any other format you can think of. The same thing goes for getting your reports back.

If security is a concern, the OAuth protocol allows you to authenticate to app engine from your android device.

This is an aside, but as far as reporting is concerned, you might not find the app engine a very suitable platform for reporting type apps. Just make sure you understand its limitations - the lack of joins, 1000 object limit, no sum / average, necessary indexes, etc. It's certainly not impossible, but do think carefully about how you're going to model your data.

查看更多
Root(大扎)
5楼-- · 2019-04-23 16:05

Yes, it is possible.

Without more details in your question, any more details in the answer would be speculation.

查看更多
孤傲高冷的网名
6楼-- · 2019-04-23 16:23

Yes, its very much possible. It's something I am also currently working on.

My code uses HTTP GET and HTTP POST and I am using a RESTful service on the GAE.

I'm sorry I can't provide any code because I am still learning however the library I'm using is called RESTLET. They have libraries for both GAE and Android however I'm only using RESTLET on the GAE and I'm just using the HTTP library in the Android SDK for the client.

http://www.restlet.org/

The version you require is 2.0 M6 and not the stable release.

查看更多
登录 后发表回答