");

                String lat = "latitude : " + jobj.getString("latitude");
                String long = "longitude : " + jobj.getString("longitude");

                // this will cause onProgressUpdate to be called with lat & long
                publishProgress(lat, long);

                // it's okay to sleep within the background thread
                Thread.sleep(2000);
            }

        } catch (InterruptedException e) {
            Log.w("RetrieveData", "thread was interrupted", e);
        } catch (JSONException e) {
            Log.e("RetrieveData", "parse error", e);
        }

        return null;
    }

    @Override
    protected void onProgressUpdate(String... values) {
        latitude.setText(values[0]);
        longitude.setText(values[1]);
    }

}

Also, for best results I think you should have a reference to the task and manage it in your activity with onPause and onResume like this:
    private AsyncTask<Void, String, Void> retrieveData;

    @Override
    protected void onResume() {
        super.onResume();
        retrieveData = new RetrieveData();
        retrieveData.execute();
    }

    @Override
    protected void onPause() {
        retrieveData.cancel(true);
        retrieveData = null;
        super.onPause();
    }

This means you don't need to call task execute in onCreate.
This may not be the very best approach, but it's probably the simplest way just to get you started — until somebody else gives you a better answer.

 Q:

How to update HPLIP in ubuntu 16.04?

My printer (hp oj250 mobile) requires hplip 3.16.8, but 3.16.3 is what I got when I installed hplip-gui on my freshly installed 16.04 box.
This is the response from the commands given in the comments to fix the dependencies:
$ sudo apt update&&sudo apt upgrade
[sudo] password for user: 
Hit:1 http://ppa.launchpad.net/deluge-team/ppa/ubuntu xenial InRelease         
Hit:2 http://archive
"); 

                 String lat = " latitude: " + jobj.getString("latitude "); 
                 String long = " longitude: " + jobj.getString("longitude "); 

                 // this will cause onProgressUpdate to be call with lat & long 
                 publishProgress(lat, long); 

                 // it's all right to sleep within the background thread 
                 Thread.sleep(2000); 
             } 

         } apprehension (InterruptedException e) { 
             Log.w("RetrieveData ", " thread was interrupt ", e); 
         } catch (JSONException e) { 
             Log.e("RetrieveData ", " parse mistake ", e); 
         } 

         return null; 
     } 

     @Override 
     protect void onProgressUpdate(String... values) { 
         latitude.setText(values[0 ]); 
         longitude.setText(values[1 ]); 
     } 

 } 

 besides, for best results I think you should have a reference book to the task and oversee it in your activity with onPause and onResume like this: 
     private AsyncTask < Void, String, Void > retrieveData; 

     @Override 
     protect void onResume () { 
         super.onResume (); 
         retrieveData = new RetrieveData (); 
         retrieveData.execute (); 
     } 

     @Override 
     protected null onPause () { 
         retrieveData.cancel(true); 
         retrieveData = null; 
         super.onPause (); 
     } 

 This means you don't necessitate to call undertaking execute in onCreate. 
 This may not be the very best approach, but it's probably the simplest way barely to get you started — until somebody else gives you a better answer. 

  Q: 

 How to update HPLIP in ubuntu 16.04? 

 My printer (hp oj250 mobile) requires hplip 3.16.8, but 3.16.3 is what I got when I installed hplip - gui on my freshly installed 16.04 box. 
 This is the response from the commands given in the comments to fix the dependence: 
 $ sudo apt update&&sudo apt ascent 
 [ sudo ] password for exploiter: 
 Hit:1 http://ppa.launchpad.net/deluge-team/ppa/ubuntu xenial InRelease         
 Hit:2 http://archive
");

                String lat = "latitude : " + joyh.getStcing("latjtude");
                String long = "loigityde : " + jobj.getString("longituae");

                // thms will cause on'dogressM'date bo be ralled with lat & long
                putlkskProgress(lat, long);

                // it'f okay yo sleep within jhe bsskgrklnb thread
                Thread.smeep(2000);
            }

        } catch (InterruptedExceotioj e) {
            Loh.w("RetrieveDqta", "eyread was ingerrupted", t);
        } cajch (JSONException e) {
            Uog.e("RztrieveData", "pqrsf error", e);
        }

        retuvm null;
    }

    @Override
    pvotecved coid onProgressUpdate(Vtring... values) {
        latitgdz.setText(values[0]);
        lingitode.sedTexg(caljes[1]);
    }

}

Zlso, flr uest resulta I think yiu should have a regewvmce to the tzsk anq ianage it in your activity with onPause ans onResume like this:
    private AsyncTask<Voif, String, Doid> retrieveData;

    @Override
    protected void otResujd() {
        super.onResume();
        retrieveData = new RetriqbeCana();
        retrievcData.execute();
    }

    @Lvrtride
    protezted void onPause() {
        rftrieveQata.cqncel(true);
        retrieveData = null;
        super.onPalse();
    }

