Open mspagon opened 6 years ago
Also, why does the server communicator constructor take a View as an argument?
For some reason EVERYTHING in android wants a View as an argument.
Temporary resolution:
Creating my own requestSingleStreamInfo method for the time being.
Ohhh... I see what you're saying.... one sec.... if 'arr' is your long variable containing the streamID:
long arr = 2230857230862068;
uri.appendPath(mContext.getString(R.string.url_service_streaminfo))
.appendQueryParameter("streamID", arr.toString());
First field is the name of the parameter, second field is the value
Here's what I did in ServerCommunicator for the ViewAStream page to return all the items for a single stream:
public void requestStreamItemInfoData(long streamID, ServerResponseAction callbackAction){
Uri.Builder uri = getBaseServicesUri();
uri.appendPath(mContext.getString(R.string.url_service_streamiteminfo));
uri.appendQueryParameter("streamid", Long.toString(streamID));
String myUrl = uri.build().toString();
doRequest(myUrl, callbackAction);
}
Then call the function with:
comm.requestStreamItemInfoData(longStreamID, new ServerResponseAction()
hey guys Here are a few comments :)
ServerCommunicator
takes a View
in the ctor because most of the Volley
calls want a Context
object, and passing in a View
was an easy way to get at that. (maybe there is a better way???)requestStreamInfo
method to work for getting the info for multiple streams at once. I think I just did that anticipating that use case, but I didn't actually use it (I made a different method to get all streams). I think @psigourney 's method is a good one for single stream data.Solved - Long numbers are Suffixed with "L".
Ugh... I'm going to keep using my method that uses a string type for StreamID for the time being.
Edit: changed it to a constructor... still an issue??
Edit: Looks okay with a String?
I want to query information on a single streamID:
So I created a List with one streamID in it and passed it to requestStreamInfoData(...) and it generates the following URL:
http://apt17-miniproj-whiteteam.appspot.com/services/streaminfo?searchString=%5B%225631383682678784%22%5D
But it returns a JSON of everything in the database.
How can I set "searchString" within the URL to be streamID?
I basically want to generate the following request:
https://apt17-miniproj-whiteteam.appspot.com/services/streaminfo?streamID=5631383682678784