19th March 2020
J-Pilot Data on Android Phone: Contacts
Keeping J-Pilot data in sync with Android smartphone is quite a challenge. See my post about Google calendar. Copying contact data from J-Pilot to Android in the past went like this:
- Export data from J-Pilot in vCard (vcf) format
- If required, fiddle with this vcf file with some Perl script
- Stopping contact app in Android and stopping WiFi. Deleting all data in Android app.
- Manually delete contacts in Google Contacts in batches of ca. 500 records (Added 10-May-2020: Meanwhile there is no longer a limit here, so you can delete all your contacts in one go.)
- Import vCard data in Google Contacts
- Turn on WiFi on Android, starting contact-app
As one can easily see, this was very cumbersome. To make this even more difficult, now Google has limited the number of imported records in vCard file to 1,000 records per day. If you have more than that, then you are stuck. The limits are documented in quotas. [Added 08-Feb-2021: It seems Google has acknowledged their silliness here, so you can upload at least 5,500 records, as found by experiment.] The limits are (were)
- Calendar events created: 5,000 / day
- Contacts created: 1,000 / day
- Email recipients per day: 100 / day
- Email read/write (excluding send): 20,000 / day
For contacts there is an alternative in the suite of "Simple Mobile Tools". On Android there is an app called Simple Contacts.
Its Kotlin source code can be inspected in GitHub. All these "Simple Mobile Tools" were written by Tibor Kaputa. He has given some reasons why and how he wrote them here.
"Simple Contacts" can import vCard files. I have not experienced any limits on the size of the vCard file. Though, I did encounter a limit on the number of contacts you can delete.
The first step is to disallow "Simple Contacts" any access to the Google contacts. That way any updates to contacts in "Simple Contacts" do not disturb your Google contacts.
The steps to refresh your contacts on Android are therefore:
- Export data from J-Pilot in vCard format
- Fiddle with that data, if required
- Stop "Simple Contacts" and delete data (see screenshot below)
- Add one dummy record manually in "Simple Contacts", e.g., just one name
- Dummy record can be deleted, if required
- Import vCard file
- Set your preferences again in "Simple Contacts" as they have been dropped with all your data
This kind of deletion shown below, is only required if you hit the delete-limit.