Hi!
1) Pull from phone file /opt/usr/apps/com.samsung.shealth/data/.shealth.db
2) Open this file in SQLiteStudio
3) Open editor (Alt+E)
4) Add in editor the following:
Select all (Crtl+A) and execute (F9).
You'll see all your trainings. Remember the value "exerciseId" of the desired training. For example "5".
5) Replace the contents of the editor by doing the following:
Find in text "exerciseId=7" and replace to value ("7") to the value of your exerciseId ("5").
Select all (Crtl+A) and execute (F9).
6) Save result in txt file with extension ".gpx".
Enjoy :)
P.S.: My other lifehacks including editing contacts, adding images to contacts etc. (in Russian) may be found here.
1) Pull from phone file /opt/usr/apps/com.samsung.shealth/data/.shealth.db
2) Open this file in SQLiteStudio
3) Open editor (Alt+E)
4) Add in editor the following:
Code:
select exerciseId, datetime(substr(startTimeStamp,1,10), 'unixepoch') as startTime from shealth_exercise_history order by startTimeStamp;You'll see all your trainings. Remember the value "exerciseId" of the desired training. For example "5".
5) Replace the contents of the editor by doing the following:
Code:
select '<?xml version="1.0" encoding="UTF-8" standalone="no" ?><gpx xmlns="http://www.topografix.com/GPX/1/1" xmlns:gpxx="http://www.garmin.com/xmlschemas/GpxExtensions/v3" xmlns:gpxtrkx="http://www.garmin.com/xmlschemas/TrackStatsExtension/v1" xmlns:wptx1="http://www.garmin.com/xmlschemas/WaypointExtension/v1" xmlns:gpxtpx="http://www.garmin.com/xmlschemas/TrackPointExtension/v1" xmlns:gpxpx="http://www.garmin.com/xmlschemas/PowerExtension/v1" creator="Samsung Gear S" version="1.1" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.topografix.com/GPX/1/1 http://www.topografix.com/GPX/1/1/gpx.xsd http://www.garmin.com/xmlschemas/GpxExtensions/v3 http://www8.garmin.com/xmlschemas/GpxExtensionsv3.xsd http://www.garmin.com/xmlschemas/TrackStatsExtension/v1 http://www8.garmin.com/xmlschemas/TrackStatsExtension.xsd http://www.garmin.com/xmlschemas/WaypointExtension/v1 http://www8.garmin.com/xmlschemas/WaypointExtensionv1.xsd http://www.garmin.com/xmlschemas/TrackPointExtension/v1 http://www.garmin.com/xmlschemas/TrackPointExtensionv1.xsd http://www.garmin.com/xmlschemas/PowerExtension/v1 http://www.garmin.com/xmlschemas/PowerExtensionv1.xsd"><metadata><link href="http://www.index3.ru"><text>iNDEX3</text></link><time>'||strftime('%Y-%m-%dT%H:%M:%SZ', datetime(substr(gh.startTimeStamp,1,10), 'unixepoch'))||'</time></metadata><trk><name>'||datetime(substr(gh.startTimeStamp,1,10), 'unixepoch')||' Auto</name><extensions><gpxx:TrackExtension><gpxx:DisplayColor>Cyan</gpxx:DisplayColor></gpxx:TrackExtension></extensions><trkseg>' as gps
from shealth_exercise_history gh where gh.exerciseId=7
union all
select
'<trkpt lat="'||g.latitude||'" lon="'||g.longitude||'"><ele>'||g.altitude||'</ele><time>'||strftime('%Y-%m-%dT%H:%M:%SZ', datetime(substr(g.timeStamp,1,10), 'unixepoch'))||'</time><extensions><gpxtpx:TrackPointExtension><gpxtpx:hr>'||h.heartrate||'</gpxtpx:hr></gpxtpx:TrackPointExtension></extensions></trkpt>' as gpx
from shealth_exercise_gps_info g
left join (
select gt.timeStamp as g_timeStamp
, (select max(ht.timeStamp) from shealth_exercise_hrm_logging ht where ht.timeStamp<=gt.timeStamp and ht.exerciseId=gt.exerciseId) as h_timeStamp
, gt.exerciseId
from shealth_exercise_gps_info gt
) tsm on tsm.g_timeStamp=g.timeStamp and tsm.exerciseId=g.exerciseId
left join shealth_exercise_hrm_logging h on h.timeStamp=tsm.h_timeStamp
where g.latitude <> 200 and g.exerciseId=7
union all
select '</trkseg></trk></gpx>';Select all (Crtl+A) and execute (F9).
6) Save result in txt file with extension ".gpx".
Enjoy :)
P.S.: My other lifehacks including editing contacts, adding images to contacts etc. (in Russian) may be found here.
No comments:
Post a Comment