I'm working on my first android app so I'm still getting familiar with the correct usage of the context, views and using fragments.
Currently my application has one activity and several fragments and I want to use volley to retrieve and send data from/to a php web service I set up on xampp. My doubt is, how should I set up the code for best practices?
I did as recommended here https://developer.android.com/training/volley and created a singleton in a separate class, I'll need to do a few request on each fragment so I'll have to use the method to get the queue in each fragment and add every new request, but I don't know where to create the queue (main activity? any fragment?) in order to not have context or other issues.
I've looked around but didn't find anything specific and their problems were solved in a line of code without getting into the implementation, asides of a person recommending to create a parentVolleyFragment extends Fragment, declaring the queue there and then make my fragments extend parentVolleyFragment to get the queue, like this:
public class parentVolleyFragment extends Fragment{
private VolleySingleton volley;
protected RequestQueue fRequestQueue;
}
Would that be a good practice or is there a better way?