Friday, 26 August 2016

Live coding support added to Ionic Creator

Ionic Creator is great for rapidly putting together an app prototype, and the export facility (which allows you to export your app skeleton so you can pick it up and turn it into a full featured app) is a very nice touch.

The team at Ionic have now added live coding to the mix, which increases the utility of Creator by allowing you to add more complex behaviours, access UI components that aren't available for drag and drop within creator, and even integrate third party MBaaS solutions such as Google's Firebase.

I've only spent a few hours with this latest incarnation of Creator, but one of my favourite features so far is support for specifying Angular directives at a UI component levels - sorting lists just got a whole lot easier. ;)

There's more in this excellent walk through where Matt Kremer builds the obligatory todo app in Creator, while leveraging Firebase as a back end.

Wednesday, 29 June 2016

Locking your Windows PC based on the proximity of your phone, using Tasker, AutoRemote, EventGhost and a beacon.

Locking your PC with your phone

There are a number of paid software solutions on the market that you can use to lock and unlock your PC using your phone, and the upcoming Microsoft Companion Device Framework is likely to ensure this becomes a mainstream activity in the near future.

Device unlocking is a little tricky in recent versions of Windows, but locking the device is much simpler and can be accomplished using a few readily available bits of software. While pressing a button on an app provides a nice demo, the ability to lock the machine based on the presence (or more accurately absence) of the user's phone is much cooler. :)

The following tutorial gives step-by-step instructions on setting up such a proximity locking system and it doesn't feature any coding; it uses open source components and a couple of inexpensive Android apps to get the job done. 

Note the solution described below should be treated as a proof of concept only and is not intended to form part of any production-ready security solution. 

As always, I'd love to hear your feedback. If this has proven useful or instructive, or you've spotted any errors or omissions, please feel free to leave a comment below.

Setting up your PC

Download and install EventGhost. EventGhost is a tool that enables us to run tasks, known as macros, on a Windows PC. We'll be setting up an EventGhost macro that locks our PC and triggering it remotely from our phone.

Download and install the AutoRemote EventGhost plugin, following the instructions here.

Install Google Chrome if you haven't already done so.

Install the chrome extension for AutoRemote. This will allow AutoRemote to use Google Cloud Messaging for message delivery, which is likely to be more reliable than direct messaging between AutoRemote and EventGhost.

