I have a BQ Ubuntu Phone and use the calendar app in connection with google calendar. I am wondering, if I always have to press "sync" in the calendar app or if there is a way to actually automatically sync my google calendar.
Thanks for your help!
To do automatically sync, you can use command lines in terminal app. I think automatically sync is not implemented yet in calendar app.
The method below should work with google calendar (I'm not sure because I use calendar from owncloud server)
To see the name of calendar server you have to sync, you can use this command :
syncevolution --print-configs
The name of the server could be google-calendar or google-calendar-2, ....
Then you should be able to sync your calendar by this command :
syncevolution google-calendar
or google-calendar-2, ...
To automatically run this sync command, a way is to use "crontab job"
You can see this post for some details about crontab in ubuntu touch.
I try to describe below the method 1 using a terminal connected with ssh to the phone :
Edit crontab file with this command :
crontab -e
Add this line at the end of the file :
@daily export DISPLAY=:0.0 && export DBUS_SESSION_BUS_ADDRESS=$(ps -u phablet e | grep -Eo 'dbus-daemon.*address=unix:abstract=/tmp/dbus-[A-Za-z0-9]{10}' | tail -c35) && /usr/bin/syncevolution google-calendar
Then use Ctrl+X to quit and save the file (may have to enter "Y" et "Enter")
After that to restart the cron service :
sudo service cron restart
The "google-calendar" should automatically daily sync. you can replace @daily by @reboot, @midnight, @weekly, ...
Edit 04/06/2015
If you do this in the phone terminal, the crontab file is not saving because of ubuntu touch is on "read file only system" One solution that could work is to switch in read/write mode for the system file (at your own risk) You can for example do :
sudo mount /dev/loop0 / -o remount,rw
crontab -e
Then modify and save the file like you did.
After that, you can check the file by using :
crontab -l
It's not recommended to switch in read / write mode for normal user. With the previuous command the system return in read mode after reboot. I used this command a lot of time with no ubuntu breaking.
crontab -l
. At least this way the crontab was saved. I just copied and pasted your code. The only thing I changed was @daily -> @hourly (which should exist following the cron-wiki). Also I have three calendars google-calendar-1, google-calendar-5, google-calendar-6 (and I dont really know which one I am addressing) so I added your line three times. At the end still now sync after hours. BTW: I'm doing everything via sdk on my laptop (14.04).