The Nightowl

Earlybird Software

Android Contraction Timer DB

I don't (yet) have an export function in the Contraction timer, however my intention is not to keep you from accessing your own data. In the meantime, you may find this script which generates a csv file handy. The data is stored in an sqlite3 DB, with a simple schema (a contraction table with columns for the starttime and stoptime which are in seconds since epoch, and a column inprogress which is 0 or 1). You may want to modify it to calculate the duration, spacing between contractions, etc. Let me know if anyone writes a better script and I'll post it here for all to use. Thanks! -Mike

#! /usr/bin/python

# File is located at:
#     /data/data/com.earlybirdsoftware.contractiontimer/files/ctxtimer.db
# With the emulator, I use this command:
# adb pull /data/data/com.earlybirdsoftware.contractiontimer/files/ctxtimer.db .
# My phone isn't rooted; let me know if that's not where it is on the device

import sqlite3
import time

con = sqlite3.connect('ctxtimer.db')
cur = con.cursor()

f = open('ctxtimer.csv', 'w')
f.write('start,stop,inprogress\n')
cur.execute('select starttime, stoptime, inprogress from contraction')
for row in cur.fetchall():
    # row[0] is start time in seconds since epoch
    # row[1] is stop time in seconds since epoch
    # row[2] is 0/1 whether it's in progress
    # So you can massage these however you want ;-)
    f.write('%s,%s,%d\n' % (time.ctime(row[0]), time.ctime(row[1]), row[2]))

f.close()

This is the lab. The place to find beta versions, experimental software, knick-knacks, and other stuff that doesn't fit anywhere else.