Export Notes? - Ascend Mate 7 Q&A, Help & Troubleshooting

Many many notes using the Notes app on the Mate 7. Is there any way to export these notes so I can transfer them to PC/ another phone?

You can press "Share" for each note and share it via E-mail, or alternatively you can share it to "Google Keep" which is also an app for taking notes made by google. With google keep you can sync your note across all your devices.
Another way is to backup your notes with the "Backup" app which came with the phone's software, or the "HiSuit" program which is the official application from Huawei to backup files on your PC.
Feel free to ask any question if anything wasn't very clear.

Thanks for your response-
Too many notes to share individually and I think I would need to share individually to migrate to Google Keep...?
I believe the Backup and Hisuit program store in a format that is only useful for restoring to the phone or another Huawei phone; I need to transfer notes to pc/another non-Huawei phone.
Please clarify if I've missed something here. Hope someone has a solution...
Thanks-
Sam

SAbboushi said:
Too many notes to share individually and I think I would need to share individually to migrate to Google Keep...?
Click to expand...
Click to collapse
Unfortunately, yes you need to transfer each one individually.
SAbboushi said:
I believe the Backup and Hisuit program store in a format that is only useful for restoring to the phone or another Huawei phone; I need to transfer notes to pc/another non-Huawei phone.
Click to expand...
Click to collapse
Yea that's true, it only works with Huawei phones.
Huawei's notes app doesn't have many features to try, it only allows to "share" each note individually, Yes that will take time but once you switch into Google keep, Evernote, OneNote ..etc you can sync your notes across all your devices.

hi there,
I lost all my notes from my huawei p9 lite after i format my phone.
My questio is where can I find my old saved notes? I backed upmy phone before reseting it, and i copied all my files in my PC.
Thanks for your help.

If anyone else struggles with transfering notes from their phone to a different device, you could use the cloud option, back up the notes in phone settings (Cloud section), and then login to : cloud.huawei.com where you will be able to copy-paste all the notes to your computer. I assume this is easier for most people than copy-pasting on phone.

Hi,
I had similar situation - a stock Huawei phone with stock notes app and a user trying to migrate to Xiaomi... So it happened as follows:
Export Huawei notes from cloud, using browser access
Create "Standard Notes" account
Convert Huawei exported notes into "Standard Notes" backup format
Import "Standard Notes" backup
Here are details of operation:
Login into your Huawei cloud on some browser (preferably on computer)
Choose to download your data, click on notes
It will generate ZIP with JSONs of every note (use 7z to extract, as unzip on Linux fails with error 99)
Create a "Standard Notes" account at https://app.standardnotes.org (basic account is free, FOSS app is available on F-droid, nice interface, e2e encrypted)
Add one "My test note WOO-HOO!" to your new account
Export "Standard Notes" backup (using computer)
It will also make you download ZIP file, with a structure inside, however you only need top level "Standard Notes Backup and Import File.txt" file, which is, in fact, a JSON
You can make your own solution or just use my Ruby code (attached) to convert into a Standard Notes backup format, please adjust path at line #11 to match your needs.
Run ruby (it converted 2000+ notes in a few seconds for me), redirect output into a file, remove array markers in the very beginning and very end (first and last "[ ]" symbols)
Carefully edit "Standard Notes Backup and Import File.txt" file, insert the JSON block generated by Ruby code. In my case, my test note started at line 102 and finished at line 119, so I inserted my JSON starting with line 120 (do not forget add one comma in the end of line 119)
Run resulting TXT file through jq or any other JSON validation tool to make sure everything is fine.
Import into your Standard Notes
Sorry to leave some manual work to do, however this is just one time operation.
Cheers!

chockophone said:
Hi,
I had similar situation - a stock Huawei phone with stock notes app and a user trying to migrate to Xiaomi... So it happened as follows:
Export Huawei notes from cloud, using browser access
Create "Standard Notes" account
Convert Huawei exported notes into "Standard Notes" backup format
Import "Standard Notes" backup
Here are details of operation:
Login into your Huawei cloud on some browser (preferably on computer)
Choose to download your data, click on notes
It will generate ZIP with JSONs of every note (use 7z to extract, as unzip on Linux fails with error 99)
Create a "Standard Notes" account at https://app.standardnotes.org (basic account is free, FOSS app is available on F-droid, nice interface, e2e encrypted)
Add one "My test note WOO-HOO!" to your new account
Export "Standard Notes" backup (using computer)
It will also make you download ZIP file, with a structure inside, however you only need top level "Standard Notes Backup and Import File.txt" file, which is, in fact, a JSON
You can make your own solution or just use my Ruby code (attached) to convert into a Standard Notes backup format, please adjust path at line #11 to match your needs.
Run ruby (it converted 2000+ notes in a few seconds for me), redirect output into a file, remove array markers in the very beginning and very end (first and last "[ ]" symbols)
Carefully edit "Standard Notes Backup and Import File.txt" file, insert the JSON block generated by Ruby code. In my case, my test note started at line 102 and finished at line 119, so I inserted my JSON starting with line 120 (do not forget add one comma in the end of line 119)
Run resulting TXT file through jq or any other JSON validation tool to make sure everything is fine.
Import into your Standard Notes
Sorry to leave some manual work to do, however this is just one time operation.
Cheers!
Click to expand...
Click to collapse
hello i can't find the ruby code...

mcnick50 said:
hello i can't find the ruby code...
Click to expand...
Click to collapse
Sorry mate, looks like I can't attach it successfully. Let me try to paste into the body... Hopefully it won't get transformed into a emoticons
#!/usr/bin/ruby
#
require "pp"
require "json"
require "securerandom"
#json_in = File.read("../Notes-2021050323205147761/Notes/20210401133344621/json.js");
s_notes = []
Dir.glob('../Notes-2021050323205147761/Notes/*/json.js').each do |j|
json_in = File.read(j)
json_hash = JSON.parse(json_in[11..-1]);
uuid = SecureRandom.uuid
text = json_hash["content"]["title"].to_s
created_u = json_hash["content"]["created"].to_s[0..9].to_i
modified_u = json_hash["content"]["modified"].to_s[0..9].to_i
created = Time.at(created_u).strftime('%Y-%m-%dT%H:%M:%S.%LZ')
modified = Time.at(modified_u).strftime('%Y-%m-%dT%H:%M:%S.%LZ')
title_length = json_hash["content"]["title"].to_s.index("\n")
title = ""
if title_length > 30
title = json_hash["content"]["title"].to_s[0..30]
else
title = json_hash["content"]["title"].to_s[0..title_length-1]
end
s_note = {
:uuid => uuid,
:content_type => "Note",
:content => {
:text => text,
:title => title,
:references => [],
:appData => {
"org.standardnotes.sn" => {
:client_updated_at => modified
}
},
: preview_plain => "" # DELETE SPACE BETWEEN : and the "p"...
},
:created_at => created,
:updated_at => modified
}
s_notes.push s_note
end
puts s_notes.to_json

