maemo.org - Talk

maemo.org - Talk (https://talk.maemo.org/index.php)
-   SailfishOS (https://talk.maemo.org/forumdisplay.php?f=52)
-   -   How to access SMS database in Sailfish? (https://talk.maemo.org/showthread.php?t=91909)

juiceme 2013-12-02 08:22

How to access SMS database in Sailfish?
 
I am trying to find a way to import my SMS'es from my N9 to my new Jolla device. By looking around the device I see that it's got a tracker DB just like N9 has, in /home/nemo/.cache/tracker/
Hence, I'd believe SMS'es are stored in tracker the same way that N9 handles them.

Now, on N9 I can get my SMS'es via tracker query: tracker-sparql -q "select nie:plainTextContent(?d) where {?d a nmo:SMSMessage}"

The same thing on Jolla device, however, returns nothing:

[nemo@localhost ~]$ tracker-sparql -q "select nie:plainTextContent(?d) where {?d a nmo:SMSMessage}"
Results:
None

[nemo@localhost ~]$


On N9 when I grep SMS from the used classes I get the hit for it:

~ $
~ $ tracker-sparql -q "SELECT DISTINCT ?o WHERE { ?s rdf:type ?o . }" | grep SMS
http://www.semanticdesktop.org/ontol...nmo#SMSMessage
~ $


And on Jolla it seems to be unused:

[nemo@localhost ~]$
[nemo@localhost ~]$ tracker-sparql -q "SELECT DISTINCT ?o WHERE { ?s rdf:type ?o . }" | grep SMS
[nemo@localhost ~]$


Now, how would I get to my messages on Jolla?

merlin1991 2013-12-02 16:58

Re: How to access SMS database in Sailfish?
 
The access layer for messages isn't tracker but libcommhistory, tracker just happens to be the storage engine on the N9

libcommhistory is part of the nemo middleware layer so it can be used on Sailfish aswell, see https://github.com/nemomobile/libcommhistory/

I've started working on an Harmattan exporter (to CSV) and Sailfish importer, the exporter is finished, but the importer isn't there yet.
The code lives on github: https://github.com/merlin1991/Harmattan-SMS-Boat

EDIT: since not everyone has a working scratchbox installation, here's a built binary:
http://cdnm.at/~christian/Harmattan-SMS-Boat/smsExport (use save link as)

juiceme 2013-12-02 17:27

Re: How to access SMS database in Sailfish?
 
Quote:

Originally Posted by merlin1991 (Post 1391782)
I've started working on an Harmattan exporter (to CSV) and Sailfish importer, the exporter is finished, but the importer isn't there yet.
The code lives on github: https://github.com/merlin1991/Harmattan-SMS-Boat

Okay, so I am missing some dependencies...?

Code:

[sbox-HARMATTAN_ARMEL: ~/Harmattan-SMS-Boat/n9Export] > qmake
/scratchbox/tools/bin/misc_runner: : No such file or directory
/scratchbox/tools/bin/misc_runner: : No such file or directory
/scratchbox/tools/bin/misc_runner: : No such file or directory
[sbox-HARMATTAN_ARMEL: ~/Harmattan-SMS-Boat/n9Export] >
[sbox-HARMATTAN_ARMEL: ~/Harmattan-SMS-Boat/n9Export] > make
g++ -c -pipe -g -D_REENTRANT -Wall -W -DQT_GUI_LIB -DQT_CORE_LIB -DQT_SHARED -I/targets/HARMATTAN_ARMEL/usr/share/qt4/mkspecs/linux-g++-maemo -I. -I/targets/HARMATTAN_ARMEL/usr/include/qt4/QtCore -I/targets/HARMATTAN_ARMEL/usr/include/qt4/QtGui -I/targets/HARMATTAN_ARMEL/usr/include/qt4 -I. -o smsEx.o smsEx.cpp
smsEx.cpp:5: fatal error: CommHistory/SyncSMSModel: No such file or directory
compilation terminated.
make: *** [smsEx.o] Error 1
[sbox-HARMATTAN_ARMEL: ~/Harmattan-SMS-Boat/n9Export] >


merlin1991 2013-12-02 18:39

Re: How to access SMS database in Sailfish?
 
Quote:

Originally Posted by juiceme (Post 1391791)
Okay, so I am missing some dependencies...?

You need libcommhistory-dev which isn't installed by default, I'll add it to the readme :cool:

miqu 2013-12-02 19:11

Re: How to access SMS database in Sailfish?
 
Nice Merlin1991,

Back in the day, I actually transferred all my messages from my N900 to my N9. So now there are well over 20000 messages on my N9. I think this time I will not import them as the database gets a bit large because of that import.

Unless some of you guys tells me to put Jolla to the test. :)

jbrooks 2013-12-02 20:24

Re: How to access SMS database in Sailfish?
 
I maintain the messaging stack for Jolla, so there are some pointers I can give here..

Quote:

Originally Posted by merlin1991 (Post 1391782)
The access layer for messages isn't tracker but libcommhistory, tracker just happens to be the storage engine on the N9

libcommhistory is part of the nemo middleware layer so it can be used on Sailfish aswell, see https://github.com/nemomobile/libcommhistory/

I've started working on an Harmattan exporter (to CSV) and Sailfish importer, the exporter is finished, but the importer isn't there yet.
The code lives on github: https://github.com/merlin1991/Harmattan-SMS-Boat

Correct. Nemo and Sailfish use libcommhistory (as did the N9), but we use a sqlite database instead of tracker. libcommhistory has an import/export tool for backup, but I would strongly recommend not using that between a N9 and Jolla. Things will break. I'd love to get some good text-based import/export tools in there instead. VMessage support would be especially interesting.

Your CSV exporter looks like a great start. For importing, use /org/freedesktop/Telepathy/Account/ring/tel/account0 as the localUid. Use a GroupModel to create one group per unique phone number, and then an EventModel to create events. Make sure to set the right groupId on events.

I wouldn't recommend trying to import IM messages from the N9.

Quote:

Originally Posted by miqu
Back in the day, I actually transferred all my messages from my N900 to my N9. So now there are well over 20000 messages on my N9. I think this time I will not import them as the database gets a bit large because of that import.

Unless some of you guys tells me to put Jolla to the test.

Please don't ;) - Performance will get really bad right now. There are changes going into the next update(s) that make it fast for several hundred thousand messages, but right now it's pretty bad.

merlin1991 2013-12-02 21:38

Re: How to access SMS database in Sailfish?
 
Quote:

Originally Posted by jbrooks (Post 1391887)
I'd love to get some good text-based import/export tools in there instead. VMessage support would be especially interesting.

I'd love to implement a proper transfer format instead of my selfinvented abuse of the term "CSV".

But apart from a wikipedia entry which tells me that vMessage is specified by IrDA and that the format is most likely in their IrMC standards set I've found nothing about the format.
And as usual one gets the standard only for a fee, which is 100$ in this case, so not an option for me.

jbrooks 2013-12-02 21:58

Re: How to access SMS database in Sailfish?
 
Quote:

Originally Posted by merlin1991 (Post 1391923)
I'd love to implement a proper transfer format instead of my selfinvented abuse of the term "CSV".

But apart from a wikipedia entry which tells me that vMessage is specified by IrDA and that the format is most likely in their IrMC standards set I've found nothing about the format.
And as usual one gets the standard only for a fee, which is 100$ in this case, so not an option for me.

http://www.pday.com.cn/technology/ir.../IrMC_v1p1.pdf section 9.9.2 (page 79, or 91 in the pdf) has the definition. Although now that I look around, there's not much support for vmsg anywhere except perhaps in bluetooth.

I'd stick with the CSV for now - no reason to make it complicated. Although if you ever get bored and want to implement vmsg import/export in libcommhistory.. :p

tigre-bleu 2013-12-02 23:43

Re: How to access SMS database in Sailfish?
 
What would be good (but quite more complex than just import/export) is to synchronize SMS with an email account.

There is an app for Android that does that on gmail and even if it is google-only, the principle is good.

SMS could just be exported/imported to an IMAP folder. MMS could also with multimedia content as attachment.

juiceme 2013-12-03 06:27

Re: How to access SMS database in Sailfish?
 
Quote:

Originally Posted by merlin1991 (Post 1391923)
I'd love to implement a proper transfer format instead of my selfinvented abuse of the term "CSV".

CSV is okay I guess but XML would be pretty nice too.
Nowdays I would not worry about the ML overhead, trying to squeeze data into too little containers is pointless on the age of memory abundance we are living :D


All times are GMT. The time now is 04:26.

vBulletin® Version 3.8.8