Well, that might seem like a silly question, but I'm really a newbie when it comes to Cloud Computing / Google App Engine, etc. To get a better look at it, I started working with some tutorials from developers.google.com, mainly following the tutorials, and then trying to make small changes to the provided code snippets to make sure that I really understood how it works, and not just copy / paste and take everything for granted.
The problem is that I am a bit stuck with the following: the way Android and App Engine interact. I am currently doing this tutorial ( https://developers.google.com/eclipse/docs/endpoints-addentities ). The problem is the following code snippet (client side, on Android):
public class EndpointsTask extends AsyncTask<Context, Integer, Long> { protected Long doInBackground(Context... contexts) { Noteendpoint.Builder endpointBuilder = new Noteendpoint.Builder( AndroidHttp.newCompatibleTransport(), new JacksonFactory(), new HttpRequestInitializer() { public void initialize(HttpRequest httpRequest) { } }); Noteendpoint endpoint = CloudEndpointUtils.updateBuilder( endpointBuilder).build(); try { Note note = new Note().setDescription("Note Description"); String noteID = new Date().toString(); note.setId(noteID); note.setEmailAddress("E-Mail Address"); Note result = endpoint.insertNote(note).execute(); } catch (IOException e) { e.printStackTrace(); } return (long) 0; } }
As far as I understand, at the moment, from the point of view of Cloud Computing, I assumed that the connection between Android and the cloud is through the end object, where the end point is:
Noteendpoint endpoint = CloudEndpointUtils.updateBuilder (endpointBuilder).build();
In addition, the updateBuilder () method looks like this:
public static <B extends AbstractGoogleClient.Builder> B updateBuilder( B builder) { if (LOCAL_ANDROID_RUN) { builder.setRootUrl(LOCAL_APP_ENGINE_SERVER_URL_FOR_ANDROID + "/_ah/api/"); } // only enable GZip when connecting to remote server final boolean enableGZip = builder.getRootUrl().startsWith("https:"); builder.setGoogleClientRequestInitializer(new GoogleClientRequestInitializer() { public void initialize(AbstractGoogleClientRequest<?> request) throws IOException { if (!enableGZip) { request.setDisableGZipContent(true); } } }); return builder;
}
I understand that inserting into the Data Warehouse is done through insertNote () - which basically does the basic standard insert method.
My problem is that I cannot figure out where, in the cloud, the information that I sent from my Android device is caught. To be more specific, I am sending an object, and I cannot see where this object is received in the Cloud. It’s probably not that important with such a basic application, but I want to develop an application with the following structure: I send data from my Android device using REST. I am developing my server code) (which will be located in the Cloud). In my server code, they will receive the data that I send from Android → process this data → add something to the database (a database stored in the cloud) (this is the basic principle explained by VERY primitive terms). That's why I really want to understand how this works, and so far I really don't see where my data is received on the server side. I suggested that there is probably some kind of automatic mechanism behind this? If so, I'm really curious if you could tell me how I can do this programmatically.
In addition, I would like to mention that this code works very well, so there are no errors in it, I just have problems understanding all the details associated with it.
Thanks.
LATER CHANGE: My database will be the App Engine data store. The main problem is that I can’t understand how the connection is made between my Android application and the Google App Engine application (where I will do all the necessary calculations with the data received from Android). I could use a more “obvious” / explanatory (for dummies) code snippet where I really see that the object I'm sending from Android is received in the Google App Engine application. Of course, I saw the result using the Datastore Viewer, which shows that the data is inserted into the database. What interests me is how I can simply send data to the Google App application, get it there and perform some operations on it, and ONLY after I add it to the database.