I've been following the app engine documentation on using the java low level api to interact with an app engine datastore. I'm trying to figure out what imports and syntax change I need to make this work in android. I have below mixed between android and java code. What is the proper android syntax for the java put() and get() methods?
package com.direction.investor.bcms;
//PSUEDO CODE
//JAVA IMPORTS. ANDROID EQUIVALENTS?
//import com.google.appengine.api.datastore.DatastoreService;
//import com.google.appengine.api.datastore.DatastoreServiceFactory;
//import com.google.appengine.api.datastore.Entity;
//import com.google.appengine.api.datastore.Key;
//import com.google.appengine.api.datastore.KeyFactory;
//import com.google.appengine.api.users.User;
//import com.google.appengine.api.users.UserService;
//import com.google.appengine.api.users.UserServiceFactory;
//import java.io.IOException;
//import java.util.Date;
//import javax.servlet.http.HttpServlet;
//import javax.servlet.http.HttpServletRequest;
//import javax.servlet.http.HttpServletResponse;
//import java.io.IOException;
//import java.util.Date;
//import javax.servlet.http.HttpServlet;
//import javax.servlet.http.HttpServletRequest;
//import javax.servlet.http.HttpServletResponse;
import android.widget.EditText;
public class ContactInfo {
public void onSubmitDataButtonPress{
//CONVERT INPUT TO STRING
EditText streetName;
streetName = (EditText) findViewById (R.id.streetNameEdit);
String streetInfo = streetName.getText().toString();
EditText zipCode;
zipCode = (EditText) findViewById (R.id.zipCodeEdit);
String zipInfo = zipCode.getText().toString();
}
// PLACE STRINGS ON DATASTORE
public class ContactInfoServlet extends HttpServlet {
public void doPost(HttpServletRequest req, HttpServletResponse resp)
throws IOException {
Key ContactInfoKey = KeyFactory.createKey("Contact", contactkey);
String street = req.getParameter("streetInfo");
String zip = req.getParameter("zipInfo");
Date date = new Date();
Entity contacts = new Entity("UserContactInfo", contactkey);
contacts.setProperty("date", date);
contacts.setProperty("street", street);
greeting.setProperty("zip", zip);
DatastoreService datastore = DatastoreServiceFactory.getDatastoreService();
datastore.put(contacts);
}
}
}