Title: refresh google cloud endpoint in android studio
Tags: android-studio;refresh;google-cloud-endpoints
Question: i'm using android studio 1.2.2 to create an android app that relies on a google cloud backend.
i managed to create the app and the backend, to generate backend endpoint to persist data bu now i have added a new constructor to the entity class (to pass parameters that will initialize the object) but i am not able to refresh the api version of this class in the library generated, so there is no new constructor and i can't use.
what are the steps to refresh the contents of this library?
thanks in advance

FROM

```@Entity
public class Coordinates {
@Id
String email;
double latitude;
double longitude;
String timestamp;

public Coordinates(){}

public String getEmail() {
    return email;
}

public void setEmail(String email) {
    this.email = email;
}

public double getLatitude() {
    return latitude;
}

public void setLatitude(double latitude) {
    this.latitude = latitude;
}

public double getLongitude() {
    return longitude;
}

public void setLongitude(double longitude) {
    this.longitude = longitude;
}

public String getTimestamp() {
    return timestamp;
}

public void setTimestamp(String timestamp) {
    this.timestamp = timestamp;
}
}
```

TO

```@Entity
public class Coordinates {
@Id
String email;
double latitude;
double longitude;
String timestamp;

public Coordinates(){}

public Coordinates(String email,double latitude,double longitude,String timestamp) {
    this.email=email;
    this.latitude=latitude;
    this.longitude=longitude;
    this.timestamp=timestamp;
}

public String getEmail() {
    return email;
}

public void setEmail(String email) {
    this.email = email;
}

public double getLatitude() {
    return latitude;
}

public void setLatitude(double latitude) {
    this.latitude = latitude;
}

public double getLongitude() {
    return longitude;
}

public void setLongitude(double longitude) {
    this.longitude = longitude;
}

public String getTimestamp() {
    return timestamp;
}

public void setTimestamp(String timestamp) {
    this.timestamp = timestamp;
}
}
```

Comment: What do you mean you've added a new constructor? Can you include code snippets of what you've done?

Comment: thanks for your answer, as you requested i added the code, as you can see i just added the constructor public Coordinates(String email,double latitude,double longitude,String timestamp)


Here is another answer: When you generate your endpoints JAR to be used in Android it does not transfer all the methods or constructors. I don't know the reason for that, probably written somewhere but haven't seen it. 

I believe you have two options:


Use your Coordinates class without special constructor, ie use getters and setters
Create Coordinates class in Android app and have a helper class which converts your Android App Coordinates class into Endpoint Coordinates class


Comment for this answer: Yes, the generated client libraries only create a representation of your class on the client side that works with the API you generate. I believe option 1 is what you want to go with. Option 2 will not help you because your api will not accept parameters that are not of the type included in the client library.
Comment for this answer: Using the second option, you guarantee that who need convert your Android App Coordinates class into Endpoint Coordinates class will not forget any important parameter, doing set/get in one place. More useful and better solution of poit of view of oriented object paradigm.

another solution is define a contract using interfaces.

{'source': 'StackExchangeDataset', 'subset': 'stackoverflow.com', 'metadata': {'AnswerCount': 1, 'CommentCount': 2, 'ContentLicense': 'CC BY-SA 3.0', 'CreationDate': '2015:00:06/18/15', 'FavoriteCount': None, 'PostTypeId': 1, 'Tags': '<android-studio><refresh><google-cloud-endpoints>', 'Title': 'refresh google cloud endpoint in android studio', 'ViewCount': 109, 'id': 30916484, 'user_AboutMe': '', 'user_AccountId': 477037.0, 'user_DisplayName': 'user888284', 'user_Reputation': 69.0, 'user_Views': 21.0, 'user_id': 888284.0}}