回答

0

它只是一個讀取和解析CSV文件程序,您需要。

所以,你可以這樣做:

//--- If your input stream is `inpStrm` of the csv file : 

    BufferedReader reader = new BufferedReader(new InputStreamReader(inpStrm)); 
    try { 
     String line; 
     while ((line = reader.readLine()) != null) { 
      String[] RowData = line.split(","); 
      date = RowData[0]; 
      value = RowData[1]; 
      // Now use "data" and "value" as you need to 
     } 
    } 
    catch (IOException ex) { 
     // ex.printStackTrace(); 
    } 
    finally { 
     try { 
      inpStrm.close(); 
     } 
     catch (IOException e) { 
      // e.printStackTrace(); 
     } 
    } 

現在contact namephone number將出現在datavalue。這就是我想的。

+0

感謝大家 – rajesh

+0

上面的代碼工作從csv文件讀取並存儲到variables.could請告訴我如何通過編程方式將這些聯繫人導入到android手機中。請給出一些想法 – rajesh

+0

@ user2310115:在這裏尋找一些想法:http://stackoverflow.com/questions/3079365/android-retrieve-contact-name-from-phone-number?rq=1 –

相關問題