Chris Gill describes two phone apps he has created to help in the home workshop. The apps are designed to run on the phone operating systems (Android, Windows) or in a standard desktop browser. The apps are Geometry, which handles several calculations in plane geometry and MetalBender, which makes calculations for using a bending brake.
As explained below, these apps are not available through app stores but source code and debug versions of the Android and Windows Phone installers are available from www.model-engineer.co.uk/apps. This note also explains how to build the apps or derivatives that might be based on the code.
I am making the code available under the MIT license choosealicense.com/licenses/mit/. In brief, the code can be copied, modified or reused as long as the license and copyright are preserved. There is no implied warranty but if problems are found, please report them through the forum.
When opened, each app presents itself as a simple form with buttons to perform the main operations – Calculate, Reset and Help. The apps have been designed to run best in landscape mode and in most cases, do not require any scrolling (other than on the help pages). To achieve this, the buttons are at the top.
Fields with a grey background are not user editable and only fields with a non-zero value are treated as inputs. Fields containing zero are calculated if appropriate. For example, if the radius of a circle is entered but the diameter is left as zero, it will be calculated and vice versa.
Pressing Reset clears the visible fields on the current tab, but other tabs are unaffected.
Both apps are self-documenting – pressing the Help button displays a page describing the usage of the app. As far as possible, accessibility guidelines have been followed although this may not be evident on a phone or tablet.
The Geometry app performs a collection of geometrical calculations often encountered in a workshop. The calculations and their required fields are described in the help text and are summarised below. Each type of calculation has its own tab:
The circles tab is shown in photo 1.
By default, all results are calculated to 3 decimals. This can only be changed by altering the code – look for the line “var dps = 3;” in geometry.js (see notes on source code below).
The Metal Bending app calculates the position of the clamp plate and hinge for using a bending brake that might be found in the home workshop. This is not suitable for industrial bending machines.
The calculation requires a “K factor” that depends on the metal being used. However, this factor isn’t well defined and, in industry, can vary from one workshop to another. The app uses a table of commonly used defaults, but these can be updated by the user. The help page explains the calculation in more detail.
The main screen is shown in photo 2.
By default, all results are calculated to 1 decimal place. This can be changed through the user interface (on the settings page).
The app stores the number of decimals and the table of K values in local storage and should not need any special permissions. Data is stored in JSON format.
As described below, I have built debug versions of Android and Windows apps but I have only tested the Android version. For anyone with a suitable developer accounts or build environment it should be possible to build full release versions and the iPhone version as well.
Since the code doesn’t rely on any phone-specific features, it should also run without modification on all modern browsers. I have tested it on Firefox, Chrome and Internet Explorer although you may have to allow scripts to run.
Each app has a similar structure, consisting of the following files:
The source code can be maintained in any development environment and several of them allow apps to be built for specific phone operating systems. Examples include Visual Studio with Xamarin, Eclipse or Mono. However, it can also be edited in a simple text editor such as Notepad++, which provides a degree of syntax checking.
A disadvantage of using a locally installed development environment is that the target platform SDKs must also be loaded, and these can be onerous, particularly if multiple targets are to be supported.
An alternative is to use an online build environment and the attached apps were built with PhoneGap Build (build.phonegap.com). This builds apps for Android, Windows Phone and Apple iPhone without needing to install anything on the host system. An Adobe logon is required but there is no fee for non-commercial users.
PhoneGap Build allows the user to build one project if uploading a zip file or several projects if they are linked to open-source GitHub repositories. The zip files associated with this article are in the correct format for uploading to PhoneGap Build. PhoneGap rebuilds the app whenever the source code is uploaded and, once built, the installable files can be downloaded.
If you have a developer account on an app store you can up-load the associated developer key. Without this key, you will only be able to build debug versions of Android and Windows Phone apps although this should not affect their operation and would allow remote debugging if developer mode is enabled on the phone (on Android, at least).
Apps that aren’t available from an app store have to be installed in a different way. On Android, there are two options for “side loading” an app:
You will probably need to enable “Unknown sources” in the security settings. Both apps have home page icons.
I have only been able to test the Android versions of the apps on my phone. They were very easy to install by emailing them to my gmail account. The only issue I found was that to see the tabs in the Geometry App the phone must be in ‘landscape’ mode. Thanks to Chris for these useful workshop apps.
Want the latest issue of Model Engineer or Model Engineers' Workshop? Use our magazine locator links to find your nearest stockist!
You can contact us by phone, mail or email about the magazines including becoming a contributor, submitting reader's letters or making queries about articles. You can also get in touch about this website, advertising or other general issues.
Click THIS LINK for full contact details.
For subscription issues please see THIS LINK.