I used url link in my app to send and receive data from server. If some body decompile my apk file and get source can use url and send spam or do some buy without pay!
now how can I protect url links?
This is a sample of request to server that I used. (still I use local server until finish application)
public class GetProduct {
ArrayList<Product> arrayList;
ProgressDialog progressDialog;
String url = "http://192.168.43.46/fasabazar/android/getProductsFullInfo";
OnProductRecieved onProductRecieved = null;
public GetProduct(final OnProductRecieved onProductRecieved, final Context context) {
arrayList = new ArrayList<>();
progressDialog = new ProgressDialog(context);
this.onProductRecieved = onProductRecieved;
JsonArrayRequest request = new JsonArrayRequest(Request.Method.GET, url, null, new Response.Listener<JSONArray>() {
@Override
public void onResponse(JSONArray response) {
JSONArray jsonArray = (JSONArray) response;
progressDialog.dismiss();
onProductRecieved.OnRecieved(response);
// Toast.makeText(context, jsonArray.toString(), Toast.LENGTH_SHORT).show();
}
}, new Response.ErrorListener() {
@Override
public void onErrorResponse(VolleyError error) {
}
});
progressDialog.show();
request.setRetryPolicy(new DefaultRetryPolicy(7000, DefaultRetryPolicy.DEFAULT_MAX_RETRIES, DefaultRetryPolicy.DEFAULT_BACKOFF_MULT));
RequestQueue requestQueue = Volley.newRequestQueue(context);
requestQueue.add(request);
}
public interface OnProductRecieved {
void OnRecieved(JSONArray response);
}
}