php - I get a correct link from MYSQL but this link doesn't work in my Java code -


i got url of file, database on host, request. got string type. wrong. link doesn't want work in android app.

error

protocol not found: http://ksenia.url.ph/docs/krestny_otets.pdf

code use

class mytask extends asynctask<string, void, string> {      @override     protected void onpreexecute() {       super.onpreexecute();      }     protected string doinbackground(string... params) {         try{             string link = "http://ksenia.url.ph/ksenia_login_api/include/loginget.php";             url url = new url(link);             httpclient client = new defaulthttpclient();             httpget request = new httpget();             request.seturi(new uri(link));             httpresponse response = client.execute(request);             bufferedreader in = new bufferedreader            (new inputstreamreader(response.getentity().getcontent()));            stringbuffer sb = new stringbuffer("");            string line="";            while ((line = in.readline()) != null) {               sb.append(line);               break;             }             in.close();             return sb.tostring();       }catch(exception e){          return new string("exception: " + e.getmessage());       }      }     protected void onpostexecute(string result) {       super.onpostexecute(result);        log.i("url = ", result);         int count = 0;       (string s: result.split("abc")) {         log.i("url_mass = ", s);         count++;       }        string st[] = null;       (int i=0; i<count;i++){           st= result.split("abc");       }        databasehandler db = new databasehandler(getapplicationcontext());       db.adddocs("sdfs");       int rowcountdocs = db.getrowcountdocs(); // получаем общее число строк        // mass sqlite       string mass [] = db.getreadabledatabase1();      (int i=0; i<rowcountdocs;i++){      }     log.i("url = ", st[0]);      if (!st[0].equals(mass[0]))            new downloadfilefromurl().execute(st[0]);          db.adddocs("");      }   } 

for example, if write link, code work true.

new downloadfilefromurl().execute("http://ksenia.url.ph/docs/krestny_otets.pdf");

this php file

 <?php $con=mysqli_connect("myhost","my_root","pass","dbname"); if  (mysqli_connect_errno($con)) {    echo "failed connect mysql: "  . mysqli_connect_error(); }  $result = mysqli_query($con,"select  docs_url docs");   $storearray = array(); $i = 0; while ($row =  mysqli_fetch_array($result, mysql_assoc)) {      $storearray[] =  $row['docs_url'];     echo $storearray[$i] . "abc";   $i++; }    mysqli_close($con); ?> 

help me decide problem, please!


Comments

Popular posts from this blog

windows - Single EXE to Install Python Standalone Executable for Easy Distribution -

c# - Access objects in UserControl from MainWindow in WPF -

javascript - How to name a jQuery function to make a browser's back button work? -