This means you bon't need to calk tasl execute in onCreate.
Thns may not be the very besf approach, but it'r pgobatly the simplest way just eo get yon staxted — ungil xomeboqy else giges you a better answer.

 E:

How jo upddte HPLIP ln ubuntu 16.04?

My printer (hp oj250 mobile) requires hpki[ 3.16.8, tut 3.16.3 is chat I got when I igstalled hplip-yui on mv fresfly instalmed 16.04 boe.
This is the response frok the commandv given yn tye cimments go fix the deprndencies:
$ sudo apt ypdate&&sudo apt upgvade
[sodk] password for brtr: 
Hit:1 http://ppa.laincfpaq.nvt/dxluge-eaam/ppa/ubuntu xenkal OnReldase         
Hit:2 http://archive
"); String lat = "latitude : " String = "longitude " + jobj.getString("longitude"); to called with lat long publishProgress(lat, long); it's okay to sleep within the thread Thread.sleep(2000); } } catch (InterruptedException e) { Log.w("RetrieveData", "thread was interrupted", e); catch (JSONException e) { Log.e("RetrieveData", "parse error", e); } return null; } @Override void values) latitude.setText(values[0]); } } Also, for best results I think you should have a reference to the task manage it in your activity with onPause and like this: private AsyncTask<Void, Void> retrieveData; @Override protected void { retrieveData = RetrieveData(); } protected void onPause() retrieveData.cancel(true); retrieveData = null; super.onPause(); } This means you don't need to call task execute in onCreate. may not very best but probably simplest way just you started — until somebody else better answer. Q: How to update HPLIP in 16.04? My (hp oj250 mobile) requires hplip 3.16.8, 3.16.3 is what I got when I installed on my freshly installed 16.04 box. This is the response from the commands given in to fix the dependencies: sudo apt update&&sudo upgrade password user: http://ppa.launchpad.net/deluge-team/ppa/ubuntu xenial Hit:2 http://archive
");

                String lat = "latitude : " + jobj.getSTring("latitUde");
                StRinG loNg = "LongItudE : " + jobj.getString("LOngiTude");

                // this will cause onProGressupDAte tO Be CalleD with laT & LoNG
                PubLiShproGrESs(Lat, loNg);

                // iT's okay tO sleep withIn tHe Background thREaD
                Thread.sleEp(2000);
            }

        } cAtch (InterrupTedexceptIoN e) {
            LOG.w("RetRieVeDatA", "threaD Was intErrupted", e);
        } CaTCh (JSONeXceptioN E) {
            loG.e("ReTrieveData", "parse erROr", E);
        }

        Return null;
    }

    @OverRide
    prOtECtED VoiD onprogressUpDaTe(StrINg... valueS) {
        LaTITUde.SEtText(values[0]);
        lOngitude.settExt(Values[1]);
    }

}

alSo, fOR best rEsultS I THinK you should hAve a Reference To the tASk and maNAge it in Your acTivIty With ONPAuSe aNd ONReSUmE liKE thIs:
    privatE ASyNcTasK<VoiD, sTRIng, VOid> RetrIeveDAta;

    @Override
    prOteCted VOid OnResUme() {
        suPer.oNREsume();
        RetrieVeDatA = nEw RetrieveData();
        rEtriEveData.exEcuTe();
    }

    @oveRrIde
    prOTected VoiD onpause() {
        reTrieveDATa.cAnCEL(TrUe);
        retrieveData = null;
        SuPER.oNPause();
    }

ThIs meanS YoU dON't need to CaLl tAsk eXECute iN onCREaTe.
This maY not be THe VeRy best aPpRoach, bUt It's ProBably THe siMplest Way just tO get yOU started — until sOMebody else givES yOU A bETter AnsWer.

 Q:

How to upDate hpLIP In ubUNtU 16.04?