Create an EventGhost macro to lock your workstation, as described here (note that you could alternatively use EventGhost's built in "Lock Workstation" macro [Select the "Add Macro" item from the toolbar or Configuration menu then select System -> Power Management -> Lock Workstation -> OK] as a substitute for the macro creation step in the instructions, the rest of the instructions still apply).

Attach a beacon of your choice to your PC, or place one nearby. Alternatively, you can use a software based beacon, some examples of which are discussed in this StackOverflow thread. I used a Radius Networks RadBeacon USB, which is my go to beacon for USB based deployments because it's reliable and versatile (it supports iBeacon, AltBeacon, and Eddystone out of the box).

Setting up your Android device

You'll need to download and install the following apps from the Google Play Store (UK pricing is stated for paid apps in the list below):


Set Chrome up as a Device in AutoRemote, which will enable GCM messaging. This video tutorial demonstrates how to do this.

Set up Tasker

Create a Variable (see screenshots)

We need to create a variable, which I've called "%PROX", note that Tasker variables are prepended with the percent symbol, and global variables must begin with a capital letter.

Our new variable - %PROX

Configure a Tasker profile

We need to execute some logic on a recurring basis to check the current proximity of the PC, and lock the PC if the phone is too far away. A limitation of Tasker is that timed jobs can be run no more frequently than once every 2 minutes, but we can get around this by creating two profiles; one that runs on the hour and at every two minutes thereafter, and another that runs at one minute past the hour and every two minutes thereafter. Each of these jobs calls the task that we're about to create in the following step...


Create profile number 1...
...then profile number 2.
Configure profile run timing.


Create a Tasker task

The task makes use of conditional logic - it checks whether the phone is in close proximity to the PC (well, technically the small USB beacon connected to the PC). If the phone and PC aren't in close proximity control passes to a sub-task that uses the AutoRemote plugin to send a message to EventGhost on the PC (via Google Cloud Messaging), which results in a macro being executed that locks the PC.

Create a task...
...then edit the task and add conditional logic.




















There's a good tutorial on using conditional logic for flow control in Tasker here,

Configure Beacon Scanner and Logger:

You can theoretically query Tasker's in-built BTNear state to determine the proximity between your phone and a bluetooth device, but in practice I found this to be unreliable. Additionally, at the time of writing Tasker displays a warning message when you try to configure BLE connections, stating that BLE support is currently experimental and somewhat "buggy". 

In light of the above, I decided to use my own Beacon Scanner and Logger app, as it allows greater control over the scanning interval and features support for realtime logging (thanks to David Schmid for initially requesting I implement the realtime logging feature).

We need to ensure realtime logging is switched on, which will enable Tasker to check the current proximity status of the phone by querying a text file which is regularly written to by the app. We can optionally also set the background polling frequency of the app, to ensure scanning happens regularly when the app is not in the foreground.

To set these parameters we need to access the Settings menu, which is found on the top right of the screen on my phone but may be placed differently depending on the device you're using. Scroll to the bottom of the Settings list to find "Realtime Logging" and tap the checkbox to enable the feature. You may want to uncheck all but "Proximity" in the "Beacon Properties to Capture" section, as this will ensure less data is written to the file and make it easier to see what's happening in the Tasker log. As mentioned, you can also tap the "Scanning Interval" section to see a list of available values and select your preferred option.

Enable Realtime Logging
Configure Scanning Interval

When you're ready to go, you can return to the main screen and toggle the "Start Scanning/Stop Scanning" button as required. Note that the realtime logging file will only contain the item at the bottom of the scanning list, so you can stop scanning at any time if the test value you want to use is the last element shown on screen.

Start/Stop Scanning









Some potential next steps:

The solution above assumes there's only one beacon in range and that beacon is the one attached to your workstation, but in a real world scenario it's likely you'd be in an environment with multiple beacons. You could edit the "If" step of your Get Proximity task to also test for the UUID, major and minor values of the detected beacon, which would effectively filter out all but the beacon you're interested in and prevent your PC locking when it came within range of beacons other than your own. 

If you're comfortable developing mobile apps, or want to give mobile app development a try, you could remove the requirement to use Tasker and AutoRemote completely by building your own app. EventGhost features a basic webserver plugin, which means you can invoke a macro via a simple HTTP request. If you're interested in trying this out for yourself, you'll find further detail regarding the EventGhost webserver plugin here.





Wednesday, 6 April 2016

Visualising Salesforce and Google Analytics Data with Tableau - Initial Impresssions

There seems to be a lot of interest around Tableau at the moment and, having recently taken a close look at Microsoft's Power BI as part of an IoT proof of concept, I thought now would be a good time to investigate Tableau's offering.

Initial impressions are very good. I signed up for Tableau's 14 day free trial, downloaded the desktop client and was soon browsing for interesting sources of data.

Tableau supports an impressive range of file and server types out of the box so it's likely your data bucket of choice is supported. Establishing a connection is simple, just select the connection type and Tableau prompts you for the credentials it needs to access the data source.

I started by exploring our Salesforce instance and within 10 minutes had connected to the back end, selected some objects of interest and generated some nice filtered visualisations, showing the relative sizes of potential opportunities. This is obviously just scratching the surface of what's possible but was impressive nonetheless, both in terms of the final result and ease of use.

I then plugged in to Google Analytics. After popping my credentials into the standard Google OAuth form I was presented with a list of the Google Analytics properties associated with my Google Account. I selected the property associated with this blog and was then able to select the data I wanted to visualise. I thought it might be nice to get a packed bubble chart showing the number of blog visits for the last calendar year, grouped by country, and once I'd filtered out those countries having fewer than 10 visits I was left with the result shown below.



Tableau allows you to share charts in a variety of ways, including good old fashioned printing, PDF export, and image export as used above. There's also the option of combining visualisations to produce dashboards, and to subsequently share these using Tableau Online. This is next on my to do list. :)



Thursday, 5 November 2015

Future Decoded 2015 - now with iBeacons?

Belfast's Scaboodle today announced via Twitter that they are providing the official delegate's app for Microsoft's prestigious Future Decoded 2015 event:

You can read my write-up of last year's event here if you're interested.

On launching the iOS version of app I was informed that it could make use of iBeacons, I was asked if I was OK with this and given the option to decline. I'm guessing no-one puts a notification like this in for the fun of it, so it seems reasonable to assume there will be some beacon based functionality on offer at the event. I'm attending the tech day on Wednesday 11th November and I look forward to finding out whether the app provides location specific content, indoor location, or something entirely new and unexpected.

It's great to see Microsoft engaging with specialist partners and ISVs such as Scaboodle, rather than doing this work in house, or engaging with one of the large SIs. Here's hoping the event is a success for all involved.

Thursday, 3 September 2015

Version 1.5 of Beacon Scanner and Logger (Free) is here - now featuring Eddystone support

Version 1.5 of Beacon Scanner and Logger (free) is now available on Google Play.

The app now supports Eddystone, and where an Eddystone-URL beacon is detected the URL is rendered as a clickable link, which means you can immediately open the web resource the beacon is directing users to.

There's a new real time log file, which has a fixed name and only ever contains a single entry, that enables simple Tasker integration. This is a feature that's been requested by a couple of users so I hope it's useful to a wider audience.

Source code is available via GitHub.

If anyone has any feature requests, bug reports, or comments please let me know.

Happy scanning. :)

