public class MainActivity extends AppCompatActivity {
JSONObject oAuthParams;
private ActivityMainBinding binding;
@Override
protected void onCreate(Bundle savedInstanceState){
super.onCreate(
savedInstanceState);
binding = ActivityMainBinding.inflate(
getLayoutInflater());
setContentView(binding.
getRoot());
Dexter.withContext(this).
withPermissions(Manifest.
permission.READ_EXTERNAL_
STORAGE,
Manifest.permission.WRITE_
EXTERNAL_STORAGE).
withListener(new MultiplePermissionsListener() {
@Override
public void onPermissionsChecked(
MultiplePermissionsReport multiplePermissionsReport) {
Toast.makeText(MainActivity.
this, "Checked!", Toast.LENGTH_SHORT).show();
}
@Override
public void onPermissionRationaleShouldBeS
hown(List<PermissionRequest> list, PermissionToken permissionToken) {
}
}).check();
oAuthParams = new JSONObject();
oAuthParams.put("client_id", "1000.
JPEVARGXLZ7A0DCXS5SWJD67BZQP8H
");
oAuthParams.put("client_
secret", "
1828b4d6b27f86ec3e0d678fe7db32
bb0b8b12a189");
oAuthParams.put("refresh_
token", "1000.
36381ce85872f1e9d8d4d98465f883
d8.
a64ea86b1cae0c70bc2c3187db3f9f
e6");
ZCAuth auth = ZCAuth.getInstance(
oAuthParams);
ZCProjectConfig config = ZCProjectConfig.newBuilder()
.setProjectId(
11431000000012157L)
.setProjectKey("10047918014")
.setZcAuth(auth)
.setProjectDomain("
https://catalystjava-788403152.development.catalystserverless.com")
.setEnvironment("Development")
.build();
ZCProject project = ZCProject.initProject(config,
true);
ZCObject object = ZCObject.getInstance(project);
ZCTable table = null;
try {
table = object.getTable(
11431000000012198L);
} catch (Exception e) {
//Exception caught ******************************
******************************
******
Toast.makeText(this, "Exception", Toast.LENGTH_SHORT).show();
e.printStackTrace();
}
ZCRowObject row = ZCRowObject.getInstance();
row.set("Name","George Smith");
row.set("Age","25");
try {
table.insertRow(row);
} catch (Exception e) {
e.printStackTrace();
}
}
}