chockophone said:
Sorry mate, looks like I can't attach it successfully. Let me try to paste into the body... Hopefully it won't get transformed into a emoticons
#!/usr/bin/ruby
#
require "pp"
require "json"
require "securerandom"
#json_in = File.read("../Notes-2021050323205147761/Notes/20210401133344621/json.js");
s_notes = []
Dir.glob('../Notes-2021050323205147761/Notes/*/json.js').each do |j|
json_in = File.read(j)
json_hash = JSON.parse(json_in[11..-1]);
uuid = SecureRandom.uuid
text = json_hash["content"]["title"].to_s
created_u = json_hash["content"]["created"].to_s[0..9].to_i
modified_u = json_hash["content"]["modified"].to_s[0..9].to_i
created = Time.at(created_u).strftime('%Y-%m-%dT%H:%M:%S.%LZ')
modified = Time.at(modified_u).strftime('%Y-%m-%dT%H:%M:%S.%LZ')
title_length = json_hash["content"]["title"].to_s.index("\n")
title = ""
if title_length > 30
title = json_hash["content"]["title"].to_s[0..30]
else
title = json_hash["content"]["title"].to_s[0..title_length-1]
end
s_note = {
:uuid => uuid,
:content_type => "Note",
:content => {
:text => text,
:title => title,
:references => [],
:appData => {
"org.standardnotes.sn" => {
:client_updated_at => modified
}
},
: preview_plain => "" # DELETE SPACE BETWEEN : and the "p"... otherwise it becomes
},
:created_at => created,
:updated_at => modified
}
s_notes.push s_note
end
puts s_notes.to_json
Click to expand...
Click to collapse

Could you describe to me exactly how this ruby works, what it takes. i have 2000 notes and i can't convert as described you can't.

glehel said:
Could you describe to me exactly how this ruby works, what it takes. i have 2000 notes and i can't convert as described you can't.
Click to expand...
Click to collapse
You will need little experience with running things on command line (preferably Linux or Mac, but can also work on Windows). Basically, I already escribed all steps in the post above: export Huawei notes, export empty Standard Notes. Use ruby to transform Huawei notes into Standard Notes fragment, which you will have then manually copy-paste into empty SN backup form above.

chockophone said:
You will need little experience with running things on command line (preferably Linux or Mac, but can also work on Windows). Basically, I already escribed all steps in the post above: export Huawei notes, export empty Standard Notes. Use ruby to transform Huawei notes into Standard Notes fragment, which you will have then manually copy-paste into empty SN backup form above.
Click to expand...
Click to collapse
I tried running your code but I'm getting the following error
Traceback (most recent call last): 2: from Notes.rb:11:in <main>' 1: from Notes.rb:11:in each' Notes.rb:27:in block in <main>': undefined method >' for nil:NilClass (NoMethodError)

RajtheKing said:
I tried running your code but I'm getting the following error
Traceback (most recent call last): 2: from Notes.rb:11:in <main>' 1: from Notes.rb:11:in each' Notes.rb:27:in block in <main>': undefined method >' for nil:NilClass (NoMethodError)
Click to expand...
Click to collapse
I guess that in your case problem actually is on line 11. Please make sure you put correct file pattern there. Or maybe they changed format since then and there is no more title field present. In any case, if you run into issues, do not hesitate to PM me.

Related

[Q] project resource

There are many json files containing the information {"color": "red"}. I want to create a listBox of colors of these files,data must be read. The most simple (which I wrote):
Code:
int i = 1;
while (i < 300)
{
var file = Application.GetResourceStream(new Uri("files/color"+i+".json", UriKind.Relative));
i++;
if (file == null)
{
Debug.WriteLine("file not found");
break;
}
DataContractJsonSerializer ser = new DataContractJsonSerializer(typeof(Color));
Color example = (Color)ser.ReadObject(file.Stream);
}
I have not found how to work with directories of the project so just go over everything.
I read about IsolatedStorageFile, this store is used as a sandbox for the application. How to install the application can put files there?
This is a simple example I used just to find out, in fact, much more data.
P.S. Sorry for my bad english
Quick tip: you should be using the "using" keyword, or manually cleaning up your stream.
That said, there's no official way to write to the isolated storage on program installation. Unofficially, you can use the XAP deployer hack (read about it on the dev&hacking sub-forum) if you really want to do this, although it almost certainly won't survive market ingestion (if you want to publish it).
The best official way is to check, when the program starts up, whether it has populated its isostore. If not, it uses the GetResourceStream to read from its install folder and write to the isostore.
If that's not enough info or doesn't answer your question, please try to be more precise.
evgen_wp said:
There are many json files containing the information {"color": "red"}. I want to create a listBox of colors of these files,data must be read. The most simple (which I wrote):
Code:
int i = 1;
while (i < 300)
{
var file = Application.GetResourceStream(new Uri("files/color"+i+".json", UriKind.Relative));
i++;
if (file == null)
{
Debug.WriteLine("file not found");
break;
}
DataContractJsonSerializer ser = new DataContractJsonSerializer(typeof(Color));
Color example = (Color)ser.ReadObject(file.Stream);
}
I have not found how to work with directories of the project so just go over everything.
I read about IsolatedStorageFile, this store is used as a sandbox for the application. How to install the application can put files there?
This is a simple example I used just to find out, in fact, much more data.
P.S. Sorry for my bad english
Click to expand...
Click to collapse
Indeed, clearly, is better.
thank you
Every time you hit the page will load data from files. It's slow. Probably better to use the database. What do you suggest?
an additional question: how to view the contents of the folder in the install folder
Loading the app's IsolatedStorageSettings.ApplicationSettings data (which is a simple text file in the data folder) is quite fast; I really doubt you'll notice it. Just save their once the fact that you imported the files from the install folder to the isostore. I just about guarantee that any kind of database access will take much longer, at least for the initial hit. Reading a short plain-text file and parsing it should take maybe a few miliseconds, at worst.
As for viewing folder contents, technically this can be done using native code, but it can't be done with the official API (I get the feeling you want to publish this app, so that matters). However, that shouldn't matter, really - you know what files are in the install folder and its subfolders, because you put them there. If you want to know how to use GetResourceStream on sub-folders of the install folder, that's easy; your code as listed above should work. Note that the files must be build action "content" and not "resource". You can still access "resource" files but the URI is different.

