Share My Creation TBirdSync: Thunderbird contacts/calendar/tasks mirroring from PC to Android (sources included)

I hesitated to post this as it's probably only useful for a small audience (if any), but as I didn't find another solution, perhaps it can benefit others who are looking for this or for something similar.

I've been using the excellent MyPhoneExplorer ( for years to sync my contacts, calendar, and tasks from a Windows PC (first MS Outlook, then Mozilla Thunderbird) to my Android devices. In the future (possibly distant - or even never) I may switch completely from Windows to Linux. Unfortunately I (and apparently anybody else) was unable to get MyPhoneExplorer running on Linux - e.g. with WINE - and I don't want the overhead of a VM.

So I decided to create something myself: TBirdSync. I haven't tested it on Linux yet - that's for later (or never). Tested on Windows 10 and Linux Mint 20.02 Cinnamon.

The big picture - my setup

What does/doesn't it do?
- Synchronise Thunderbird contacts with one or more Android devices; contact matching is based on the combination of first and last name (which means that these combinations must be unique)
- Prepare calendar and tasks data and send them to the Android device(s) where they can be processed with the ICSx5 app (see below)
- Convert tasks data to calendar data, which means no separate tasks app is needed on the Android device: everything winds up in the calendar app, where tasks' titles are prefixed with '(T)' so that it's easy to distinguish them from appointments

Perform a 2-way sync (so it's actually more mirroring than syncing): the synchronisation source is Thunderbird, and all changes to the data are expected to be applied there. Changes made on the Android device are not detected.

If you can live with these limitations, read on.

Why ICSx5?
I didn't want to write the calendar/tasks sync code as TBirdSync is a means to an end (i.e. moving to Linux) and not a goal by itself. Calendars are complex beasts and ICSx5 ( is a low-cost app (1.99 EUR) that works perfectly; it's even open source and can be found on GitLab ( Among other, it syncs an iCalendar (.ics) file with a read-only calendar that it creates itself.

At the moment, ICSx5's sync can't be started via an Intent: on the Android device, TBirdSync starts the app and then a 'pull to refresh' is needed to sync the calendar and tasks data (unless a scheduled sync is setup; sync intervals as of 5 minutes can be selected). I've asked the developers if they would be willing to provide an Intent, and it's on their todo list. Once it's there, I'll update the app to start the sync without user interaction.

If you only want to sync contacts, ICSx5 is not needed.

Getting started
- Get ICSx5 (see above) and install it on the Android device(s)
- Install the TBirdSync app on the Android device(s), enter the settings, and save them
- Install the B4J program on the PC(s), enter the settings, and save them
- In the Android device(s) Settings / Battery / Battery optimization you may want to set TBirdSync and ICSx5 as 'Not optimised' so that they'll also keep going when the device is locked
- TBirdSync uses an iCalendar (.ics) file to process calendar and tasks data. In Thunderbird, you'll either have to manually use 'Export' from the 'Events and Tasks' menu each time you want to sync the data, or do this:
1. Export Events and Tasks to an .ics file
2. File / Open / Calendar file, and then select that exported file, and work with that calendar (and perhaps also delete the original one to avoid confusion/mistakes)
This way, the data are always available in .ics format. It does however slow editing calendar and tasks down a little, but in my opinion the performance hit is reasonable.

- Deleting contacts (which is also used to update them as this simplified the code and speeds things up on the Android side because the PC side does the heavy lifting) didn't work on my Fire tablet with Android 5.1.1 but did on a Moto X Style phone with Android 7, which is why the minSdkVersion in the Manifest was set to 24 to correspond with Android 7. It is however possible that this was caused by the custom ROM I had installed on the Fire tablet and that it does work on older Android versions.
- The icon comes from
- My environment: Windows 10, Thunderbird 78.10.1 (32-bit), Android 7, ICSx5 1.9.1-gplay, B4A 10.70, B4J 8.90

Non-core library dependencies
- AndroidResources:
- Archiver:
- Clipboard:
- zt-zip (see add the 3 jars from the attached 'zt-zip' to your B4A additional libraries folder

- jReflection:
- zt-zip (see add the 3 jars from the attached 'zt-zip' to your B4J additional libraries folder


TBirdSync B4J screenshot.PNG
TBirdSync B4A screenshot.jpg



    96.9 KB · Views: 91
    63.9 KB · Views: 91
  • TBirdSync B4J screenshot.PNG
    TBirdSync B4J screenshot.PNG
    38.9 KB · Views: 186
  • TBirdSync B4A screenshot.jpg
    TBirdSync B4A screenshot.jpg
    294.8 KB · Views: 189
  • TBirdSync_B4A
    98.9 KB · Views: 77
  • TBirdSync_B4J
    65.5 KB · Views: 85
  • zt-zip
    140.3 KB · Views: 26
  • TBirdSync_B4J
    72.9 KB · Views: 24
  • TBirdSync_B4A
    127.4 KB · Views: 27
Last edited:


Active Member
Licensed User
Version 2 attached to the first post.

B4J changes:
- streamlined Msgbox2Async handling
- added button 'Select .ics copy folder' (and the label beside it); on Android 11, I couldn't find a directory that would be accessible by both TBirdSync and ICSx5; with this button, a copy of the calendar/tasks .ics file can be placed e.g. on a shared NAS folder and then be accessed with ICSx5 through a http subscription
- if an error occurs during sync preps, the connection with the server will now be closed
- at the first contacts sync (or after using menu option 'Reset contacts' on the Android device), an attempt will be made to delete all existing contacts on the Android device (after user approval)

B4A changes:
- streamlined Msgbox2Async handling
- added checkboxes 'Start at boot' and 'Keep alive'
- Manifest: changed targetSdkVersion from 29 to 30
- Manifest: added WRITE_EXTERNAL_STORAGE (for RuntimePermissions/GetSafeDirDefaultExternal)
- Manifest: added '<queries>' block to be able to detect the presence of ICSx5 (at.bitfire.icsdroid) on Android 11
- corrected RuntimePermissions handling
- at the first contacts sync (or after using menu option 'Reset contacts' on the Android device), an attempt will be made to delete all existing contacts on the Android device (after user approval)


Active Member
Licensed User
Version 5 attached to the first post. Notice that @stevel05's zt-zip is used (see; add the 3 jars from the attached 'zt-zip' to your B4A/B4J additional libraries folders.

B4J changes:
- using wmutils.RedirectOutput now, and wmUtils.MsgBoxLongText where appropriate (as preparation for Linux)
- on Windows, stdout and stderr are now redirected to files in directory %APPDATA%\Roaming\TBirdSync instead of File.DirApp
- stdout and stderr files are now overwritten instead of appending to them
- File.DirApp replaced with File.DirData("TBirdSync") as the former will cause problems on Windows with the program installed by Inno Setup
- added Sub Application_Error
- improved handling of the 'Sync' button's visibility
- added more progress reporting messages
- the ics file is now zipped before transferring it to the B4A device (and unzipped when it arrives there)

B4A changes:
- the ics file is now zipped before transferring it to the B4A device (and unzipped when it arrives there)
- B4A version number aligned with the B4J version