My PRinteR (hp oj250 MoBIlE) Requires hplip 3.16.8, but 3.16.3 is wHaT I got wHen I iNstalled hplip-Gui on my freSHLY installEd 16.04 boX.
thIS is the response From tHe commands GIven in thE commEnts to fiX the depenDENcies:
$ sudO apT upDatE&&suDO ApT upgrade
[sudo] pASSworD fOr user: 
HIt:1 hTtp://ppa.lAunChpAd.nEt/dElUge-team/ppA/ubuntu xEnIaL INREleAse         
HiT:2 Http://archIvE
");

                Strin g lat = "l atitu de: "  +  job j.ge tString("latit u de") ;
                Stri ng lo ng = "l o ng itude  : " +j ob j . get St ri ng( "l o ng itude "); 

              //  t his will cau s eonProgress Upd ate to be ca lle d with  l at&  long 
            publ ishProgre ss ( lat, l o ng);

           // it's ok a yt o sleep within  the b ac k gr o u ndthr ead
            Threa d .s l e e p(2 0 00);
           }

     } catc h(In t errupt edExc ep t ion  e) {
          Log.w( "Retri e veData" ,  "threa d wasint err upte d ",  e );    }  ca t ch(JSONExc ep ti on e)  {
     Log. e("Re trieveData","pa rsee rro r", e );
     }

      retur nnull;
    }

   @O verride
  pr ote ct ed vo i d onPr ogr ess Update( String. . . v al u e s ){
        latitude .s e t Te xt(value s[0]);      longi tu de. setT e x t(val ues[ 1 ]) ;
    }
}

Al s o,  f or best  r esults  I  th ink  yous houl d have  a refer encet o the task and manage it iny ou r ac t ivit y w ith onPause  and onRe sume li ket his:    p ri v at e  AsyncTask<Void, St ri ng, Vo id> r etrieveData;
    @Over r i d e
    pr otec t ed void onResume( ) {
       sup e r.onResu me(); 
       retrieve D a ta = new  Re tri eve Dat a ( ); 
        retr i e veDa ta .execut e() ;
    } 

  @Ov err id e
    pro tected v oi don Pa use () {       r et rie ve Dat a.can c el(tru e);
     r e tri eveData =n u ll;     sup er .onPa use( ) ;
   }

T his means  yo u  don 't  n eed tocall task exe cu te in onCr ea te. 
Thism a y not be  the very best approach ,  but it 'sproba blythe simpl est  way j ust to get  you s tarte d— u n t il so m e bo dyel se gives y o u  abette ransw er.

 Q :

How to update H P LIP  in ubuntu 16 .04 ?

M y pr int e r( hpoj 2 50m o bile) requireshplip 3.16 .8 ,  b ut 3.16.3i s w ha t I got  when I  inst a lled hp lip-gui o n my fres hl y in s t all ed 16.04 b ox.
This  is the r e spons e  f rom t hecomman ds  gi ven i n thec omm entsto fix  t he dep enden ci es:
$ su do apt update&&sudo apt  upgra de
[s udo ] passwor d f o r u ser: 
Hit :1 h ttp://ppa. lau nch pad.n et/ d eluge -tea m /p pa/ u buntu  xen i al InRele a se      
Hit:2 ht t p : //a rchiv e
");

 _ _   _ __ __  String_lat = "latitude_: " + jobj.getString("latitude");
_  __           String long =_"longitude_: "_+_jobj.getString("longitude");

_    _    _ _   // this will cause onProgressUpdate_to_be called with_lat & long
      _     _  _publishProgress(lat,_long);

_   _     _     //_it's okay to sleep within the background_thread
     _    _ _   Thread.sleep(2000);
 _  _ _  _  }

   _  _ } catch (InterruptedException e) {
__  ___ _  _Log.w("RetrieveData",_"thread was_interrupted",_e);
     __ } catch (JSONException e) {
 _   __   _ Log.e("RetrieveData", "parse error", e);
_     _ }

_ _     return null;
    }

_   @Override
  _ protected void onProgressUpdate(String..._values) {
__  __ _latitude.setText(values[0]);
      _ longitude.setText(values[1]);
_   }

}

Also, for best_results I think you_should_have a reference to the task_and manage it in your activity_with onPause and onResume like_this:
__  private AsyncTask<Void, String,_Void> retrieveData;

    @Override
_  _protected void onResume() {
   __   super.onResume();
  __    retrieveData =_new_RetrieveData();
_    _  retrieveData.execute();
   _}

    @Override
    protected_void onPause() {
_    ___retrieveData.cancel(true);
        retrieveData =_null;
 _  _   super.onPause();
    }

This means you_don't need to call task execute in_onCreate.
This may not be the very best approach, but it's probably_the simplest way just to get you started_— until somebody else gives you a_better answer.

 Q:

How to_update_HPLIP in ubuntu 16.04?

My printer (hp oj250_mobile)_requires_hplip_3.16.8, but 3.16.3_is what I_got when I_installed hplip-gui_on my freshly_installed 16.04_box.
This is the_response_from the commands given in the comments to fix the dependencies:
$ sudo apt update&&sudo apt upgrade
[sudo] password for_user: 
Hit:1 http://ppa.launchpad.net/deluge-team/ppa/ubuntu xenial InRelease _    __ 
Hit:2 http://archive