Hi - I followed the article (
https://developers.google.com/eclipse/docs/endpoints-testdeploy) to:
1. Create a simple Note entity.
2. Then as explained I generated the endpoint.
3. Then I generated the cloud endpoint library.
4. Then I created an Application cloudnotes2013vip and then using Eclipse I 
deployed the app to App-Engine.

Application is deployed successfully.

Then in my main activity I have simply created a EditText & a Send button. 
I am trying to see if I enter some message and click on Send button whether 
the msg gets stored in the DataStore.

I am using Emulator and I have set target to Google API 18.

When I click on send i don't see any error message, but I am able to see 
the entity I tried to add in the DataStore Viewer.

When I click on DataStore Viewer it says -

Oops! We couldn't retrieve your list of Kinds.
Please Try again.

Can someone throw some light as to what wrong is happening here?

Below is the piece of code in my MainActivity - 



package com.cloudnotes;

import java.io.IOException;
import java.util.Date;

import android.app.Activity;
import android.content.Context;
import android.os.AsyncTask;
import android.os.Bundle;
import android.view.Menu;
import android.view.View;
import android.widget.EditText;

import com.cloudnotes.noteendpoint.Noteendpoint;
import com.cloudnotes.noteendpoint.model.Note;
import com.google.api.client.extensions.android.http.AndroidHttp;
import com.google.api.client.http.HttpRequest;
import com.google.api.client.http.HttpRequestInitializer;
import com.google.api.client.json.jackson.JacksonFactory;

public class MainActivity extends Activity {
    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);

      //new EndpointsTask().execute(getApplicationContext());
    }

    @Override
    public boolean onCreateOptionsMenu(Menu menu) {
        getMenuInflater().inflate(R.menu.main, menu);
        return true;
    }
    
    public void sendMsg(View view) {
    EditText msgTxt = (EditText) findViewById(R.id.editText1);
    String msg = msgTxt.getText().toString();
    System.out.println("Note to be inserted - " + msg);
    
    if (msg.length() > 0){
    new EndpointsTask().execute(getApplicationContext());
    }
    }
    
    public class EndpointsTask extends AsyncTask<Context, Integer, Long> {
        protected Long doInBackground(Context... contexts) {
        System.out.println("Entered doInBackground");
          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();
          System.out.println("Entered doInBackground:result - "+result);
      } catch (IOException e) {
        e.printStackTrace();
      }
          return (long) 0;
        }
    }
}

-- 
You received this message because you are subscribed to the Google Groups 
"Google App Engine" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to google-appengine+unsubscr...@googlegroups.com.
To post to this group, send email to google-appengine@googlegroups.com.
Visit this group at http://groups.google.com/group/google-appengine.
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to