[IDEA] And what about file association ?

When I search in the wp7 forum I see few thread about file association in wp7 but I just remark that it's not so difficult to do using the excellent wp7 root tools SDK:
Code:
string Me = "1ff297cf-853f-4c7c-b9ca-1d255cb4c387".ToUpper(); //our Application's AppId
string Format = ".xml";
//set the defaut file association for .xml to FileAssoc instead of xmlfile
Registry.SetValue(RegistryHyve.ClassesRoot, Format, "Default", "FileAssoc");
//create the corresponding registry key
try { Registry.DeleteKey(RegistryHyve.ClassesRoot, "FileAssoc"); }
catch { }
Registry.CreateKey(RegistryHyve.ClassesRoot, "FileAssoc");
//create the key BrowseInPlace (I don't know why, I just do it, it takes one line)
Registry.SetValue(RegistryHyve.ClassesRoot, "FileAssoc", "BrowseInPlace", 0x0);
//and the app that must open .xml file (our app)
Registry.CreateKey(RegistryHyve.ClassesRoot, "FileAssoc\\shell\\open\\command");
Registry.SetValue(RegistryHyve.ClassesRoot, "FileAssoc\\shell\\open\\command", "Default", "app://" + Me + "/_default?type=FileAssoc&file=%s");
But if each application try to play with those settings it wil be the mess in the phone that's why I suggest that someone create an app that manage file associations for the user to choose what application he want use for a given file type and to support more file type (like .epub or .rar).
moreover the application that create File association must use native code but it's not necessarily the case for the application that read the file it would allow developers to publish this app on the marketplace (by adding an other source like skydrive or url) and the application that create File association would just be a big plus for Interop-unlocked phones.
Here is an app that display xml file in a textbox it's just an exemple of how it works:
fbe.am/8ld ==> xap
fbe.am/8le ==> source
What do you think ?
I actually knocked up an app very similar to this a little while ago, I didn't get around to finishing it but it was fully capable of searching the registry and compiling a list of known file extensions. As well as searching the installation directories of app's for certain .xml which contained the file extension that the app wanted to be associated with.
It was all written as a managed app, and I don't know if someone would want to look at it, but if there is some interest I can put it up.

Link contact adress to Nokia Drive

