Updating status on server in onDestroy method - android

I want to update status for a user when a user closes his app directly.
I tried this but this isn't working :
public class ExitService extends IntentService {
private static String TAG = ExitService.class.getSimpleName();
public ExitService() {
super(TAG);
}
#Override
protected void onHandleIntent(Intent intent) {
if (intent != null) {
String callNo = intent.getStringExtra("callNo");
String status = intent.getStringExtra("status");
updateExitStatus(callNo, status);
}
}
public void updateExitStatus(final String callNo,final String status){
StringRequest strReq1= new StringRequest(Request.Method.POST,
Config.UTL_STATUS, new Response.Listener<String>(){
public void onResponse(String response) {
}
}, new Response.ErrorListener() {
#Override
public void onErrorResponse(VolleyError error) {
Log.e(TAG, "Error: " + error.getMessage());
Toast.makeText(getApplicationContext(),
error.getMessage(), Toast.LENGTH_SHORT).show();
}
}) {
#Override
protected Map<String, String> getParams() {
Map<String, String> params = new HashMap<String, String>();
params.put("callNo", callNo);
params.put("status",status);
Log.e(TAG, "Posting params: " + params.toString());
return params;
}
};
// Adding request to request queue
MyApplication.getInstance().addToRequestQueue(strReq1);
}
}
I have onResume which will update the status to "1"(taking 1 for online and 0 for offline)
The app should work in background too, therefore onStop and onPause ruled out from this equation.

try this it works for me...
public class App_killed extends Service {
#Override
public IBinder onBind(Intent intent) {
return null;
}
#Override
public int onStartCommand(Intent intent, int flags, int startId) {
Log.d("ClearFromRecentService", "Service Started");
return START_NOT_STICKY;
}
#Override
public void onDestroy() {
super.onDestroy();
Log.d("ClearFromRecentService", "Service Destroyed");
}
public void onTaskRemoved(Intent rootIntent) {
Log.e("ClearFromRecentService", "END");
//Code here call your network call using volley/Asynch task..
App_close();
Toast.makeText(getApplicationContext(), "Warning: App killed", Toast.LENGTH_LONG).show();
//stopSelf();
}
private void App_close() {
// Tag used to cancel the request
String tag_string_req = "close_app";
StringRequest strReq = new StringRequest(Request.Method.POST,
AppConfig.URL_CLOSE_APP, new Response.Listener<String>() {
#Override
public void onResponse(String response) {
Log.d("close App", "Killed Response: " + response.toString());
} catch (Exception e) {
// JSON error
e.printStackTrace();
}
}
}, new Response.ErrorListener() {
#Override
public void onErrorResponse(VolleyError error) {
Log.e("close app", "Killed Error: " + error.getMessage());
}
}) {
#Override
protected Map<String, String> getParams() {
// Posting parameters to login url
Map<String, String> params = new HashMap<String, String>();
params.put("status", status);
params.put("mobile", callNo);
return params;
}
};
// Adding request to request queue
VollyGlobal.getInstance().addToRequestQueue(strReq, tag_string_req);
}
}
IN manifest
<service
android:name=".App_killed"
android:stopWithTask="false" />
Now start the service in your MainActivity;
startService(new Intent(getBaseContext(), App_killed.class));
Now in your VolleyGlobal class:
public class VollyGlobal extends Application {
private static Context context;
public static final String TAG = VollyGlobal.class.getSimpleName();
private RequestQueue mRequestQueue;
private static VollyGlobal mInstance;
#Override
public void onCreate() {
super.onCreate();
mInstance = this;
VollyGlobal.context = getApplicationContext();
}
public static Context getAppContext() {
return VollyGlobal.context;
}
public static synchronized VollyGlobal getInstance() {
return mInstance;
}
public RequestQueue getRequestQueue() {
if (mRequestQueue == null) {
mRequestQueue = Volley.newRequestQueue(getApplicationContext());
}
return mRequestQueue;
}
public <T> void addToRequestQueue(Request<T> req, String tag) {
req.setTag(TextUtils.isEmpty(tag) ? TAG : tag);
getRequestQueue().add(req);
}
public <T> void addToRequestQueue(Request<T> req) {
req.setTag(TAG);
getRequestQueue().add(req);
}
public void cancelPendingRequests(Object tag) {
if (mRequestQueue != null) {
mRequestQueue.cancelAll(tag);
}
}
private Request<?> setDefaultRetryPolicy(Request<?> request) {
request.setRetryPolicy(new DefaultRetryPolicy(0,
DefaultRetryPolicy.DEFAULT_MAX_RETRIES, DefaultRetryPolicy.DEFAULT_BACKOFF_MULT));
return request;
}
}

