How to set up using eclipse ADT



  • Hi, I'm a newbee in this area (now embedded programming in C, that's another matter :) ) so forgive me if I'm posting this in the wrong place.

    I'm at loss on how to set up and build the DavDroid in the eclipse ADT environment. I have tried to google it but I'm at lack of the correct search criterias. Is there any instructions or tutorials out there that I should look at?

    Thanks, M



  • To be more specific, I have cloned the github repo but have trouble adding it in Eclipse and getting it to be recognized as an android project. I guess that is a good starting point, then I'd like to download it in a deveice and also run the test suite.



  • There are some notes about this topic collected at https://github.com/oliver/davdroid/wiki/Debugging . I'm not sure if it's still up to date (I think the required Android version has changed to API 19 by now?)

    @rfc2822: maybe such a page could be added to the official wiki? I didn't want to add it to your wiki without asking; but feel free to use the contents from the linked page.



  • @oliver thanks for the wiki page.
    I have a problem with the lombok.jar library. It looks like Eclipse can't find the lombok.jar file and then fails to build davdroid. The lines import lombok.Getter;are getting the error: The import lombok cannot be resolved.



  • Ah yes, the lombok.jar was quite a headache for me too. It needs to be installed on your system (it doesn't work to just add the jar file to the project). So I downloaded lombok.jar from http://projectlombok.org/download.html and ran it (with java -jar lombok.jar, under Ubuntu). The installer will modify the system-wide eclipse.ini file. I think the automatic modification failed in my case; but the installer explains what it wants to do, and I did that manually then.

    The lines I added to my /etc/eclipse.ini file (simply appended at the end) are:

    -javaagent:/usr/lib/eclipse/lombok.jar
    -Xbootclasspath/a:/usr/lib/eclipse/lombok.jar
    

    Eclipse now shows lombok.jar in the eclipse-libs folder and lombok.jar in the compile-libs folder for my MainActivity project.



  • @oliver lombok.jar is already provided in the git repository in davdroid/compile-libs/. No need to get it again from the project website.

    I double-click on the lombok.jar file to install it in Eclipse (as documented in http://projectlombok.org/download.html). My eclipse.ini file is updated. But after restarting Eclipse the lombak.* packages are still not found :-(
    (I am using Mac OS X 10.9)


  • developer



  • Thanks guys



  • @oliver wrote that the android version required is now at API 19, is this true?
    In the android manifest it is defined as

    <uses-sdk
            android:minSdkVersion="14"
            android:targetSdkVersion="17" />
    

    I have spent the afternoon debugging some error with crating a calendar that throws an illegal argument exception, stepping up from AP14 to 21 solved that problem.


  • developer

    I have used API level 19 in Eclipse but didn't upgrade the Manifest yet. I will do so in the next commit.



  • Thanks, but what is the lowest working version? I tested on 17 now and at least it worked to add a calendar in that version. It is of course really good if there is support for at least some of the older versions that is out there. What parts of the code is susceptible to break for older versions?


  • developer

    The least required version to run DAVdroid is API level 14, so you can also compile it with level 14 if you patch a few lines which use functionality of newer API levels (but always with checks). But why don't just use the Android 4.4 SDK?



  • I am using 4.4, but I do not think that all users will, keeping up some backwards compatibility is a good idea if it isn't to cumbersome. Which parts of the code that need this handling is above my knowledge though.


  • developer

    I think you mix two things:

    1. The first one is the minimum required API level which is level 14. This means that DAVDroid will run on any device with API level 14 or higher.
    2. The second one is the API level required for building DAVdroid, and the latest level DAVdroid has been tested with. This should be as high as possible. This is actually level 19 so the Android 4.4 SDK will be required to build DAVdroid (but not to run DAVdroid). As far as I know, there is no reason why one should stick with an old Android SDK because everone can easily update their SDK and install various versions in parallel.

    Why don't you just download Android 4.4 SDK from the Android tools and go with it? It won't require Android 4.4 on your device, DAVdroid will still run on API level 14+.



  • Thanks for the clarification, I have some things to learn :)
    However, when building with sdk 4.4, API level 19, and then running on API level 14 I get an Illegal argument exception when LocalCalendar is calling client.create(...), during the account setup. Running the same on API17 works fine

    image


  • developer

    I don't know why, I don't get this exception with SDK 4.4. Have you tried uninstalling the previous DAVdroid version, then compiling/trying again with SDK 4.4? Else you would have to figure out where the exception comes from / which parameter has an illegal value (maybe a value that doesn't exist in API level 14 yet? In this case a version switch would have to be inserted into the code. On http://developer.android.com/reference/android/provider/CalendarContract.CalendarColumns.html there's a list which value is supported on which API level, but I thought that unknown values are ignored).



  • Thanks, I removed a pair of the values for API 14 and now it works.

    int currentApiVersion = android.os.Build.VERSION.SDK_INT;
    if (currentApiVersion > android.os.Build.VERSION_CODES.ICE_CREAM_SANDWICH) 
    {
    	values.put(Calendars.ALLOWED_AVAILABILITY, Events.AVAILABILITY_BUSY + "," + Events.AVAILABILITY_FREE + "," + Events.AVAILABILITY_TENTATIVE);
    	values.put(Calendars.ALLOWED_ATTENDEE_TYPES, Attendees.TYPE_NONE + "," + Attendees.TYPE_OPTIONAL + "," + Attendees.TYPE_REQUIRED + "," + Attendees.TYPE_RESOURCE);
    }
    

  • developer

    I have done this in 4f1488ece5efd7c31ab26c1662dc8b5639376127 yesterday :)



  • hehe, thanks for that
    Any chance that you might have some input on this question? (would be great..)
    http://stackoverflow.com/questions/20806413/is-there-a-way-to-crate-an-imap-email-account-from-another-application-on-androi


Log in to reply
 

Looks like your connection to Bitfire App Forums was lost, please wait while we try to reconnect.