This documents the functionality that we are adding to mathies apps gradually. Not all file operations are available to all tools.

How the operations are performed depends on whether you are using the tool:
  1. in a Browser (Chrome, Firefox, Safari, Edge etc.)
  2. as an installed desktop Application (Windows or Mac)
  3. as an App on a mobile device (iOS or Android)

File Types
Files saved by mathies tools are actually in the XML format. They use a custom extension (like .relrods) so that they can be associated with the correct application. If you install Relational Rods on a Windows or Mac computer, you can double-click a .relrods file and have Relational Rods open and load that file.

You can also save the files with either the .xml or .txt extension and be able to open them with the tool later on. The xml and txt file types are useful if you want to open the file in another application, like a text editor, or if you are putting the files on a web server.

Operations:
  1. Save
  2. Open
  3. Open from Web
  4. Transfering Files from a Mobile Device to a Computer

Save

The Save File operation is accessed using the Save Button in Settings or by using the keyboard shortcut SPACE+S.
SaveFileMoneyButton.png

Browser or installed desktop Application

Pressing this button will bring up the system dialog with a suggested file name and file type (e.g., .coltiles for the Colour Tiles Tool). It is recommended that you do not change the file type since the Open operation only finds files with that extension (or with .txt and .xml). The suggested file name is based on the date and time of saving and should be unique.


SaveDesktop.png


Android App or iOS App (iPad/iPhone)

Apps use a dedicated Documents directory. Files will be saved by default to the mathies subfolder of that directory.
The suggested file name is displayed in the input text box at the bottom of the dialog. It is based on the date and time of saving and should be unique.
You can also click on a file to copy its name to the input box.
You can, of course, also edit the textbox to supply your own name.
It is recommended that you do not change the file type (e.g., .relrods for Relational Rods +) since the Open operation only works with the expected extension (or with .txt and .xml).
Double-click on a folder to browse its contents.
Press the Save Icon to save the file with the file name displayed. If you supply a valid name it will be used.

FileSaveIOS_New.png


If the file already exists, you will be presented with a Warning Dialog, which allows you to continue the save operation or cancel it.

FileExistsWarning.png


Press "+" to add a subfolder.
FileNewFolder.png

Press "^" at the top left of the dialog, when available, to navigate up to the parent folder.

FileSaveAndroid_New.png
top

Open

The Open File operation is accessed using the Open File Button in Settings, using the keyboard shortcut SPACE+O, and from an icon on some tool's opening screens.
OpenButton.png

Browser or installed desktop Application
Pressing this button will bring up the system dialog which allows you to find the folder in which you have saved the files of the required type (here, relrods).


FileOpenRRWindowsDialog.png


Use the file type dropdown to search for .xml or .txt files. On some systems, you will change the dropDown to All Files to see files that do not have the custom file extension.

Installed desktop Application
There are two other ways to open a file for an installed mathies tool:
  1. Double-click a file of the related type
  2. Drag a file of the correct type onto the tool's window

Android App or iOS App (iPad/iPhone)

Pressing this button will bring up a custom dialog displaying the files and folders available. The name of the current directory is displayed in bold face at the top.
Click on a file to open it in the tool.
Double-click on a folder to open it for viewing.
Use the scroll bar to view more files and folders.
Press "^" at the top left of the dialog, when available, to navigate up to the parent folder.

FileOpenAndroid_New.png

Apple has gone to a lot of effort to have their devices not act like other storage devices. However, each app does have some storage for its documents. The custom dialog will display the files available in the mathies subfolder of this directory. These files are at risk of being deleted when a new version of the app is installed (they should be fine if the app is updated). See the section below for information about how to transfer files from a device to a computer for safekeeping and distribution. Note: Saving files in a subfolder may make them harder to transfer using iTunes.

top

Open from Web

The Open File from Web operation is accessed using the www Button in Settings or using the keyboard shortcut SPACE+SHIFT+O
OpenWWWButton.png

When pressed, it prompts for a valid web address. Press OK once you have entered the address completely.

FileOpenFromURL.png
In order for this to be successful,
  1. "http:" must be used in the address
  2. the file must be on the server
  3. the filetype must be supported on the server - .txt and .xml are pretty good bets, the mathies specific extensions less so
  4. the file must be in a valid format created by the mathies tool
  5. OK must be pressed

If you are using a browser and if the tool and the file are on different servers, you often will get security errors using this method. If so, you should download the file to a local drive to open it.

Advanced:
Web pages generally know how to serve up .xml files. The XML files used by mathies tools have custom extensions, like .moneytool and .relrods. The server admin would need to set up MIME types for these custom extensions in order for the loading to work. You can use a text editor to view these saved files, if they are not compressed, and tweak them if you are brave.
top

Transfering Files from a Mobile Device to a Computer

Android App
Depending on the security settings on your device, you may be able to connect your device to a computer and transfer files back and forth. Check for documentation related to connecting your device in a file transfer friendly mode.

iOS App (iPad/iPhone)

Some mathies apps have File Sharing enabled, and so you can:
  1. Open iTunes.
  2. Navigate to the device and then to Apps.
  3. Scroll Down to the File Sharing section.
  4. Use the Add File and Save to buttons at the bottom right to transfer files.


iTunesSharing.png


For more information on File Sharing, see the Apple Support page


Creating a link that will open the tool with a file (Advanced)

Advanced
You can provide a web link to open a mathies tool in a browser with a particular file loaded using the openFilePath parameter. Take note of the web address that you are taken to from mathies when you open a tool. It will be something like:
http:www.oame.on.ca/mathies/swfPlayer.html?swfURL=tools/RelationalRods1.swf&title=Relational%20Rods+&language=fr
The information after the .html are parameters used to give information to the webpage about which tool to load, what the page title should be and what language should be used.
In order to specify, a file to open, add something like
&openFilePath=http:www.oame.on.ca/mathies/files/examples/RR1.xml
to the end of the address.
If this doesn't work, then there has been some sort of security error communicating between the web servers - generally the server with swfPlayer.html and the server with the file have to be the same or have the necessary crossdomain privileges.
top