Ok, this may seem as a dumb question, but I am really new when it comes to Cloud Computing/Google App Engine etc. In order to get more familiarized with it, I started to work with some tutorials from developers.google.com, basically following the tutorials and then trying to perform small changes to the provided pieces of code, in order to make sure that I actually understood the way it works, not just copy/paste and take everything for granted.
The problem is that I got a little bit stuck at the following aspect: the way Android and App Engine actually communicate. I am currently doing this tutorial( https://developers.google.com/eclipse/docs/endpoints-addentities). The problem is the following piece of code (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 my understanding helps me, at this moment, in terms of Cloud Computing, I inferred that the communication between Android and the Cloud is performed via endpoint object, where endpoint is:
Noteendpoint endpoint = CloudEndpointUtils.updateBuilder (endpointBuilder).build();
Also, 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 do understand that the insertion in the Data Storage is performed via insertNote() - which, basically, performs basic a standard insert method.
My problem is that I cannot really understand where, in the cloud, the information that I've sent from my Android device is caught. To be more specific, I am sending an object, and I cannot really see where that object is received in the Cloud. Probably at this kind of basic application, is not that relevant, but I want to develop an application with the following structure: I am sending data from my Android device using REST. I am developing my server-side code )(which will be in the Cloud). In my server-side code will receive the data I am sending from Android -> process that data -> add something in the database (database stored in the cloud) (this is the basic principle explained in VERY primitive terms). That's why I really want to understand the way this works and so far, I really cannot see where my data is received on the server side. I have assumed that there is probably some automatic mechanism behind this ? If so, I am really interested, if you could indicate me, how can I do that programatically.
Also, I would like to mention that this code works really good, so there are no errors in it, I just have problems in understanding all the details related to it.
Thank you.
LATER EDIT: My database will be App Engine Datastore. The main problem is that I cannot really understand the way the communication between my Android Application and the Google App Engine Application (where I will be making all the necessary computations with the data I receive from Android) is made. I could really use a more "obvious"/explainatory (for dummies) piece of code where I actually see that the object I send from Android is received in the Google App Engine Application. Of course, I saw the result, using Datastore Viewer, which shows that the data is inserted in the database. What interests me is how I can actually just send the data in my Google App Engine Application, receive it there and perform some operations on it, and ONLY after I will add it in the database.