Pouton Gerald
Pouton Gerald

Reputation: 1625

One to Many appengine connected android project

I have successfully created an app-engine connected android project. So now I want to take it to the natural next level: one endpoint api, many different android apps. My question is this: Does the eclipse plugin allow for this? If so, how would I do that using the google eclipse plugin?

Upvotes: 2

Views: 245

Answers (1)

tony m
tony m

Reputation: 4779

Try the below steps to ready your 2nd android app to use the same app engine backend with cloud endpoints:

1, Generate a client id for your 2nd android app in the api console

2, Update the existing app engine code (generated from 1st app), to include the id of the 2nd app in the list of allowed clients and deploy this code

example:
@Api(
name = "tictactoe",
version = "v1",
clientIds = {Ids.WEB_CLIENT_ID, Ids.1STANDROID_CLIENT_ID,   Ids.2NDANDROID_CLIENT_ID,Ids.IOS_CLIENT_ID},
audiences = {Ids.ANDROID_AUDIENCE} // audiences parameter will contain web client id

)

3, Add the client libraries generated earlier from your app engine backend code, to the 2nd app. Refer this link to reconfirm the required libraries : Consuming endpoints in android . You can also do a comparison between the libs folder of your 1st app and 2nd app to ensure all libraries are added.

4, In the 2nd app, add the classes representing the models in your backend, request initialisers, etc, same as in your first app.

5, In the 2nd app, at required areas in your application logic, you can access the api by creating the service object and then calling the api exposed by the endpoint

Upvotes: 0

Related Questions