Im very new to Google App Engine development. When integrating GAE with android, is it a good practice to place the code that initializes the endpoints in the Application class ? Meaning, initialize the endpoints once when the app is starting and then refer to those endpoints instances when doing some action with the backend ? My current practice is to create an endpoint instance each time i want to call the backend, but i feel its a little bit heavy and maybe unnecessary.
By "initializing the endpoints" i mean the following code :
Myendpoint.Builder endpointBuilder = new Myendpoint.Builder(
AndroidHttp.newCompatibleTransport(),
new JacksonFactory(),
new HttpRequestInitializer() {
public void initialize(HttpRequest httpRequest) { }
});
Myendpoint endpoint = CloudEndpointUtils.updateBuilder(endpointBuilder).build();