Sunday, March 30, 2014

Syncing XBMC settings over DropBox on a KitKat Android

I have a Sony Xperia Z1 and I wanted to try XBMC on it before applying it on all of my other devices so instead of simply installing all of the addons and configure them on each device seperately, there is an addon that does that exactly.
I chose the use DropBox as a place that holds my configuration but since my Xperia Z1 is on KitKat, it wasn't as easy as I initially thought.
The stated below is intended for anyone who wants to acheive the stated above.

Taken from http://forum.stmlabs.com/showthread.php?tid=5701

1. select dropbox...below it will ask you for your app key and secret.
Here is how you get them
A. Login to your dropbox and goto dropbox.com/developers/apps
B. Create and app
App Type: Core API
Name: "can be anything ur little heart desires"
Description: I put "the answer to world peace" but it also can be anything/blank
Access: App folder...unless u want ur pi to have access to any other folder besides ur backup folder.
C. hit Create!
You should see a screen with ur app key and secret...WRITE IT DOWN!
2. Enter ur app key and secret u just created.
3. hit OK

After u tell XBMCbackup what u want it to backup and set ur scheduling pref. hit OK!

Now lets back some stuff up shall we...
1. Goto program add-ons from main menu and select XBMCbackup and hit backup!
2. A msg box will appears telling to to goto ur log and get the URL...DO NOT HIT OK...i repeat...DO NOT HIT OK YET!!!!
3. SSH into ur pi and goto home/pi/.xmbc/xbmc.log (scroll down to the bottom or search "script.xbmcbackup")
4. copy and paste URL in to a browser of ur choice (CHROME for me)
5. If the gods have smiled upon u...u should see a screen asking you to allow access..hit ALLOW!
6. Now go back to ur pi and hit the OK button
7. The back up should start! 
The second part is where the issue begins as on kitkat the log reside in /data/data/org.xbmc.xbmc/cache/temp/xbmc.log which unless rooted, you can't access.
So the solution was quite simple. Do it on one of my linux machines, then copy the dropbox configuration from ~/.xbmc/userdata/addon_data/script.xbmcbackup to /sdcard/ /Android/data/org.xbmc.xbmc/files/.xbmc/userdata/addon_data/script.xbmcbackup, restart XBMC and viola! I was able to sync my Xperia Z1 (with KitKat) through DropBox.