Monday, 3 August 2015

End to end iBeacon demo, featuring hybrid (Cordova) mobile apps and Google app engine backend.

I wanted to put a demo together, using hybrid mobile apps and a Google app engine backend, that would allow me to configure beacons and interactions at runtime, rather than coding them into the app itself.

I implemented a set of 3 demo applications that can be used to capture data describing a fleet of beacons, and configure each beacon record so that a message of the user's choice is displayed when one of the apps encounters the relevant beacon.

Here's a brief overview of the components:

1) admin-app - a Cordova app that allows a user to capture data representing a fleet of beacons and save it to persistent storage. Storage in this case is handled by Google app engine, with a Cloud Endpoint providing the API.

Select your beacon from a list, or add a new beacon...
Enter or edit beacon properties (note the "Message" field - this contains the message
that will be displayed by the interactive beacon app when a beacon is detected).
2) bbepoc - code that will be used to generate a Google Cloud Endpoint which will be used by the 
mobile apps to add, edit and retrieve beacon data.

3) beacon-app - a Cordova app that loads any beacons added via the admin app. On encountering a beacon the app will display whatever message the user entered against the beacon in the admin app; this could obviously be extended to handle other types of interaction, such as showing an image or playing a video.

Here's the interactive beacon app, branded for Objectivity,
displaying a message configured via the admin app. 

Source code and instructions for use can be found in the project's GitHub repository. Comments and suggestions are welcomed.

Thursday, 23 July 2015

A First Look at Eddystone

I received my Eddystone Developer kit from Radius Networks today and was particularly keen to experiment with Eddystone-URL.

The developer kit ships with 3 beacons, 2 RadBeacon USB beacons and 1 RadBeacon Dot. Configuration is handled via the RadBeacon app, which is available for iOS and Android via the App Store and Google Play.

At the time of writing the iOS version of RadBeacon doesn't discover Eddystone compatible RadBeacons, but Radius Networks confirmed via Twitter that Android was a priority and iOS support is imminent.

The RadBeacon app contains help information that describes how to put the USB beacons into configuration mode though it doesn't currently describe how to achieve this with the RadBeacon Dot, fortunately this article on Radius Networks' support site describes the process (thanks to @CraigTaylor74 for helping with this via Twitter).

I had a few false starts configuring the beacons, and found the RadBeacon app didn't always recognise the RadBeacons, initially listing them as "Unspecified Beacon". We're close to day 1 of Eddystone availability though so the odd quirk is to be expected.

I was soon able to get up and running and after configuring the URL property of the beacon and applying the changes the beacons were happily chirping away and transmitting Eddystone-URL frames.

The quickest way to interact with your new Eddystone-URL service is to download Chrome for iOS and enable the Today widget. See this post on the Chromium blog for details.

David G. Young has detailed the full process over on the Radius Networks' Developer Blog, work through the process as described (take note of the tip on using a URL shortener) and you can't go far wrong.