如题

解决方案 »

  1.   

    String path=Recorder.filePath;
    myEdit.setText("here is the path:"+path);

    //create a url
    String urlStr="127.0.0.1?";
    String namepwd="?username=***&password=***";
    urlStr+=uuid;
    try{
    URL url=new URL(urlStr);
    HttpURLConnection conn=(HttpURLConnection)url.openConnection();
    if(conn.getResponseCode()==HttpURLConnection.HTTP_OK){
    InputStream in=conn.getInputStream();
    byte[] b=new byte[in.available()];
    in.read(b);
    String msg=new String(b);
    Toast.makeText(getApplicationContext(), msg, Toast.LENGTH_LONG).show();
    in.close();
    }
    conn.disconnect();
    }catch(Exception e){
    e.printStackTrace();
    }直把username password写在url参数里, 然后在服务器端判断就可以