title: Volley inside it's own class
body: <p>This is more along the lines of an "Is this possible, and SHOULD I try it?" question. Making a fairly straight-forward app that gets JSON data from a server on every page. The data is pretty simple JSON, and pretty much the same format across all pages. </p>
  
  <pre><code>{
  "userid": "stringid",
  "name": "some-name",
  "description": "some description",
  "properties": {
      "id": {
          "badgeid": "stringid",
          "type": "string"
      },
      "name": {
          "description": "Name of the product",
          "type": "string"
      }
  },
  "required": [
      "id",
      "name",
      "price"
  ]
  </code></pre>
  
  <p>}</p>
  
  <p>It just seems wasteful to me to create an entire Volley request for each group of data. I've gotten around it a bit by just making a function and passing in common things like URL. But, I still have this same function on every single activity...</p>
  
  <p>What I'm contemplating is just making a class, say "JSONObject GoGetJSON(String URL)" and have it return a JSONObject. This I can call...
      JSONObject test = new GoGetJSON("<a href="http://blah.com" rel="nofollow">http://blah.com</a>");</p>
  
  <p>Then just use test as I like. Then I can include the encryption of the data string and all the other bells and whistles inside of that one class, rather than repeating work on each page. And if this is possible, I could create a custom adapter to filter out/backfill some of the "extra" data that might come across on the calls where all info isn't needed.</p>
  
  <p>My concern is that by doing it this way, I'm essentially "breaking" the async task advantage, since it's waiting on the class, which is asyncing the volley request. Also would this also break the request queue?</p>
  
  <p>Now, I'm still learning OOP, Java, and programming in general, so I'd just like to know what you more experienced programmers thought. Is it a worthwhile venture? Or am I barking up the wrong tree? I can see the advantage of portability if it works...I've tried googling a bit, but every example I see they are adding the volley directly for each request. I appreciate any feedback and help!</p>