I use my7rom on my Omnia 7.
Is there anyway to link a contacts adress to Nokia Drive instead of Maps (stock wp7 app). It would be much more practical if Nokia Drive opened a navigation session instead.
Anyone up for the challenge? A reg-tweak perhaps?
// Manneman
Skickat från Windows Phone 7.8
There's two parts here. The first is identifying the correct "filetype" or URI scheme that is used for navigation. That shouldn't be too hard; a little digging in HKCU should reveal it. We already know about ones like callto: and http: and I'm actually (slowly) working on an app to allow people to easily change them. The second part is finding the correct command to load that address or route in the Nokia Maps app. If the app supports pinning routes or destinations to Start, this is probably possible. If not, it may not be possible in the app. Most apps aren't designed to accept command-line parameters, so even if you make them the default handler for a given filetype or URI scheme, they ignore the value you send them and just start as though launched from Start.
GoodDayToDie said:
If the app supports pinning routes or destinations to Start, this is probably possible.
Click to expand...
Click to collapse
Nokia Drive supports pinning to start so it should be possible. Unfortunately I can't tell you exact command line parameters 'cause my Lumia 900 still "in jail"
Let me see if I have a copy of the Nokia Drive XAP handy. I'll need to decompile it to figure out the correct parameters for launching it with the intent of navigating to a specific location. Note also that this might not be possible directly - for example, the app might store a list of locations internally, and the tiles only provide an index into that list rather than providing the location directly - but that just requires another layer of indirection.
In that case, you create an app that gets registered as the navigation handler, and in response to a navigation request, it writes the requested location into the Nokia Drive app and then chain-launches Nokia Drive with the index of the newly written location. That's just an example of one way that this might go wrong, but overall, the odds are actually pretty good. Obviously, all of this will require, at a minimum, write access to the HKCR hive in the registry.
Ah, guys! You are so kind helping me out. I´m really certain alot of members in the WP7 section would love for this to work!
// Manneman
GoodDayToDie said:
I'll need to decompile it to figure out the correct parameters for launching it with the intent of navigating to a specific location
Click to expand...
Click to collapse
GoodDayToDie, you may try much simpler solution. Just create assembly (dll) to show startup parameters in message box, and replace main Nokia Drive dll (but pin some location first).
That's actually harder than it sounds; even if the app is sideloaded (which would mean I already have the DLL) my fake would have to mimic the internal structure of the real app to a degree (namespaces, class names, default actions, etc.). That's not hard, but decompiling .NET is pretty trivial too.
AFAIR, Nokia Drive is obfuscated (but I'm not 100% sure). Also, you don't need to duplicate all names and structures; just a stuff mentioned in WMAppManifest (I hope so). BTW, I forgot: I still have unlocked handset; if I'll found time, will try today later.
Update: tried but without of luck What I did:
- installed Nokia Drive first;
- downloaded map and pinned current location;
- created fake app with same app guid and namespace name ("Drive"), and performed app update (that operation completely override whole solution but NokiaDrive tile still pinned to the start screen);
- tried a few different page names (_default.xaml, QuickStartPage.xaml, DestinationPickerPage.xaml, FavoritesPage.xaml) with code
Code:
protected override void OnNavigatedTo(System.Windows.Navigation.NavigationEventArgs e)
{
MessageBox.Show("Hello from fake dll");
if (e.NavigationMode == System.Windows.Navigation.NavigationMode.New)
{
string[] keys = NavigationContext.QueryString.Keys.ToArray();
string[] values = NavigationContext.QueryString.Values.ToArray();
string param = "";
for (int i = 0; i < keys.Length; i++)
{
param += keys[i] + " -> " + values[i] + "\n";
}
MessageBox.Show("parameters: " + param);
}
}
But result always the same: app doesn't start from the pinned tile
Update 2: Finally, I did it
The trick is:
- do the same as I've described above (you should have pinned tile from ND);
- add following code to the start page:
Code:
public MainPage()
{
InitializeComponent();
var appTile = ShellTile.ActiveTiles.Last();
if (appTile != null)
{
//MessageBox.Show(appTile.NavigationUri.OriginalString);
EmailComposeTask emailTask = new EmailComposeTask();
emailTask.Subject = "NokiaDrive pinned parameters";
emailTask.Body = appTile.NavigationUri.OriginalString;
try
{
emailTask.Show();
}
catch (Exception ex)
{
MessageBox.Show(ex.Message, "Error", MessageBoxButton.OK);
}
}
}
- run app as usual (not from tile);
We allset - all params are sent to our email (I'm too lazy to manually copy all stuff )
Here we are (start parameters; bold values are changed for privacy reason ):
/_default?destination.name=200 SomeName Street&destination.latitude=49.5255378801376&destination.longitude=-72.4296837244183&destination.address.street=SomeName Street&destination.address.houseno=200&destination.address.district=&destination.address.county=&destination.address.city=SomeCity&destination.address.state=&destination.address.country=USA&destination.address.postcode=05720&destination.hashCode=371767793destination.address.statecode=MA&pinnedFrom=Favorites
P.S. Just found: Navigon also has ability to pin address to the start tile So, if you find the way to modify map protocol (or how it calls), it will be a really nice hack! BTW, could you remind me: do we have ability to launch assembly by GUID (on the full-/policy-unlocked phones)? If "yes", it's possible to write a real nice "proxy" app to handle map requests
I don't know about launching assemblies directly, but it's certainly possible to launch apps by GUID. It doesn't even require anything more than dev-unlock in fact (although of course you can only launch apps that you could launch anyhow). So yes, a proxy app is totally possible. That's actually what I'm working on (started as a project to make a Kindle ebook file loader, that would pur .mobi/.prc file in the Kindle app's folder and then launch the app).
GoodDayToDie, could you please, take a look to the registry, for default map protocol handler and figure out how to change that stuff? I'm pretty busy these days (and probably will be extremely busy couple of next months) but we can cooperate and create this app...
I'll investigate, but you're not the only one busy. If you've noticed a lack of software from me recently, it's due to the nex job I got some months back; I love it, but it leaves me with a lot less time for phone hacking if I want to still have a life outside of that.
With that said, this actually ties into the work I'm already doing with things like filetype handling and default browser switching. I can send you my HKCRlib, at a minimum; it's a library that simplifies interacting with HKCR, including creating backups of important values when they change, and reverting the backups.
GoodDayToDie, truly, I'm not much interested (personally) in that hack 'cause I can't use it for my Lumia 900. So it's only for the community needs but because of lack of time, I believe, we may put it on hold.

Tool to extract Samsung Motion Photos to plain jpg and mp4

First off, I've been browsing here for some time, but I've just registered so I'm sorry if I'm breaking any etiquette or conventions on posting.
I ran across goofwear's tool to extract videos and photos from Samsung Motion Photos and thought it was useful. But I really wanted something that I'd be able to throw a whole album of motion photos at, rather than doing one at a time with this or the share app. I looked at the .bat file they used and implemented the same technique in C, so it could quickly process many photos. It's written with some direct Win32 API calls, so it's pretty much Windows only though making a cross platform command line version without the open dialog would be trivial. It is a simple program though, so it should work fine on Linux or Mac through Wine.
Here's the exe.
See the main page of that Github repository for more complete instructions and full source.
How to use:
1. Copy your Motion Photos off your Samsung phone, to your PC. Just copy them out of the DCIM folder.
2. Run the program. An "open" dialog appears. Apart from that there's no GUI on this program.
3. Browse to your photos and select them. Hold ctrl to select more than one, or shift to select a range. Or, ctrl+A to select all in a folder.
4. Click Open.
5. Wait. Depending how many you selected, it might take a little bit. When it's done, a message box will appear.
6. You should see *_photo.jpg and *_video.mp4 files next to the originals in the source directory. Note that this program does not modify the original files. It doesn't even open them with write permissions enabled.
Alternately, drag one or more photos from Windows Explorer onto the exe's icon instead of using the open dialog.
Screenshots:
{
"lightbox_close": "Close",
"lightbox_next": "Next",
"lightbox_previous": "Previous",
"lightbox_error": "The requested content cannot be loaded. Please try again later.",
"lightbox_start_slideshow": "Start slideshow",
"lightbox_stop_slideshow": "Stop slideshow",
"lightbox_full_screen": "Full screen",
"lightbox_thumbnails": "Thumbnails",
"lightbox_download": "Download",
"lightbox_share": "Share",
"lightbox_zoom": "Zoom",
"lightbox_new_window": "New window",
"lightbox_toggle_sidebar": "Toggle sidebar"
}
Version History:
1.0: Initial release
1.1: Added optional compile-time option to delete the original file after extracting
2.0: Refactored a bit, added a proper build system, and multilanguage support; moved to a 'real' Github repo
2.1: It now preserves timestamps when making the extracted files, and now supports a -r flag to rename the original file instead of appending _photo and _video to the extracted ones.
Andylain has written a Chinese language explanation of the usage of this program, and kindly translated the UI to Chinese (Traditional). To use it in Chinese, either have your Windows set to Chinese language, or rename the exe to put _zh at the end of the name. To use it in English on a Chinese Windows, put _en at the end of the name.
If for some reason you want the old version exe, the old "delete-original" exe, or the old source code, you can still have them.
Can you help to make a version that delete the source after successfully exact?
@Andylain Here's one that deletes the original file after splitting it into photo and video.
Oops -- turns out it was smaller because I forgot to include the icon last time. I've updated the link now and it points at a new build that has an icon.
This is super helpful, Thank you! Oh, there is no beautiful icon in this version.
BTW, I am a Chinese blogger live in Taiwan, I blogged this tool and made a Chinese user guide in my blog "andylain‧blogspot‧com/2017/07/SamsungMotionPictureExtractor.html" .
(Sorry, I am a new user and not allowed to post link.)
If you think that's not a great idea, please tell me and I'll delete my post.
@Andylain Thanks for linking me to your post, and thanks for writing a Chinese explanation for how to use it. I'm happy for people to use my program if they find it useful.
Would a proper Chinese language version of the program be helpful, or are most people there able to read enough English to understand the few error and status messages the program has?
@Andylain Please update your link to the "delete original" version to this one. I forgot to include the icon when building it yesterday.
Chupi383 said:
@Andylain Thanks for linking me to your post, and thanks for writing a Chinese explanation for how to use it. I'm happy for people to use my program if they find it useful.
Would a proper Chinese language version of the program be helpful, or are most people there able to read enough English to understand the few error and status messages the program has?
Click to expand...
Click to collapse
I think it's not hard to understand the status messages
However, a proper Chinese language version of the program would be much more helpful for girls and elderly since Samsung sell a lot of pink S8/S7 for this target.
I really love this app (super helpful for me) and I am happy to translate it , but I don't know how to code BTW. :silly: (just a blogger/photographer)
---------- Post added at 12:55 PM ---------- Previous post was at 12:47 PM ----------
Chupi383 said:
@Andylain Please update your link to the "delete original" version to this one. I forgot to include the icon when building it yesterday.
Click to expand...
Click to collapse
Thank you for the update. I update the link to my blog and facebook fanpage
@Andylain I've extracted all the user-facing strings from my code. The text in [square brackets] are comments giving some context for the message that follows, and don't appear anywhere in the program.
Code:
=====
[this message is shown in a dialog box if you click cancel on the open photos dialog]
You can use this program 3 different ways:
GUI USE: Just run it. You'll get an file-open dialog where you can open .jpg files. Use ctrl or shift or drag to select more than one.
DRAG & DROP USE: Drag one or more motion photos onto the icon for this exe.
COMMAND LINE USE: Run this program with one or more motion photo file names as arguments. Remember to use "quotes" if there are spaces in the names.
Any way you run it, the original files will not be modified. The extracted photo and video will be stored in *_photo.jpg and *_video.mp4 where * is the name of the original file, minus the .jpg extension.
Coded by Chupi383. All credit for the method goes to goofwear at the XDA forums. I've just ported their .bat file to plain C and Win32.
=====
[this is the title of the program]
Samsung Motion Photo Batch Extractor
=====
[this is displayed in the open dialog, under the box where you can type a filename, in a drop-down list]
Motion Photos (*.jpg)
All Files (*.*)
=====
[this is the title bar of the open dialog]
Open some Samsung Motion Photos
=====
[this message is shown if the user selected a file with a really really long name]
Skipping too-long path: <filename goes here>
=====
[title bar for error dialogs]
Error
=====
[error if the user selects over the maximum number of files (currently 10000)]
You've selected too many files. I can only do up to 10000 at a time.
=====
[error if the user selects so many files the Windows "open" dialog box gives up]
You've selected too many files. Try selecting fewer files and process them in bunches.
=====
[appended to names of extracted files - not sure if these should be translated]
_photo
_video
=====
[error if enough memory couldn't be allocated, possibly because the computer is out of RAM]
Can't allocate RAM to read <number> bytes from <filename>
=====
[error if a file can't be read for some reason, perhaps a damaged disk]
Skipping due to read error:
<filename>
=====
[error if an output file can't be written, generally because of full disk, read only disk, file exists and is read only, or permissions on the folder]
Can't write to <filename>
=====
[message on completion]
Finished extracting Motion Photos
Photos extracted: <number>
Videos extracted: <number>
=====
[added to the end of the previous success message if some files didn't contain a photo and a video]
<number> files were skipped because they weren't Motion Photos
=====
[title bar of completion message if at least 1 file was processed successfully]
Success
=====
[title bar of completion message if nothing was done successfully]
Failure
=====
["description" shown in right-click->properties dialog for the exe file]
Extract Samsung Motion Photos to jpg and mp4
=====
["product name" shown in properties dialog for the exe file]
Motion Photo Batch Extractor Utility
If you translate these for me, I'll put them back into my program to make either a Chinese or multi-language version.
Here is the translation of Chinese, sorry for the delay of this reply.
BTW, maybe a dialog for user to choose whether delete original files would be a great idea?
Code:
=====
[this message is shown in a dialog box if you click cancel on the open photos dialog]
有三種方式可以使用本軟體:
一:點開軟體後選擇你要轉存的照片,你可以使用Ctrl或是Shift來多選檔案。
二:把你要的照片拖移到本軟體的icon上也能轉存!
三:你也能使用Command Line來處理喔! (記得用”quotes”取代空格)
請放心:無論你怎麼做,原始檔案都不會被修改。轉存成功的檔案將會存在原始檔案位置,並新增為 *_photo.jpg 和 *_video.mp4。
GUI軟體由Chupi383撰寫,軟體內核由XDA forums的goofwear撰寫,Andylain翻譯正體中文,詳細中文使用教學請上「安迪連碎碎念」。
=====
[this is the title of the program]
三星動態相片批次轉存工具
=====
[this is displayed in the open dialog, under the box where you can type a filename, in a drop-down list]
動態相片 (*.jpg)
所有檔案 (*.*)
=====
[this is the title bar of the open dialog]
開啟一些動態相片
=====
[this message is shown if the user selected a file with a really really long name]
已忽略太長的路徑:<filename goes here>
=====
[title bar for error dialogs]
發生錯誤
=====
[error if the user selects over the maximum number of files (currently 10000)]
你一次選太多檔案了。我一次只能處理一萬個檔案。
=====
[error if the user selects so many files the Windows "open" dialog box gives up]
你一次選太多檔案了。嘗試選少一點檔案吧!
=====
[appended to names of extracted files - not sure if these should be translated ]
_photo
_video
=====
[error if enough memory couldn't be allocated, possibly because the computer is out of RAM]
記憶體定位錯誤,無法讀取 <number> bytes 上的 <filename> 檔案,有可能電腦的RAM不足。
=====
[error if a file can't be read for some reason, perhaps a damaged disk]
由於讀取錯誤,已跳過處理:
<filename>
=====
[error if an output file can't be written, generally because of full disk, read only disk, file exists and is read only, or permissions on the folder]
無法寫入 <filename> 可能目的地已滿或是為唯讀。
=====
[message on completion]
動態相片轉存結果:
有 <number> 張照片輸出成功!
有 <number> 個影片輸出成功!
=====
[added to the end of the previous success message if some files didn't contain a photo and a video]
<number> 個檔案被跳過了,因為它們不是三星動態相片。
=====
[title bar of completion message if at least 1 file was processed successfully]
轉存成功
=====
[title bar of completion message if nothing was done successfully]
轉存失敗
=====
["description" shown in right-click->properties dialog for the exe file]
批次把三星動態相片轉存成JPG照片和MP4影片!
=====
["product name" shown in properties dialog for the exe file]
動態相片轉存工具
[/CODE]
I'm sorry I'm being slow on this. My work has been especially busy lately. This thread isn't forgotten -- I'll make the translated app once I'm over this hump in workload.
Chupi383 said:
I'm sorry I'm being slow on this. My work has been especially busy lately. This thread isn't forgotten -- I'll make the translated app once I'm over this hump in workload.
Click to expand...
Click to collapse
That is very nice of you to do this!
Take your time and I am willing to help!
@Andylain Thank you for the translation! I've finally got a working bilingual exe -- see the original post. Sorry it took a while.
The "delete original" feature is now built into the main exe. You use the /d command line option to activate it. To make a drag-and-drop icon that will delete the original, right-drag it and create shortcut. Then right click the shortcut, go to properties, shortcut tab, and add a space and /d to the end of the target, after the closing quote.
BTW, if you could, please link people to "https://github.com/joemck/ExtractMotionPhotos/releases/latest" to get the exe -- that's a special link that will always go to the latest version I've posted there.
Coming up, I'd like to add an option to add/remove Explorer context menu integration.
This is absolutely amazing. Thank you so much!!
Chupi383 said:
First off, I've been browsing here for some time, but I've just registered so I'm sorry if I'm breaking any etiquette or conventions on posting.
I ran across goofwear's tool to extract videos and photos from Samsung Motion Photos and thought it was useful. But I really wanted something that I'd be able to throw a whole album of motion photos at, rather than doing one at a time with this or the share app. I looked at the .bat file they used and implemented the same technique in C, so it could quickly process many photos. It's written with some direct Win32 API calls, so it's pretty much Windows only though making a cross platform command line version without the open dialog would be trivial. It is a simple program though, so it should work fine on Linux or Mac through Wine.
Here's the exe.
See the main page of that Github repository for more complete instructions and full source.
How to use:
1. Copy your Motion Photos off your Samsung phone, to your PC. Just copy them out of the DCIM folder.
2. Run the program. An "open" dialog appears. Apart from that there's no GUI on this program.
3. Browse to your photos and select them. Hold ctrl to select more than one, or shift to select a range. Or, ctrl+A to select all in a folder.
4. Click Open.
5. Wait. Depending how many you selected, it might take a little bit. When it's done, a message box will appear.
6. You should see *_photo.jpg and *_video.mp4 files next to the originals in the source directory. Note that this program does not modify the original files. It doesn't even open them with write permissions enabled.
Alternately, drag one or more photos from Windows Explorer onto the exe's icon instead of using the open dialog.
Screenshots:
Version History:
1.0: Initial release
1.1: Added optional compile-time option to delete the original file after extracting
2.0: Refactored a bit, added a proper build system, and multilanguage support; moved to a 'real' Github repo
Andylain has written a Chinese language explanation of the usage of this program, and kindly translated the UI to Chinese (Traditional). To use it in Chinese, either have your Windows set to Chinese language, or rename the exe to put _zh at the end of the name. To use it in English on a Chinese Windows, put _en at the end of the name.
If for some reason you want the old version exe, the old "delete-original" exe, or the old source code, you can still have them.
Click to expand...
Click to collapse
Thanks
Just wanted to add my thanks for this fantastic tool.
I can't quite believe there's no official Samsung Motion Photo viewer (The Windows app doesn't appear to play Motion Photos). And there's practically no 3rd party support around for what you would think would be in high demand.
So I registered on XDA to show my appreciation. Thanks again.
Chupi383 said:
It's written with some direct Win32 API calls, so it's pretty much Windows only though making a cross platform command line version without the open dialog would be trivial. It is a simple program though, so it should work fine on Linux or Mac through Wine.
Click to expand...
Click to collapse
I also wanted to say thanks! That program is a wish-come-true! I wanted to create some script to batch-process JPG's and extract videos but that .exe is even better.
I have just one suggestion. Would you be able to modify program to set video's
Windows date modified
and maybe even date taken (EXIF) attributes
values to correct date, not current date when the extraction takes place?
It would help a lot, because Gallery apps or cloud services like Google Photos shows videos sorted / grouped by the date attribute which is different thandate of photo (when you extract old photos from last couple of months you will have a mess).
For now only way is to use some bulk date changer software to fix that - changing dates based on filename pattern, but it would be a nice feature for your exe. Do you think it's doable?
And yes. I created my XDA account just to say thank you for your great program!
Thanks a lot for this tool, Chupi383!
I'd like to "vote" for konieckropka's suggestion as well. Having the corrent timestamps on the extracted images and videos would be important for a correct file management.
The tool basically needs to read the original "modified timestamp" and set it to the created files (same for "created timestamp").
Could this please be added?
Fair point. I'll add it in a bit when I have the time.
Sorry for the delay, guys. I've added timestamp preservation and a -r flag to rename the original instead of adding _photo and _video. You can use -dr to delete the original and don't append _photo or _video to the extracted files.
This is super helpful, Thank you!
Chupi383 said:
Sorry for the delay, guys. I've added timestamp preservation and a -r flag to rename the original instead of adding _photo and _video. You can use -dr to delete the original and don't append _photo or _video to the extracted files.
Click to expand...
Click to collapse
Works perfectly now! THANKS A LOT!!

Share exercise data from the Huawei Health app

Huawei TCX Converter
A makeshift python tool that enables the extraction of TCX files from the Huawei Health app. Your phone must be a Huawei Phone or Rooted to access Huawei Health app data!
Introduction
Users of Huawei Watches/Bands sync their fitness data with the Huawei Health App. It is notoriously difficult to get the data out of this app, but through some cunning you can find HiTrack files which seem to contain some run data. This program allows you to take these files and generate .TCX files for use in your tracking app of choice (e.g. Strava). The outputted .TCX files will contain timestamped GPS, altitude, heart-rate, and cadence data where available.
Accessing the App Data
The Huawei Health app generates a 'HiTrack' file when it displays the trajectory of an particular exercise event. We can access these as follows:
Rooted phones
Navigate to data/data/com.huawei.health/files/
Copy the HiTrack files to your computer
Unrooted Huawei phones
Download the Huawei Backup App onto your phone.
Start a new unencrypted backup of the Huawei Health app data to your external storage (SD Card)
Navigate to Huawei/Backup/***/backupFiles/***/ and copy com.huawei.health.tar to your computer
Unzip the file and navigate to com.huawei.health/files/ and you should should see a number of HiTrack files
Using the Huawei TCX Converter
You need python 3 to use this tool.
Download the Huawei TCX Converter and save it as a Python script in the same folder as your HiTrack file.
The tool is run on the command line by passing it the name of your file as a command line argument. Other command line arguments:
-v - validate the final TCX file in order to check that the conversion has worked (requires xmlschema and an internet connection to download the TCX schema to check against)
-f - attempt to filter out any records in which GPS signal was lost, or cadence/heart-rate/altitude are invalid
-b - change sport to Biking
You can rename your HiTrack files if you wish, but for clarity in the examples below I leave mine exactly as I found it.
Illustration
I have copied the Huawei-TCX-Converter.py file to the directory containing my HiTrack file (HiTrack_1551732120000155173259000030001). Now I can run the tool as follows:
Code:
python Huawei-TCX-Converter.py HiTrack_1551732120000155173259000030001 -f -v
This gives me the output:
Code:
---- Input File ----
reading: OKAY
filtering: OKAY
processing gps: OKAY
processing heart-rate/cadence: OKAY
---- Details ----
sport: Running
start: 2019-03-04 20:42:00
duration: 00:07:49
distance: 1700m
---- XML file ----
generating: OKAY
saving: OKAY
validating: OKAY
Here are both the HiTrack file and the resultant TCX file for you to have a go with.
Next steps
The files are now ready (e.g. for upload to Strava). Some users have recommended the TCX Converter tool to add altitude data to your TCX files once they've been converted. This may overwrite altitude data extracted from your device, if it collects this.
Comparison
This is an image of the GPS trace from the .tcx file. The command line output above also lists the start time as 2019-03-04 20:42:00, the distance as 1.70km, and the duration as 00:07:49.
{
"lightbox_close": "Close",
"lightbox_next": "Next",
"lightbox_previous": "Previous",
"lightbox_error": "The requested content cannot be loaded. Please try again later.",
"lightbox_start_slideshow": "Start slideshow",
"lightbox_stop_slideshow": "Stop slideshow",
"lightbox_full_screen": "Full screen",
"lightbox_thumbnails": "Thumbnails",
"lightbox_download": "Download",
"lightbox_share": "Share",
"lightbox_zoom": "Zoom",
"lightbox_new_window": "New window",
"lightbox_toggle_sidebar": "Toggle sidebar"
}
For comparison, below is the data visable on the Huawei Health App. You can see that the distance is off by about 80m, and the duration off by 1 second, but the GPS trace is spot on.
Contributing
Go to the Github Hompage of this tool to contribute.
This is a very early alpha version of this tool, so please help me by making it better! There are some scripts in the Development Tools folder that I find useful for debugging. I'll accept any improvements, but if you're looking for inspiration you could start with this to-do list:
Remove reliance on using the original filename
Enable changing sport type from running (default) to biking
Read timestamped heart-rate, cadence, and altitude data where available
See if we really need to add the unused data elements (e.g. Calories) to the TCX (edit: we do as there is no minOccurs in the schema)
Check that this works for files other than those generated using the Huawei Band 2 Pro:
Confirmed working on a file from a Huawei Watch GT
Improve the distance measurement method (currently using Viscenty's Formulae)
Try and work out what tp=b-p-m is
Add interpolated heart-rate/pace/average speed data to each location element
Work on splitting data into Laps/Tracks rather than shoving it all into one
Try to call on an open API to get altitude data for location points that don't have it
Inspect other files in com.huawei.health to see if we can get any more relevant data out of them
XDA:DevDB Information
Huawei TCX Converter, Tool/Utility for the Smart Watches
Contributors
aricooperdavis
Source Code: https://github.com/aricooperdavis/Huawei-TCX-Converter
Version Information
Status: Testing
Created 2019-03-11
Last Updated 2019-03-11
Thanks for sharing man! I can't work out if I have a use for this, because I'm already using google fit and strava. But I would like to be able to extract sleep history from Huawei Health. Is that something you would plan to look at? I guess step data and continuous heart rate would be good too. I don't like being locked into an app with no cloud backup/access.
mrlb said:
I would like to be able to extract sleep history from Huawei Health.
Click to expand...
Click to collapse
So far I haven't found anything resembling sleep data in those HITRACK files - I think sleep data must be held elsewhere. I will keep poking around, but at the moment it's probably not at the forefront of my efforts as the other databases are encrypted so I cannot access them to read info. I'll still add it to the todo list though!
Dears, Thx for the type but i'm locked in step with the tar files. I've backuped it with Hisuite on my computer (not SD 'cause i didn't have it - bad version of P20).
But i can't extract the TAR files, it's seems it's corrupt. I've already tried to save the output TAR to different folders on my computer, on my local network etc.. but same issue. TAR is corrupte.
Did you have any idea ?
The best!!!
it works perfectly, Thanks!!!!!
works great... everything is great... only off by several number but overall satisfied...
also i have the schema file "TrainingCenterDatabasev2.xsd"... where should i put it? or this should be done automatically? thanks...
It worked very well !! How to implement more things in this great code? for example the sport swimming I tried most does not convert to .tcx so it is not possible to import to strava. how to import racing data about time and cadence in every 1km race? Thanks for what we already have works very well
negbd said:
Dears, Thx for the type but i'm locked in step with the tar files. I've backuped it with Hisuite on my computer (not SD 'cause i didn't have it - bad version of P20).
But i can't extract the TAR files, it's seems it's corrupt. I've already tried to save the output TAR to different folders on my computer, on my local network etc.. but same issue. TAR is corrupte.
Did you have any idea ?
Click to expand...
Click to collapse
Hi
maybe somehow crypted TAR ?
Thanks for making this it's really useful, shame the GT watch GPS is not very accurate and/or low sampling rate. The same run/cycle etc recorded on other devices is far more accurate and detailed. A 30 mile bike ride was 1.5 miles less on the Huawei watch! (Nothing you can do about that as it's the same in health app and after exporting to strava sadly)
It is working
Hi all,
I have created a petition asking Huawei to add export and sync to Strava. Please sign if you agree.
https://ipetitions.com/petition/huawei-please-add-gpxtcx-export-and-sync-to
Thanks
Signed
I was trying to create a backup using the HiSuite and the Backup and Restore app but the Heath App does not show up in the app list, anymore.
Can someone else confirm this?
Hello,
I'm planning to buy huawei smartband, but i want to export heart rate to google fit / garmin app...etc
Heart rate about the day, not about an activity.
With this is possible?
Hi sir/mam, im having issue running the latest version 2.3... im still using the old version with -v -b arguments... it is working with me but not the newest version 2.3... here are my batch file and error result... and how to use XML validation... i already downloaded the XSD file... but still nothing... then how to use PIP INSTALL XMLSCHEMAS... thanks...
----------------------------
batch file
---------------------------- @Echo off
echo.
"C:\Users\*******\AppData\Local\Programs\Python\Python37\python.exe" Huawei-TCX-Converter.py --file %1 --sport Cycle
echo.
pause
----------------------------
error output
----------------------------
Info - External library xmlschema could not be imported.
It is required when using the --validate_xml argument.
It can be installed using: pip install xmlschema
Traceback (most recent call last):
File "Huawei-TCX-Converter.py", line 926, in <module>
class TcxActivity:
File "Huawei-TCX-Converter.py", line 944, in TcxActivity
filename_prefix: str = None):
NameError: name 'xmlschema' is not defined
python Huawei-TCX-Converter.py --file HiTrack_1569078600000156908002700030001
File "Huawei-TCX-Converter.py", line 54
def __init__(self, activity_id: str, activity_type: str = TYPE_UNKNOWN):
^
SyntaxError: invalid syntax
I get this error if anyone can help me
python Huawei-TCX-Converter.py -f HiTrack_1551732120000155173259000030001 - this syntax works for me in newer version of python + dont forget to install schema = pip install xmlschema = search for youtube video called PIP INSTALL COMMAND IN PYTHON 3.6 ( i cannot post links as new user so sorry for that)
BUT
i also have honor band 4 running edition with tracking angles, forces etc. When i create files from those records - data are not here becouse they are not defined to translate in python program. can somebody help me with providing sources from garmin etc so i will try to add it by myself if nobody is interested to do this ?
the file from HB 4 running edition consists of those records : tp=rp;k=5;gct=532;gia=12;sa=65;ee=15;fsp=0;wsp=1;hsp=1;
can somebody help me to translate this?
from my own research so far -
1. ground contact time = GCT
2. Landing impact = gia
3. eversion excursion = ee
4. swing angle = sa
5. forefoot strike pattern = fsp
6. W? midfoot strike pattern = wsp
7. Heel strike pattern = hsp
How those things should be written in tcx files?
not work
Hello
I don'know python, I just launch the IDLE program from windows menu, I copied the script in the same hitrack folder and I type in the python shell the command
python Huawei-TCX-Converter --file HiTrack_myfilename
It shows syntax error and higlight in red the command "huawei"
Can you explain easily how to proceed? Is there a rule where put the folder?
Thanks
avvocato.rossi said:
Hello
I don'know python, I just launch the IDLE program from windows menu, I copied the script in the same hitrack folder and I type in the python shell the command
python Huawei-TCX-Converter --file HiTrack_myfilename
It shows syntax error and higlight in red the command "huawei"
Can you explain easily how to proceed? Is there a rule where put the folder?
Thanks
Click to expand...
Click to collapse
just read my previous post
syntax python Huawei-TCX-Converter.py -f HiTrack_1551732120000155173259000030001 works
regarding Distance Calculation (haversine instead of viscenty)y)
@aricooperdavis
Checked another calculation for distance between coordinates (haversine) but the results were the same (in your example: 1700.43m for Viscenty, 1699.3m for Haversine). I really do not know which is the algorithm used in HUAWEI Health (80 meters difference)
FYI, code used:
def _haversine(self, point1: tuple, point2: tuple) -> float:
R = 6378137
Phi1 = math.radians(point1[0])
Phi2 = math.radians(point2[0])
dPhi = math.radians(point2[0]-point1[0])
dLamda = math.radians(point2[1]-point1[1])
a = math.sin( dPhi/2 ) * math.sin(dPhi/2) + math.cos(Phi1) * math.cos (Phi2) * math.sin (dLamda/2)* math.sin(dLamda/2)
c = 2 * math.atan2(math.sqrt(a), math.sqrt(1-a))
d = R * c
return round (d,6)
https://www.movable-type.co.uk/scripts/latlong.html

Categories

Resources