As of April 12th, you must go to Progress SupportLink to create new support cases or to access existing cases. Please, bookmark the SupportLink URL and use the new portal to contact the support team.
Thanks guys, your solution worked for me as well
On line 5 you use kinveyClient rather than mkinveyClient that you made on line 3.
Thanks,
Hey Damien Bell,
I am facing same problem.. insufficient credentials.. please look through my code
private void saveUserDetail() { final Client mkinveyClient = new Client.Builder(appKey, mySecret,getActivity()).build(); LoginEntity userEntity = new LoginEntity(); AsyncAppData<LoginEntity> myData = kinveyClient.appData("LoginMaster", LoginEntity.class); myData.getEntity(id, new KinveyClientCallback<LoginEntity>() { @Override public void onSuccess(LoginEntity user) { user.setFirstName(et_firstname.getText().toString()); user.setLastName(et_lastname.getText().toString()); user.setEmail(et_Email.getText().toString()); user.setUsername(et_Username.getText().toString()); user.setRole(spr_Role.getSelectedItem().toString()); user.setProjectName(spr_Projects.getSelectedItem().toString()); AsyncAppData<LoginEntity> update=mkinveyClient.appData("LoginMaster", LoginEntity.class); update.save(user, new KinveyClientCallback<LoginEntity>() { @Override public void onFailure(Throwable t) { Log.e(TAG, "failed update", t); } @Override public void onSuccess(LoginEntity u) { Log.v(TAG, "update "+ u.getEmail()); } }); Log.v(TAG, "received "+ user.getEmail()); } @Override public void onFailure(Throwable error) { Log.e(TAG, "failed to fetchByFilterCriteria", error); } }); }
Sukhpal:
The credentials should be your application id (starts with kid_ and can be found in the console when you log in in the upper right corner) and your secret should be immediately next to the app id.
The way that I build the client is something like this:
public static final String appKey = "<ID GOES HERE>";
public static final String mySecret = "<Secret Goes Here>";
Client myAndroidClient = new Client.Builder(appKey, mySecret).build();
In your code it appears as though you're just using the base kinveyClient which won't contain any type of authentication. By instantiating myAndroidClient with these credentials, and using it in place of kinveyClient() you should see your issue resolved.
Thanks.
please tell me this the right credentials or not
i attached a file of logcat... the exception thown by server..
plz look at this..
Thanks,
according to you ...
private void saveProjectDetail() { ProjectEntity projectEntity = new ProjectEntity(); AsyncAppData<ProjectEntity> myData = kinveyClient.appData("ProjectMaster", ProjectEntity.class); myData.getEntity(id, new KinveyClientCallback<ProjectEntity>() { @Override public void onSuccess(ProjectEntity project) { project.setProjectName(et_projectName.getText().toString()); project.setFromDate(et_fromDate.getText().toString()); project.setTeamSize(et_teamSize.getText().toString()); project.setVersion(et_version.getText().toString()); project.setDesc(et_desc.getText().toString()); AsyncAppData<ProjectEntity> savedata=kinveyClient.appData("ProjectMaster", ProjectEntity.class); savedata.save(project, new KinveyClientCallback<ProjectEntity>() { @Override public void onFailure(Throwable t) { // TODO Auto-generated method stub Log.v(TAG, "Failed to save ", t); } @Override public void onSuccess(ProjectEntity p) { // TODO Auto-generated method stub Log.v(TAG, "saved "+ p.getActionId()); } }); Log.v(TAG, "received "+ project.getProjectName()); } @Override public void onFailure(Throwable error) { Log.e(TAG, "failed to fetchByFilterCriteria", error); } }); }
please provide me save code..... i asking for sample code.. plz.
Thanks.
Sukhpal:
It appears as though you aren't calling save after you add the new fields to your object, We added a comment where your save should go, could you give this a shot?
private void updateUserDetail() { LoginEntity userEntity = new LoginEntity(); AsyncAppData<LoginEntity> myData = kinveyClient.appData("LoginMaster", LoginEntity.class); myData.getEntity(id, new KinveyClientCallback<LoginEntity>() { @Override public void onSuccess(LoginEntity user) { user.setFirstName(et_firstname.getText().toString()); user.setLastName(et_lastname.getText().toString()); user.setEmail(et_Email.getText().toString()); user.setUsername(et_Username.getText().toString()); user.setRole(spr_Role.getSelectedItem().toString()); user.setProjectName(spr_Projects.getSelectedItem().toString()); //save here! Log.v(TAG, "received "+ user.getEmail()); } @Override public void onFailure(Throwable error) { Log.e(TAG, "failed to fetchByFilterCriteria", error); } }); }
Thanks,
this is my Entity class...
import com.google.api.client.json.GenericJson; import com.google.api.client.util.Key; import com.kinvey.java.model.KinveyMetaData; public class LoginEntity extends GenericJson { @Key("_id") private String id; @Key("UserName") private String username; @Key("Password") private String password; @Key("FirstName") private String firstname; @Key("LastName") private String lastname; @Key("Email") private String email; @Key("Role") private String role; @Key("ProjectName") private String project; @Key("_kmd") private KinveyMetaData meta; // Kinvey metadata @Key("_acl") private KinveyMetaData.AccessControlList acl; // Kinvey Access Control public LoginEntity(){ } public String getActionId(){ return id; } public void setActionId(String id){ this.id=id; } public String getUsername(){ return username; } public void setUsername(String username){ this.username=username; } public String getPassword(){ return password; } public void setPassword(String pass){ this.password=pass; } public String getEmail(){ return email; } public void setEmail(String email){ this.email=email; } public String getFirstName(){ return firstname; } public void setFirstName(String fname){ this.firstname=fname; } public String getLastName(){ return lastname; } public void setLastName(String lname){ this.lastname=lname; } public String getRole(){ return role; } public void setRole(String role){ this.role=role; } public String getProjectName(){ return project; } public void setProjectName(String pname){ this.project=pname; } }
this is my function for update detail... i also tried with save method but it create new row in the collection... so please tell me what should be done.. thnx
private void updateUserDetail() { LoginEntity userEntity = new LoginEntity(); AsyncAppData<LoginEntity> myData = kinveyClient.appData("LoginMaster", LoginEntity.class); myData.getEntity(id, new KinveyClientCallback<LoginEntity>() { @Override public void onSuccess(LoginEntity user) { user.setFirstName(et_firstname.getText().toString()); user.setLastName(et_lastname.getText().toString()); user.setEmail(et_Email.getText().toString()); user.setUsername(et_Username.getText().toString()); user.setRole(spr_Role.getSelectedItem().toString()); user.setProjectName(spr_Projects.getSelectedItem().toString()); Log.v(TAG, "received "+ user.getEmail()); } @Override public void onFailure(Throwable error) { Log.e(TAG, "failed to fetchByFilterCriteria", error); } }); }
Can you show me your code? That should not be happening.
Thanks,
please provide me a sample of this type if you have..
Thanx Bell, but this is not working for me.. whenever i fetch the entity by _id .. it return a Object of the entity with records but not set the values .. and when i call the save method it add a new row in the database.. please help.
Thanks,
Sukhpal Singh
Sukhpal Singh
Hello, I am new Kinvey User. I am using kinvey for developing android apps. I have to update or edit a row in to my existing collection.. so plz help how can i impliment this..