I have successfully created the api in cloud endpoint and deployed it in app engine. Its in python. also I have generated library and have imported in my project.Its in my import
import com.appspot.corner_fresh.fresh_api.FreshApi;
How can i access methods in my api. I have methods like fresh_api.user.insert
and fresh_api.user.detail
. I could not get any detailed documentation of python endpoint.
I tried this
final HttpTransport transport = AndroidHttp.newCompatibleTransport();
JsonFactory jsonFactory = new JacksonFactory();
FreshApi.Builder builder = new FreshApi.Builder( transport, jsonFactory, null );
builder.setApplicationName( appName );
FreshApi service = builder.build();
try {
Json response = service.fresh_api.users.list( ).execute();
Toast.makeText(getApplicationContext(), response.toString(), Toast.LENGTH_SHORT).show();
} catch (IOException e) {
Toast.makeText(getApplicationContext(), "sexyfghfd", Toast.LENGTH_SHORT).show();
}
but, first I couldn't understand it. Then, what to pass as appName in builder.setApplicationName( appName );
also, its not recognising methodName in
response = service.fresh_api.users.list( ).execute();
how to execute api and get response. Thanks
No comments:
Post a Comment