Hello

I am creating an android application in which i am reading events from 
calendar. I am trying with the demo account provided on the website of SoGo 
https://sogo.nu/, it provides the links to access informarion which are as 
follows:

Public Access

CalDAV URL

http://demo.sogo.nu/SOGo/dav/public/sogo1/Calendar/personal/

WebDAV ICS URL

http://demo.sogo.nu/SOGo/dav/public/sogo1/Calendar/personal.ics

WebDAV XML URL

http://demo.sogo.nu/SOGo/dav/public/sogo1/Calendar/personal.xml

when i am using these link in my application as a "SrvrUrl" in the following 
code i have got "null" as an exception while execeuting the following line of 
code BufferedReader in = new BufferedReader(new 
InputStreamReader(url.openStream()));

I have print the status of http response it says status: HTTP/1.1 404 Not Found

HttpClient httpClient = new DefaultHttpClient();
HttpGet httpGet = new HttpGet(SrvrUrl);
HttpResponse httpResponse ;

try{
    httpResponse = httpClient.execute(httpGet);

    // Get hold of the response entity
    HttpEntity entity = httpResponse.getEntity();
    // If the response does not enclose an entity, there is no need
    // to worry about connection release

    if (entity != null) {

        // A Simple JSON Response Read
        InputStream instream = entity.getContent();

        UrlStatusChk = true;
        // now you have the string representation of the HTML request
        instream.close();

        BufferedReader in = new BufferedReader(new
        InputStreamReader(entity.getContent()));
        String line = null;
        String output = "";
        for (line = in.readLine(); line != null; line = in.readLine()) {
            response.append(line);
            response.append("\n");

         }
         Log.i("status",response.toString());
         in.close();
     }
}catch (Exception e) {
    e.printStackTrace();
    StatusReturn = "no";
}
if (UrlStatusChk) {
    try {
    // Install Authenticator
    MyAuthenticator.setPasswordAuthentication(SrvrUser, SrvrPWD);
    Authenticator.setDefault(new MyAuthenticator());
    URL url = new URL(SrvrUrl);
    BufferedReader in = new BufferedReader(new
    InputStreamReader(url.openStream()));
    String line = null;
    String output = "";
    for (line = in.readLine(); line != null; line = in.readLine()) {
        response.append(line);
        response.append("\n");
    }
    in.close();
    } catch (MalformedURLException e) {
        e.printStackTrace();
        StatusReturn = "no";
    } catch (IOException e) {
        e.printStackTrace();
        StatusReturn = "no";
    }
}

Any help would be highly appreciated




Thanks & Regards

Moin Uddin Kashif

Software Engineer

Dr. Çulha & Partner Consulting

+49 15908181437

Website - http://scheduledisplay.com/

Playstore - 
https://play.google.com/store/apps/details?id=culha.MeetingRoomSchedule
-- 
[email protected]
https://inverse.ca/sogo/lists

Reply via email to