libical on Android question

Chiu Chau chiu.chau at oracle.com
Thu Jan 12 17:16:18 PST 2017


libical experts,

What is needed to make libical works on Android with respect to loading 
timezone?

Below are my current understanding:

  * Android has tzdata database in /system/usr/share/zoneinfo and the
    system partition is readonly
  * libical is expecting VTIMEZONE-based .ics files and it could support
    either timezone database provided by the OS, or from the bundled
    builtin timezone.  However, this is control at the libical build
    time configuration using the CMake -DUSE_BUILTIN_TZDATA=true. So, by
    default, if built without that flag or with the flag equals false,
    libical will search the OS provided zoneinfo/zone.tab from a few
    search paths. With the flag equals true, we can bundle the zoneinfo
    from the libical source into an app specified location and use the
    set_zone_directory() call to tell libical the timezone database
    location.

This issue came about when I was testing some C++ code like this:

     icaltimezone* tz = 
icaltimezone_get_builtin_timezone(tzLocation.c_str());

The tzlocation is "America/Los_Angeles", but the call keeps returning 
nil (nullptr).  So I am suspecting the 
icaltimezone_init_builtin_timezones() failed to load the timezone array 
from either the OS zoneinfo database (libical compiled without 
USE_BUILTIN_TZDATA, well in this case, Android does not provide the 
VTIMEZONE-based zoneinfo) or an app provided zoneinfo database (libical 
compiled with USE_BUILTIN_TZDATA=true and the libical zoneinfo directory 
was copied onto Android app files directory).

Any clues of how to make libical works on Android?

Thanks,
Chiu



More information about the libical-devel mailing list