You MUST read the Babiato Rules before making your first post otherwise you may get permanent warning points or a permanent Ban.
Our resources on Babiato Forum are CLEAN and SAFE. So you can use them for development and testing purposes. If your are on Windows and have an antivirus that alerts you about a possible infection: Know it's a false positive because all scripts are double checked by our experts. We advise you to add Babiato to trusted sites/sources or disable your antivirus momentarily while downloading a resource. "Enjoy your presence on Babiato"
private void getDatasFromApi(String bodyParams) {
final ProgressDialog pd = new ProgressDialog(this);
pd.setMessage("Loading");
pd.setCancelable(false);
pd.show();
final String requestBody = bodyParams;
String url = "https://sstrace.qdocs.in/postlic/verifyappjsonv2";
StringRequest stringRequest = new StringRequest(Request.Method.POST, url, new Response.Listener<String>() {
@Override
public void onResponse(String result) {
System.out.println("result=="+result);
if (result != null) {
pd.dismiss();
try {
JSONObject object = new JSONObject(result);
if(object.getString("status").equals("0")) {
Utility.setSharedPreferenceBoolean(getApplicationContext(), Constants.isLoggegIn, false);
android.app.AlertDialog.Builder builder = new android.app.AlertDialog.Builder(NewDashboard.this);
builder.setCancelable(false);
//builder.setMessage(R.string.verificationMessage);
builder.setMessage(object.getString("msg"));
builder.setTitle("");
builder.setPositiveButton(R.string.ok, new DialogInterface.OnClickListener() {
public void onClick(DialogInterface dialog, int which) {
if (Utility.isConnectingToInternet(getApplicationContext())) {
logoutparams.put("deviceToken", device_token);
JSONObject obj=new JSONObject(logoutparams);
Log.e("params ", obj.toString());
System.out.println("Logout Details=="+obj.toString());
loginOutApi(obj.toString());
} else {
makeText(getApplicationContext(),R.string.noInternetMsg, Toast.LENGTH_SHORT).show();
}
}
});
android.app.AlertDialog alert = builder.create();
alert.show();
}else {
if (Utility.getSharedPreferences(getApplicationContext(), Constants.loginType).equals("student")) {
aparams.put("id", Utility.getSharedPreferences(getApplicationContext(), "studentId"));
aparams.put("user_type", Utility.getSharedPreferences(getApplicationContext(), Constants.loginType));
JSONObject obj = new JSONObject(aparams);
Log.e("params ", obj.toString());
System.out.println("Status Details==" + obj.toString());
checkStudentStatus(obj.toString());
} else {
aparams.put("id", Utility.getSharedPreferences(getApplicationContext(), Constants.parentsId));
aparams.put("user_type", Utility.getSharedPreferences(getApplicationContext(), Constants.loginType));
JSONObject obj = new JSONObject(aparams);
Log.e("params ", obj.toString());
System.out.println("Status Details==" + obj.toString());
checkStudentStatus(obj.toString());
}
}
} catch (JSONException e) {
e.printStackTrace();
}
} else {
pd.dismiss();
}
}
}, new Response.ErrorListener() {
@Override
public void onErrorResponse(VolleyError volleyError) {
pd.dismiss();
Log.e("Volley Error", volleyError.toString());
Toast.makeText(NewDashboard.this, R.string.apiErrorMsg, Toast.LENGTH_LONG).show();
}
}) {
@Override
public Map<String, String> getHeaders() throws AuthFailureError {
headers.put("Client-Service", Constants.clientService);
headers.put("Auth-Key", Constants.authKey);
headers.put("Content-Type", Constants.contentType);
headers.put("User-ID", Utility.getSharedPreferences(getApplicationContext(), "userId"));
headers.put("Authorization", Utility.getSharedPreferences(getApplicationContext(), "accessToken"));
return headers;
}
@Override
public String getBodyContentType() {
return "application/json; charset=utf-8";
}
@Override
public byte[] getBody() throws AuthFailureError {
try {
return requestBody == null ? null : requestBody.getBytes("utf-8");
} catch (UnsupportedEncodingException uee) {
VolleyLog.wtf("Unsupported Encoding while trying to get the bytes of %s using %s", requestBody, "utf-8");
return null;
}
}
};
//Creating a Request Queue
RequestQueue requestQueue = Volley.newRequestQueue(NewDashboard.this);
//Adding request to the queue
requestQueue.add(stringRequest);
}
just aks bard and or chat gpt
anybody can look in to this plsHas any body nulled it. it has query in dashboard.java
app\src\main\java\com\**Name**\students\NewDashboard.java
Code:private void getDatasFromApi(String bodyParams) { final ProgressDialog pd = new ProgressDialog(this); pd.setMessage("Loading"); pd.setCancelable(false); pd.show(); final String requestBody = bodyParams; String url = "https://sstrace.qdocs.in/postlic/verifyappjsonv2"; StringRequest stringRequest = new StringRequest(Request.Method.POST, url, new Response.Listener<String>() { @Override public void onResponse(String result) { System.out.println("result=="+result); if (result != null) { pd.dismiss(); try { JSONObject object = new JSONObject(result); if(object.getString("status").equals("0")) { Utility.setSharedPreferenceBoolean(getApplicationContext(), Constants.isLoggegIn, false); android.app.AlertDialog.Builder builder = new android.app.AlertDialog.Builder(NewDashboard.this); builder.setCancelable(false); //builder.setMessage(R.string.verificationMessage); builder.setMessage(object.getString("msg")); builder.setTitle(""); builder.setPositiveButton(R.string.ok, new DialogInterface.OnClickListener() { public void onClick(DialogInterface dialog, int which) { if (Utility.isConnectingToInternet(getApplicationContext())) { logoutparams.put("deviceToken", device_token); JSONObject obj=new JSONObject(logoutparams); Log.e("params ", obj.toString()); System.out.println("Logout Details=="+obj.toString()); loginOutApi(obj.toString()); } else { makeText(getApplicationContext(),R.string.noInternetMsg, Toast.LENGTH_SHORT).show(); } } }); android.app.AlertDialog alert = builder.create(); alert.show(); }else { if (Utility.getSharedPreferences(getApplicationContext(), Constants.loginType).equals("student")) { aparams.put("id", Utility.getSharedPreferences(getApplicationContext(), "studentId")); aparams.put("user_type", Utility.getSharedPreferences(getApplicationContext(), Constants.loginType)); JSONObject obj = new JSONObject(aparams); Log.e("params ", obj.toString()); System.out.println("Status Details==" + obj.toString()); checkStudentStatus(obj.toString()); } else { aparams.put("id", Utility.getSharedPreferences(getApplicationContext(), Constants.parentsId)); aparams.put("user_type", Utility.getSharedPreferences(getApplicationContext(), Constants.loginType)); JSONObject obj = new JSONObject(aparams); Log.e("params ", obj.toString()); System.out.println("Status Details==" + obj.toString()); checkStudentStatus(obj.toString()); } } } catch (JSONException e) { e.printStackTrace(); } } else { pd.dismiss(); } } }, new Response.ErrorListener() { @Override public void onErrorResponse(VolleyError volleyError) { pd.dismiss(); Log.e("Volley Error", volleyError.toString()); Toast.makeText(NewDashboard.this, R.string.apiErrorMsg, Toast.LENGTH_LONG).show(); } }) { @Override public Map<String, String> getHeaders() throws AuthFailureError { headers.put("Client-Service", Constants.clientService); headers.put("Auth-Key", Constants.authKey); headers.put("Content-Type", Constants.contentType); headers.put("User-ID", Utility.getSharedPreferences(getApplicationContext(), "userId")); headers.put("Authorization", Utility.getSharedPreferences(getApplicationContext(), "accessToken")); return headers; } @Override public String getBodyContentType() { return "application/json; charset=utf-8"; } @Override public byte[] getBody() throws AuthFailureError { try { return requestBody == null ? null : requestBody.getBytes("utf-8"); } catch (UnsupportedEncodingException uee) { VolleyLog.wtf("Unsupported Encoding while trying to get the bytes of %s using %s", requestBody, "utf-8"); return null; } } }; //Creating a Request Queue RequestQueue requestQueue = Volley.newRequestQueue(NewDashboard.this); //Adding request to the queue requestQueue.add(stringRequest); }
Has any body nulled it. it has query in dashboard.java
app\src\main\java\com\**Name**\students\NewDashboard.java
Code:private void getDatasFromApi(String bodyParams) { final ProgressDialog pd = new ProgressDialog(this); pd.setMessage("Loading"); pd.setCancelable(false); pd.show(); final String requestBody = bodyParams; String url = "https://sstrace.qdocs.in/postlic/verifyappjsonv2"; StringRequest stringRequest = new StringRequest(Request.Method.POST, url, new Response.Listener<String>() { @Override public void onResponse(String result) { System.out.println("result=="+result); if (result != null) { pd.dismiss(); try { JSONObject object = new JSONObject(result); if(object.getString("status").equals("0")) { Utility.setSharedPreferenceBoolean(getApplicationContext(), Constants.isLoggegIn, false); android.app.AlertDialog.Builder builder = new android.app.AlertDialog.Builder(NewDashboard.this); builder.setCancelable(false); //builder.setMessage(R.string.verificationMessage); builder.setMessage(object.getString("msg")); builder.setTitle(""); builder.setPositiveButton(R.string.ok, new DialogInterface.OnClickListener() { public void onClick(DialogInterface dialog, int which) { if (Utility.isConnectingToInternet(getApplicationContext())) { logoutparams.put("deviceToken", device_token); JSONObject obj=new JSONObject(logoutparams); Log.e("params ", obj.toString()); System.out.println("Logout Details=="+obj.toString()); loginOutApi(obj.toString()); } else { makeText(getApplicationContext(),R.string.noInternetMsg, Toast.LENGTH_SHORT).show(); } } }); android.app.AlertDialog alert = builder.create(); alert.show(); }else { if (Utility.getSharedPreferences(getApplicationContext(), Constants.loginType).equals("student")) { aparams.put("id", Utility.getSharedPreferences(getApplicationContext(), "studentId")); aparams.put("user_type", Utility.getSharedPreferences(getApplicationContext(), Constants.loginType)); JSONObject obj = new JSONObject(aparams); Log.e("params ", obj.toString()); System.out.println("Status Details==" + obj.toString()); checkStudentStatus(obj.toString()); } else { aparams.put("id", Utility.getSharedPreferences(getApplicationContext(), Constants.parentsId)); aparams.put("user_type", Utility.getSharedPreferences(getApplicationContext(), Constants.loginType)); JSONObject obj = new JSONObject(aparams); Log.e("params ", obj.toString()); System.out.println("Status Details==" + obj.toString()); checkStudentStatus(obj.toString()); } } } catch (JSONException e) { e.printStackTrace(); } } else { pd.dismiss(); } } }, new Response.ErrorListener() { @Override public void onErrorResponse(VolleyError volleyError) { pd.dismiss(); Log.e("Volley Error", volleyError.toString()); Toast.makeText(NewDashboard.this, R.string.apiErrorMsg, Toast.LENGTH_LONG).show(); } }) { @Override public Map<String, String> getHeaders() throws AuthFailureError { headers.put("Client-Service", Constants.clientService); headers.put("Auth-Key", Constants.authKey); headers.put("Content-Type", Constants.contentType); headers.put("User-ID", Utility.getSharedPreferences(getApplicationContext(), "userId")); headers.put("Authorization", Utility.getSharedPreferences(getApplicationContext(), "accessToken")); return headers; } @Override public String getBodyContentType() { return "application/json; charset=utf-8"; } @Override public byte[] getBody() throws AuthFailureError { try { return requestBody == null ? null : requestBody.getBytes("utf-8"); } catch (UnsupportedEncodingException uee) { VolleyLog.wtf("Unsupported Encoding while trying to get the bytes of %s using %s", requestBody, "utf-8"); return null; } } }; //Creating a Request Queue RequestQueue requestQueue = Volley.newRequestQueue(NewDashboard.this); //Adding request to the queue requestQueue.add(stringRequest); }
private void getDatasFromApi(String bodyParams) {
final ProgressDialog pd = new ProgressDialog(this);
pd.setMessage("Loading");
pd.setCancelable(false);
pd.show();
final String requestBody = bodyParams;
String url = "https://localhost.com/";
StringRequest stringRequest = new StringRequest(Request.Method.POST, url, new Response.Listener<String>() {
@Override
public void onResponse(String result) {
System.out.println("result=="+result);
if (result != null) {
pd.dismiss();
try {
JSONObject object = new JSONObject(result);
if(object.getString("status").equals("1")) {
Utility.setSharedPreferenceBoolean(getApplicationContext(), Constants.isLoggegIn, false);
android.app.AlertDialog.Builder builder = new android.app.AlertDialog.Builder(NewDashboard.this);
builder.setCancelable(false);
//builder.setMessage(R.string.verificationMessage);
builder.setMessage(object.getString("msg"));
builder.setTitle("");
builder.setPositiveButton(R.string.ok, new DialogInterface.OnClickListener() {
public void onClick(DialogInterface dialog, int which) {
if (Utility.isConnectingToInternet(getApplicationContext())) {
logoutparams.put("deviceToken", device_token);
JSONObject obj=new JSONObject(logoutparams);
Log.e("params ", obj.toString());
System.out.println("Logout Details=="+ obj);
loginOutApi(obj.toString());
} else {
makeText(getApplicationContext(),R.string.noInternetMsg, Toast.LENGTH_SHORT).show();
}
}
});
android.app.AlertDialog alert = builder.create();
alert.show();
}else {
if (Utility.getSharedPreferences(getApplicationContext(), Constants.loginType).equals("student")) {
aparams.put("id", Utility.getSharedPreferences(getApplicationContext(), "studentId"));
aparams.put("user_type", Utility.getSharedPreferences(getApplicationContext(), Constants.loginType));
JSONObject obj = new JSONObject(aparams);
Log.e("params ", obj.toString());
System.out.println("Status Details==" + obj);
checkStudentStatus(obj.toString());
} else {
aparams.put("id", Utility.getSharedPreferences(getApplicationContext(), Constants.parentsId));
aparams.put("user_type", Utility.getSharedPreferences(getApplicationContext(), Constants.loginType));
JSONObject obj = new JSONObject(aparams);
Log.e("params ", obj.toString());
System.out.println("Status Details==" + obj);
checkStudentStatus(obj.toString());
}
}
} catch (JSONException e) {
e.printStackTrace();
}
} else {
pd.dismiss();
}
}
}, new Response.ErrorListener() {
@Override
public void onErrorResponse(VolleyError volleyError) {
pd.dismiss();
Log.e("Volley Error", volleyError.toString());
Toast.makeText(NewDashboard.this, R.string.apiErrorMsg, Toast.LENGTH_LONG).show();
}
}) {
@Override
public Map<String, String> getHeaders() throws AuthFailureError {
headers.put("Client-Service", Constants.clientService);
headers.put("Auth-Key", Constants.authKey);
headers.put("Content-Type", Constants.contentType);
headers.put("User-ID", Utility.getSharedPreferences(getApplicationContext(), "userId"));
headers.put("Authorization", Utility.getSharedPreferences(getApplicationContext(), "accessToken"));
return headers;
}
@Override
public String getBodyContentType() {
return "application/json; charset=utf-8";
}
@Override
public byte[] getBody() throws AuthFailureError {
return requestBody == null ? null : requestBody.getBytes(StandardCharsets.UTF_8);
}
};
//Creating a Request Queue
RequestQueue requestQueue = Volley.newRequestQueue(NewDashboard.this);
//Adding request to the queue
requestQueue.add(stringRequest);
}
been waiting for some1 to pitch on this let me tryPHP:private void getDatasFromApi(String bodyParams) { final ProgressDialog pd = new ProgressDialog(this); pd.setMessage("Loading"); pd.setCancelable(false); pd.show(); final String requestBody = bodyParams; String url = "https://localhost.com/"; StringRequest stringRequest = new StringRequest(Request.Method.POST, url, new Response.Listener<String>() { @Override public void onResponse(String result) { System.out.println("result=="+result); if (result != null) { pd.dismiss(); try { JSONObject object = new JSONObject(result); if(object.getString("status").equals("1")) { Utility.setSharedPreferenceBoolean(getApplicationContext(), Constants.isLoggegIn, false); android.app.AlertDialog.Builder builder = new android.app.AlertDialog.Builder(NewDashboard.this); builder.setCancelable(false); //builder.setMessage(R.string.verificationMessage); builder.setMessage(object.getString("msg")); builder.setTitle(""); builder.setPositiveButton(R.string.ok, new DialogInterface.OnClickListener() { public void onClick(DialogInterface dialog, int which) { if (Utility.isConnectingToInternet(getApplicationContext())) { logoutparams.put("deviceToken", device_token); JSONObject obj=new JSONObject(logoutparams); Log.e("params ", obj.toString()); System.out.println("Logout Details=="+ obj); loginOutApi(obj.toString()); } else { makeText(getApplicationContext(),R.string.noInternetMsg, Toast.LENGTH_SHORT).show(); } } }); android.app.AlertDialog alert = builder.create(); alert.show(); }else { if (Utility.getSharedPreferences(getApplicationContext(), Constants.loginType).equals("student")) { aparams.put("id", Utility.getSharedPreferences(getApplicationContext(), "studentId")); aparams.put("user_type", Utility.getSharedPreferences(getApplicationContext(), Constants.loginType)); JSONObject obj = new JSONObject(aparams); Log.e("params ", obj.toString()); System.out.println("Status Details==" + obj); checkStudentStatus(obj.toString()); } else { aparams.put("id", Utility.getSharedPreferences(getApplicationContext(), Constants.parentsId)); aparams.put("user_type", Utility.getSharedPreferences(getApplicationContext(), Constants.loginType)); JSONObject obj = new JSONObject(aparams); Log.e("params ", obj.toString()); System.out.println("Status Details==" + obj); checkStudentStatus(obj.toString()); } } } catch (JSONException e) { e.printStackTrace(); } } else { pd.dismiss(); } } }, new Response.ErrorListener() { @Override public void onErrorResponse(VolleyError volleyError) { pd.dismiss(); Log.e("Volley Error", volleyError.toString()); Toast.makeText(NewDashboard.this, R.string.apiErrorMsg, Toast.LENGTH_LONG).show(); } }) { @Override public Map<String, String> getHeaders() throws AuthFailureError { headers.put("Client-Service", Constants.clientService); headers.put("Auth-Key", Constants.authKey); headers.put("Content-Type", Constants.contentType); headers.put("User-ID", Utility.getSharedPreferences(getApplicationContext(), "userId")); headers.put("Authorization", Utility.getSharedPreferences(getApplicationContext(), "accessToken")); return headers; } @Override public String getBodyContentType() { return "application/json; charset=utf-8"; } @Override public byte[] getBody() throws AuthFailureError { return requestBody == null ? null : requestBody.getBytes(StandardCharsets.UTF_8); } }; //Creating a Request Queue RequestQueue requestQueue = Volley.newRequestQueue(NewDashboard.this); //Adding request to the queue requestQueue.add(stringRequest); }
Here is the modified code that works.
String url = "https://sstrace.qdocs.in/postlic/verifyappjsonv2";
String url = "https://localhost.com";
if(object.getString("status").equals("0")) {
if(object.getString("status").equals("1")) {
I just bypassed it.been waiting for some1 to pitch on this let me try
Can you help me with this? New to android studio not much experience with it.been waiting for some1 to pitch on this let me try
I just bypassed it. rbeen waiting for some1 to pitch on this let me try
Honestly buddy, I tried to build project on my windows for 3 hours and too much errors. I went with Mac. What worked for me was, changing gradle version. to 7.3.3 and Gradle plugin version to 7.2.0
i can assist you on that let me compile with this changes and let me ping u backI just bypassed it. r
Honestly buddy, I tried to build project on my windows for 3 hours and too much errors. I went with Mac. What worked for me was, changing gradle version. to 7.3.3 and Gradle plugin version to 7.2.0
Also changed this two lines (40 and 41) with
androidTestImplementation 'androidx.test.ext:junit:1.1.3'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.4.0'
Released Date: 9 January, 2024
General Changes
- Whole system updated for PHP version 8.1
- Updated for Codeigniter 3 latest version 3.1.13
- Api level 33 update
Bug Fixes
- File upload issue
- Processing Fees issue
@MichaelKingzztonne i tried ur modification unable to connect to my test server give me error unable to get response from api, any inputsPHP:private void getDatasFromApi(String bodyParams) { final ProgressDialog pd = new ProgressDialog(this); pd.setMessage("Loading"); pd.setCancelable(false); pd.show(); final String requestBody = bodyParams; String url = "https://localhost.com/"; StringRequest stringRequest = new StringRequest(Request.Method.POST, url, new Response.Listener<String>() { @Override public void onResponse(String result) { System.out.println("result=="+result); if (result != null) { pd.dismiss(); try { JSONObject object = new JSONObject(result); if(object.getString("status").equals("1")) { Utility.setSharedPreferenceBoolean(getApplicationContext(), Constants.isLoggegIn, false); android.app.AlertDialog.Builder builder = new android.app.AlertDialog.Builder(NewDashboard.this); builder.setCancelable(false); //builder.setMessage(R.string.verificationMessage); builder.setMessage(object.getString("msg")); builder.setTitle(""); builder.setPositiveButton(R.string.ok, new DialogInterface.OnClickListener() { public void onClick(DialogInterface dialog, int which) { if (Utility.isConnectingToInternet(getApplicationContext())) { logoutparams.put("deviceToken", device_token); JSONObject obj=new JSONObject(logoutparams); Log.e("params ", obj.toString()); System.out.println("Logout Details=="+ obj); loginOutApi(obj.toString()); } else { makeText(getApplicationContext(),R.string.noInternetMsg, Toast.LENGTH_SHORT).show(); } } }); android.app.AlertDialog alert = builder.create(); alert.show(); }else { if (Utility.getSharedPreferences(getApplicationContext(), Constants.loginType).equals("student")) { aparams.put("id", Utility.getSharedPreferences(getApplicationContext(), "studentId")); aparams.put("user_type", Utility.getSharedPreferences(getApplicationContext(), Constants.loginType)); JSONObject obj = new JSONObject(aparams); Log.e("params ", obj.toString()); System.out.println("Status Details==" + obj); checkStudentStatus(obj.toString()); } else { aparams.put("id", Utility.getSharedPreferences(getApplicationContext(), Constants.parentsId)); aparams.put("user_type", Utility.getSharedPreferences(getApplicationContext(), Constants.loginType)); JSONObject obj = new JSONObject(aparams); Log.e("params ", obj.toString()); System.out.println("Status Details==" + obj); checkStudentStatus(obj.toString()); } } } catch (JSONException e) { e.printStackTrace(); } } else { pd.dismiss(); } } }, new Response.ErrorListener() { @Override public void onErrorResponse(VolleyError volleyError) { pd.dismiss(); Log.e("Volley Error", volleyError.toString()); Toast.makeText(NewDashboard.this, R.string.apiErrorMsg, Toast.LENGTH_LONG).show(); } }) { @Override public Map<String, String> getHeaders() throws AuthFailureError { headers.put("Client-Service", Constants.clientService); headers.put("Auth-Key", Constants.authKey); headers.put("Content-Type", Constants.contentType); headers.put("User-ID", Utility.getSharedPreferences(getApplicationContext(), "userId")); headers.put("Authorization", Utility.getSharedPreferences(getApplicationContext(), "accessToken")); return headers; } @Override public String getBodyContentType() { return "application/json; charset=utf-8"; } @Override public byte[] getBody() throws AuthFailureError { return requestBody == null ? null : requestBody.getBytes(StandardCharsets.UTF_8); } }; //Creating a Request Queue RequestQueue requestQueue = Volley.newRequestQueue(NewDashboard.this); //Adding request to the queue requestQueue.add(stringRequest); }
Here is the modified code that works.
It worked .. thanksIf you want to null make following changes in
app/src/main/java/com/qdocs/app/students/NewDashboard.java
Change line 1006 from
Code:String url = "https://sstrace.qdocs.in/postlic/verifyappjsonv2";
to
And change line 1017 fromCode:String url = "https://localhost.com";
Code:if(object.getString("status").equals("0")) {
to
Code:if(object.getString("status").equals("1")) {
where u able to connect properly ??It worked .. thanks
We get it, advertisements are annoying!
However in order to keep our huge array of resources free of charge we need to generate income from ads so to use the site you will need to turn off your adblocker.
If you'd like to have an ad free experience you can become a Babiato Lover by donating as little as $5 per month. Click on the Donate menu tab for more info.