how to auth the JWT in android -


im new in android. have http headers:

"authorization": "jwteyjhbgcioijiuzi1niisinr5cci6ikpxvcj9.eyjpzci6mjcsimvtywlsijoiz2xvcmlhnjhaag90bwfpbc5jb20ilcjpyxqioje1mdmwotg3mzesimv4cci6mtuwmzcwmzuzmx0.zm7snotuvhgvxqsewzosixa1jifrrvgzbw0jfnsnwkk" 

something above saved in message1

the question how auth these values in code having result need

i leave code have been testing

public class fragmenttab_datospersonales extends fragment {       textview txtprueba, txtid;      button btnprueba;     string url = "http://10.8.0.1:8080/api/jugador/";     requestqueue requestqueue;      string url1 = variablesglobales.urlid;      public view oncreateview(layoutinflater inflater, viewgroup container, bundle savedinstancestate) {         // inflate layout fragment          view view = inflater.inflate(r.layout.lyt_fragmenttab_datospersonales, container, false);          requestqueue = volley.newrequestqueue(getactivity().getapplicationcontext());          txtprueba = (textview)view.findviewbyid(r.id.txtprueba);         txtid = (textview)view.findviewbyid(r.id.txtid);         btnprueba = (button)view.findviewbyid(r.id.btnprueba);         btnprueba.setonclicklistener(new view.onclicklistener() {             @override             public void onclick(view v) {                 txtprueba.settext("holaaaaaaaaaaaaa");                  //toast.maketext(getapplicationcontext(),url2,toast.length_short).show();                  obtnerdatosjason();             }         });          return view;     }      private void obtnerdatosjason()  {          string url2 = url+url1;       //httpget = new httpget(url2);         string message1 = variablesglobales.message;         //get.addheader("authorization", "token token=\"" + message1.tostring() + "\"");         toast.maketext(getapplicationcontext(), message1.tostring(),toast.length_short).show();         //get.addheader("authorization", message1);          jsonobjectrequest jsonobjectrequest = new jsonobjectrequest(request.method.get,null, url2, new response.listener<jsonobject>() {             @override             public void onresponse(jsonobject response) {                  try {                     txtid.settext(response.getstring("nombres"));                     toast.maketext(getapplicationcontext(),response.getstring("nombres"),toast.length_short).show();                  } catch (jsonexception e) {                     e.printstacktrace();                 }             }         }, new response.errorlistener() {             @override             public void onerrorresponse(volleyerror error) {             }         });requestqueue.add(jsonobjectrequest);     } } 


Comments

Popular posts from this blog

ubuntu - PHP script to find files of certain extensions in a directory, returns populated array when run in browser, but empty array when run from terminal -

php - How can i create a user dashboard -

javascript - How to detect toggling of the fullscreen-toolbar in jQuery Mobile? -