przesyłanie dokumentów docx, doc i pdf do sharepoint online z rodzimej aplikacji dla Androida

Zajmuję się tworzeniem aplikacji na Androida do zdalnego dostępu do sharepoint online. Mogę przesyłać pliki za pomocą metody http put i wyświetlać je, ale nie jestem w stanie ich otworzyć. Czuję, że nie określam właściwego typu zawartości. Oto mój kod:

try {       
    File sdcard = Environment.getExternalStorageDirectory();

    //Get the text file
    File file = new File(sdcard, "gps.doc");

    FileInputStream fIn = new FileInputStream(file);
    BufferedReader myReader = new BufferedReader(
            new InputStreamReader(fIn));
    String aDataRow = "";
    String aBuffer = "";
    while ((aDataRow = myReader.readLine()) != null) {
        aBuffer += aDataRow + "\n";
    }

    System.out.println(aBuffer + "content of the file");

    HttpPut httpupld = new HttpPut("http://mysite.sharepoint.com/Sites/Documents/gps.doc");


    StringEntity entity1 = new StringEntity(aBuffer, "HTTP.UTF_8");
    httpDel.setEntity(entity1);


    System.out.println(title);
    HttpResponse rsp = http2.execute(httpupld);
    respcode=rsp.getStatusLine().getStatusCode();
    System.out.println(respcode);

} catch (Exception e) {
    Log.e("Error: ", e.getMessage());
}

Każda pomoc jest doceniana. Dziękuję

questionAnswers(1)

yourAnswerToTheQuestion