Make your call to Server in Intent Service & call that service from onDestroy before super.onDestory().
#Override
protected void onDestroy() {
startService(new Intent(this, ServerUpdateIntentService.class));
super.onDestroy();
}
And for Intent Service use this link :
https://code.tutsplus.com/tutorials/android-fundamentals-intentservice-basics--mobile-6183

Related

Unable to send post request with volley android like ajax

I have a problem with volley, I googled around for samples to upload the image
with volley, however, since I'm a beginner, I have a hard time trying to make my code that works in
ajax into android (Trying to do the eact same thing with volley). The following code is what I want to do with android
volley Multipart. Some tips or examples will be great. I would love to hear from you!
$.ajax({
type: 'post',
processData: false,
contentType: false,
data: "/imagepath/sample.PNG",
url: "https://linktotheimageuploader/upload",
async: true,
success: function (res) {
if (res.status == 0) {
console.log(res);
} else {
// NOP
}
}
, error: function () {
//failed to upload
}
});
I tried to convert it to Volley android like the following but I am unable to achieve what I want to do.
public void uploadImage(String url , final File fileName) {
final File encodedString = fileName;
RequestQueue rq = Volley.newRequestQueue(this);
Log.d("URL", url);
StringRequest stringRequest = new StringRequest(Request.Method.POST,
url, new Response.Listener<String>() {
#Override
public void onResponse(String response) {
try {
Log.e("RESPONSE", response);
JSONObject json = new JSONObject(response);
Toast.makeText(getBaseContext(),
"The image is upload" +response, Toast.LENGTH_SHORT)
.show();
} catch (JSONException e) {
Log.d("JSON Exception", e.toString());
Toast.makeText(getBaseContext(),
"Error while loadin data!",
Toast.LENGTH_LONG).show();
}
}
}, new Response.ErrorListener() {
#Override
public void onErrorResponse(VolleyError error) {
Log.d("ERROR", "Error [" + error + "]");
Toast.makeText(getBaseContext(),
"Cannot connect to server", Toast.LENGTH_LONG)
.show();
}
}) {
#Override
protected Map<String, String> getParams() {
Map<String, String> params = new HashMap<String, String>();
params.put(encodedString); // I want to set the file not a String,
return params;
}
};
rq.add(stringRequest);
}
First, To get callBack from the server in MultipartUploadRequest, create a class by extending the UploadServiceBroadcastReceiver
public class SingleUploadBroadcastReceiver extends UploadServiceBroadcastReceiver {
public interface Delegate {
void onProgress(int progress);
void onProgress(long uploadedBytes, long totalBytes);
void onError(Exception exception);
void onCompleted(int serverResponseCode, byte[] serverResponseBody);
void onCancelled();
}
private String mUploadID;
private Delegate mDelegate;
public void setUploadID(String uploadID) {
mUploadID = uploadID;
}
public void setDelegate(Delegate delegate) {
mDelegate = delegate;
}
#Override
public void onProgress(String uploadId, int progress) {
if (uploadId.equals(mUploadID) && mDelegate != null) {
mDelegate.onProgress(progress);
}
}
#Override
public void onProgress(String uploadId, long uploadedBytes, long totalBytes) {
if (uploadId.equals(mUploadID) && mDelegate != null) {
mDelegate.onProgress(uploadedBytes, totalBytes);
}
}
#Override
public void onError(String uploadId, Exception exception) {
if (uploadId.equals(mUploadID) && mDelegate != null) {
mDelegate.onError(exception);
}
}
#Override
public void onCompleted(String uploadId, int serverResponseCode, byte[] serverResponseBody) {
if (uploadId.equals(mUploadID) && mDelegate != null) {
mDelegate.onCompleted(serverResponseCode, serverResponseBody);
}
}
#Override
public void onCancelled(String uploadId) {
if (uploadId.equals(mUploadID) && mDelegate != null) {
mDelegate.onCancelled();
}
}
}
Then, in your activity:
public class YourActivity extends Activity implements SingleUploadBroadcastReceiver.Delegate {
private static final String TAG = "AndroidUploadService";
private final SingleUploadBroadcastReceiver uploadReceiver =
new SingleUploadBroadcastReceiver();
#Override
protected void onResume() {
super.onResume();
uploadReceiver.register(this);
}
#Override
protected void onPause() {
super.onPause();
uploadReceiver.unregister(this);
}
public void uploadMultipart(final Context context) {
try {
String uploadId = UUID.randomUUID().toString();
uploadReceiver.setDelegate(this);
uploadReceiver.setUploadID(uploadId);
new MultipartUploadRequest(context, uploadId, "http://upload.server.com/path")
.addFileToUpload("/absolute/path/to/your/file", "your-param-name")
.setNotificationConfig(new UploadNotificationConfig())
.setMaxRetries(2)
.startUpload();
} catch (Exception exc) {
Log.e(TAG, exc.getMessage(), exc);
}
}
#Override
public void onProgress(int progress) {
//your implementation
}
#Override
public void onProgress(long uploadedBytes, long totalBytes) {
//your implementation
}
#Override
public void onError(Exception exception) {
//your implementation
}
#Override
public void onCompleted(int serverResponseCode, byte[] serverResponseBody) {
//your implementation
}
#Override
public void onCancelled() {
//your implementation
}
}
I have done this with Volley in two different ways:
Sending the image as a Base64 encoded string
Sending the image as multipart
Sending it as encoded String
This method will encode a bitmap into a Base64 String which you can send as a parameter in your request. Then, the server can decode the String back to an image.
public String bitmapToString(Bitmap bmp){
ByteArrayOutputStream baos = new ByteArrayOutputStream();
bmp.compress(Bitmap.CompressFormat.JPEG, 100, baos);
byte[] imageBytes = baos.toByteArray();
String encodedImage = Base64.encodeToString(imageBytes, Base64.DEFAULT);
return encodedImage;
}
StringRequest stringRequest = new StringRequest(Request.Method.POST,
url, new Response.Listener<String>() {
#Override
public void onResponse(String response) {
}, new Response.ErrorListener() {
#Override
public void onErrorResponse(VolleyError error) {
}
}) {
#Override
protected Map<String, String> getParams() {
Map<String, String> params = new HashMap<String, String>();
params.put("image", bitmapToString(BitmapFactory.decodeFile(filePath)));
return params;
}
};
Sending it as Multipart
This is a little bit more tricky since you'll need to use custom classes made by some dude named anggadarkprince, but it's way faster than the first option
VolleyMultipartRequest multipartRequest = new VolleyMultipartRequest(Request.Method.POST, url, new Response.Listener<NetworkResponse>() {
#Override
public void onResponse(NetworkResponse response) {
}
}, new Response.ErrorListener() {
#Override
public void onErrorResponse(VolleyError error) {
}
}) {
#Override
protected Map<String, DataPart> getByteData() {
Map<String, DataPart> params = new HashMap<>();
RandomAccessFile f = null;
try {
f = new RandomAccessFile(filePath, "r");
} catch (FileNotFoundException e) {
e.printStackTrace();
return null;
}
byte[] b;
try {
b = new byte[(int)f.length()];
f.readFully(b);
} catch (IOException e) {
e.printStackTrace();
return null;
}
params.put("image", new DataPart("image.jpg", b, "image/jpeg"));
return params;
}
};
Here you'll find the class you need to do this.

How to get response data form volley parsed http header request ?

Im passing a username and a password to url using basic64 auth method. The response is a token. How can i get this token using volley library ?
Thanks in advance
You can pass the JsonRequest by using following code.
JsonObjectRequest req = new JsonObjectRequest(Url, new JSONObject(),
new com.android.volley.Response.Listener<JSONObject>() {
#Override
public void onResponse(JSONObject response) {
try {
Log.v("Response:%n %s", response.toString(0));
JSONObject jsonObject = new JSONObject(response.toString());
String success = jsonObject.getString("success");
// Get your Token Here.
} catch (JSONException e) {
e.printStackTrace();
Toast.makeText(LoginActivity.this, "Server or Connection Error.", Toast.LENGTH_SHORT).show();
builder.dismiss();
}
}
}, new com.android.volley.Response.ErrorListener() {
#Override
public void onErrorResponse(VolleyError error) {
VolleyLog.e("Error: ", error.getMessage());
}
});
AppController.getInstance().addToRequestQueue(req);
To pass the request in volley you need AppController class.
public class AppController extends Application {
public static final String TAG = AppController.class.getSimpleName();
private RequestQueue mRequestQueue;
private static AppController mInstance;
#Override
public void onCreate() {
super.onCreate();
mInstance = this;
}
public static synchronized AppController getInstance(){
return mInstance;
}
public RequestQueue getRequestQueue(){
if(mRequestQueue == null){
mRequestQueue = Volley.newRequestQueue(getApplicationContext());
}
return mRequestQueue;
}
public <T> void addToRequestQueue(Request<T> req, String tag) {
// set the default tag if tag is empty
req.setTag(TextUtils.isEmpty(tag) ? TAG : tag);
getRequestQueue().add(req);
}
public <T> void addToRequestQueue(Request<T> req) {
req.setTag(TAG);
getRequestQueue().add(req);
}
public void cancelPendingRequests(Object tag) {
if (mRequestQueue != null) {
mRequestQueue.cancelAll(tag);
}
}
}

My adapter is not waiting for my onResponse, how do I fix this?

I am trying to get the number of "replies" or length of a response from the network here is my request below.
public class Replies {
private String questionId;
private VolleySingleton mVolleySingleton;
private RequestQueue mRequestQueue;
public int replies;
private String url;
//Predondition:Place the id of the questions into the constructor
//as well as the url
//Postcondition: counts the number of replies
public Replies(String questionId) {
this.questionId = questionId;
JsonRequestMethod();
}
public void JsonRequestMethod() {
url = "sampleURl"
mVolleySingleton = VolleySingleton.getInstance();
mRequestQueue = mVolleySingleton.getRequestQueue();
JsonArrayRequest request = new JsonArrayRequest(Request.Method.GET,url, (String) null, new Response.Listener<JSONArray>() {
#Override
public void onResponse(JSONArray response) {
replies=response.length();
}
}, new Response.ErrorListener() {
#Override
public void onErrorResponse(VolleyError error) {
System.out.println(error);
}
});
mRequestQueue.add(request);
}
public String getReplies() {
return replies+"";
}
}
Also, in my adapter i have in my on bindviewholder this line of code
Replies replies=new Replies(currentSearch.getId());
holder.replies.setText(replies.getReplies());
However, it keeps getting set to 0 because its not waiting for the response, and the response is not 0. How do i fix this?
Maybe you can
public class Replies {
...
private NetWorkFinishListener listener;
void setListener(NetWorkFinishListener listener){
this.listener = listener;
}
public interface NetWorkFinishListener{
void onSuccess(int replies);
void onFailed(VolleyError error);
}
JsonArrayRequest request = new JsonArrayRequest(Request.Method.GET,url, (String) null, new Response.Listener<JSONArray>() {
#Override
public void onResponse(JSONArray response) {
replies=response.length();
if(listener != null){
listener.onSuccess(replies);
}
}
}, new Response.ErrorListener() {
#Override
public void onErrorResponse(VolleyError error) {
System.out.println(error);
if(listener != null){
listener.onFailed(error);
}
}
});
}
And
Replies replies=new Replies(currentSearch.getId());
replies.setListener(new NetWorkFinishListener() {
#Override
public void onSuccess(int replies) {
holder.replies.setText(replies.getReplies());
}
#Override
public void onFailed(VolleyError error) {
// do some thing
}
});
//holder.replies.setText(replies.getReplies());
But there is a bug.
Holder may not be the original.But the listener still run Success().
you can use view.setTag() to judge.

Android: checking database with volley library constantly

I started learning Android and Java a week ago and now I am trying to make an login application. I am using Volley libary to communicate with my server. I have done the login part. Now, what I want to do is to check the database every minute to see if the password or the username somehow changed. If the information in the database is changed, app will automaticly logout the user.
If you can explain which tools(Services,BroadcastReceivers) I can use and how can I achieve it, as I am not very experienced.
This is what I tried and failed:
loginChecker.class
public class loginChecker extends Service {
public loginChecker() {
}
public static String username;
public static String password;
private loginChecker mInstance = this;
public static boolean loginCheck= true;
public static String responseG = "failed";
#Override
public int onStartCommand(Intent intent, int flags, int startId) {
Bundle b=intent.getExtras();
username = b.getString("username");
password = b.getString("password");
final String URL = ".........";
final RequestQueue requestQueue = Volley.newRequestQueue(mInstance);
new Thread(new Runnable(){
public void run() {
do{
try {
Thread.sleep(10000);
} catch (InterruptedException e) {
e.printStackTrace();
}
StringRequest request = new StringRequest(Request.Method.POST, URL, new Response.Listener<String>() {
#Override
public void onResponse(String response) {
responseG = response;
}
}, new Response.ErrorListener() {
#Override
public void onErrorResponse(VolleyError error) {
responseG = "error";
}
}) {
#Override
protected Map<String, String> getParams() throws AuthFailureError {
HashMap<String, String> hashMap = new HashMap<String, String>();
hashMap.put("username", username);
hashMap.put("password", password);
return hashMap;
}
};
requestQueue.add(request);
switch(responseG){
case "successful" :
loginCheck = true;
break;
case "failed" :
loginCheck= false;
break;
case "error" :
loginCheck = false;
break;
}
}
while(loginCheck == true || responseG == "successful");
}
}).start();
Toast.makeText(getApplicationContext(), "LOOP ENDED", Toast.LENGTH_SHORT).show();
return START_REDELIVER_INTENT;
}
#Override
public void onDestroy() {
final Intent mainActivity = new Intent(mInstance, MainActivity.class);
mainActivity.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
startActivity(mainActivity);
}
#Nullable
#Override
public IBinder onBind(Intent intent) {
return null;
}
}
MainActivity.class
public class MainActivity extends AppCompatActivity {
private RequestQueue requestQueue;
private static final String URL = "........";
private StringRequest request;
private TextView text;
private EditText userName, passWord;
private Button loginButton;
public MainActivity mInstance = this;
#Override
protected void onCreate(final Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
text = (TextView) findViewById(R.id.textView);
userName = (EditText) findViewById(R.id.userName);
passWord = (EditText) findViewById(R.id.passWord);
loginButton = (Button) findViewById(R.id.loginButton);
requestQueue = Volley.newRequestQueue(this);
final Intent profilePage = new Intent(this, Profile.class);
loginButton.setOnClickListener(new OnClickListener() {
#Override
public void onClick (View v){
loginButton.setEnabled(false);
request = new StringRequest(Request.Method.POST, URL, new Response.Listener<String>() {
#Override
public void onResponse(String response) {
text.setText(response);
switch(response){
case "successful" :
Intent loginCheckerService = new Intent(mInstance, com.erenyenigul.apps.starter.services.loginChecker.class);
Bundle b = new Bundle();
b.putString("username", String.valueOf(userName.getText()));
b.putString("password", String.valueOf(passWord.getText()));
loginCheckerService.putExtras(b);
startService(loginCheckerService);
startActivity(profilePage);
finish();
break;
case "failed" :
Toast.makeText(getApplicationContext(), "Username or Password you entered is wrong!", Toast.LENGTH_LONG).show();
loginButton.setEnabled(true);
break;
}
}
}, new Response.ErrorListener() {
#Override
public void onErrorResponse(VolleyError error) {
Toast.makeText(getApplicationContext(), "There is a problem with our servers or you don't have internet connection!", Toast.LENGTH_LONG).show();
}
}) {
#Override
protected Map<String, String> getParams() throws AuthFailureError {
HashMap<String, String> hashMap = new HashMap<String, String>();
hashMap.put("username", userName.getText().toString());
hashMap.put("password", passWord.getText().toString());
return hashMap;
}
};
requestQueue.add(request);
}
}
);
}
}
There is also a file called Profile.class but it is empty. I tried this but the loop lasted one tour. It stopped even though the connection was ok and the data wasn't changed.

Execute a Volley request after another one is finished

I have two Volley requests. The first request authenticates the user; the second one gets data from the server.
If I send a GET request and the user is not authenticated, I want to fire the first request, authenticate the user and then keep executing the second one once the user is successfully authenticated.
So, the solution is pretty simple. :)
After I learned about callbacks and how them work, I figured out how to do that. So, I implemented a interface that declared the methods I wanted to invoke:
public interface AuthenticationCallback {
public void onLoginSuccess(String result);
public void onLoginError(String result);
}
public interface ResponseCallback {
public void onLoginSuccess(String result);
public void onAuthorizationError(String result);
}
My function:
public void getConversationMessages(final Context context, final String conversationID, final ResponseCallback responseCallback) {
final String url = GET_CONVERSATION_MESSAGES + conversationID;
StringRequest stringRequest = new StringRequest(Request.Method.GET, url,
new Response.Listener<String>() {
#Override
public void onResponse(String response) {
if (responseCallback != null) {
responseCallback.onLoginSuccess(response);
}
}
}, new Response.ErrorListener() {
#Override
public void onErrorResponse(VolleyError error) {
if (error.networkResponse != null && error.networkResponse.statusCode == HttpURLConnection.HTTP_UNAUTHORIZED){
if (responseCallback != null) {
responseCallback.onAuthorizationError(error.getMessage());
}
}
}
})
{
#Override
public Map<String, String> getHeaders() throws AuthFailureError {
HashMap<String, String> headers = new HashMap<String, String>();
headers.put("Cookie", AppSingleton.getInstance(context).getCookie());
headers.put("Content-Type", "application/json");
return headers;
}
};
AppSingleton.getInstance(context).getRequestQueue().add(stringRequest);
}
}
My Activity:
ServerConnection.getInstance().getConversationMessages(getApplicationContext(), id, new ResponseCallback() {
#Override
public void onLoginSuccess(String result) {
}
#Override
public void onAuthorizationError(String result) {
ServerConnection.getInstance().loginFunction(getApplicationContext(), userID, new AuthenticationCallback() {
#Override
public void onLoginSuccess(String result) {
ServerConnection.getInstance().getConversationMessages(getApplicationContext(), conID, new ResponseCallback() {
#Override
public void onLoginSuccess(String result) {
}
#Override
public void onAuthorizationError(String result) {
}
});
}
#Override
public void onLoginError(String result) {
}
});
}
});
Basically, the code will try to send a GETrequest. If the user is not authenticated, then it will execute the code at onAuthorizationError(), that will authenticate the user. Once the user is successfully authenticate, it will send the GET request again.
I think nesting callbacks like this is not a good practice, but I'll fix it later and update my answer.
If someone have a better way to implement that, please, post another answer!
You can put one volley method inside another, as soon as the first request gets finished it sends the another request.By doing this the data will be sent to the database and the same modified data can be fetched again. The code is as shown below.
StringRequest stringRequest = new StringRequest(Request.Method.POST, "YOUR_FIRST_URL", new Response.Listener < String > () {
#Override
public void onResponse(String response) {
StringRequest stringRequests = new StringRequest(Request.Method.POST, "YOUR_SECOND_URL", new Response.Listener < String > () {
#Override
public void onResponse(String response) {
try {
JSONArray genreArry = new JSONArray(response);
}
} catch (JSONException e) {
e.printStackTrace();
}
}
},
new Response.ErrorListener() {
#Override
public void onErrorResponse(VolleyError error) {
}
}) {
#Override
protected Map < String, String > getParams() {
Map < String, String > params = new HashMap < String, String > ();
return params;
}
};
int socketTimeouts = 30000;
RetryPolicy policys = new DefaultRetryPolicy(socketTimeouts, DefaultRetryPolicy.DEFAULT_MAX_RETRIES, DefaultRetryPolicy.DEFAULT_BACKOFF_MULT);
stringRequests.setRetryPolicy(policys);
RequestQueue requestQueues = Volley.newRequestQueue(context);
requestQueues.add(stringRequests);
}
},
new Response.ErrorListener() {
#Override
public void onErrorResponse(VolleyError error) {
}
}) {
#Override
protected Map < String, String > getParams() {
Map < String, String > params = new HashMap < String, String > ();
return params;
}
};
int socketTimeout = 30000;
RetryPolicy policy = new DefaultRetryPolicy(socketTimeout, DefaultRetryPolicy.DEFAULT_MAX_RETRIES, DefaultRetryPolicy.DEFAULT_BACKOFF_MULT);
stringRequest.setRetryPolicy(policy);
RequestQueue requestQueue = Volley.newRequestQueue(context);
requestQueue.add(stringRequest);

Categories

Resources