1300 223 482
CSA
Cheaper Citrix Licensing



Licensing Guarantee

XAFacePunch - Citrix XenApp Digital Punch Card Time Clock in the Palm of your hand.

XAFacePunch is a mobile device enabled utility that can be incorporated into custom windows based software, such as a timesheeting ERP system that is running centrally through a Citrix XenApp 6.5 or higher server. As the name of this program loosely suggests, XAFacePunch, is a Timesheet PUNCH CARD for mobile users and allows a mobile device and its features to serve as an electronic version of the traditional punch card. This program, when incorporated into a custom timesheeting program, can provide an organisation with electronic tracking of an employee through a graphically represented punch card that includes information, such as the time, date and GPS co-ordinates. To ensure an employee is where they say they are, XAFacePunch embeds this information into a live photo of the employee or their location as they submit their punch card from any location where a mobile/ cellular signal is available.

The idea behind this application is that as a mobile employee arrives at a customer site, they use XAFacePunch to "Punch in" or "clock in" to the company's central timesheeting system. XAFacePunch then provides a real-time photo of the employee, with the embedded information of current GPS co-ordinates time and date, as well as the username that the employee logged onto the system with. Upon leaving the site, the employee then "Punches out" or "Clocks out" in the same manner.

The code provided in this public release of XAFacePunch is a working example of the process described above. In providing this program however, we have omitted from the final code the section which sends the photo with the embedded information to the central ERP system. This was simply done by transferring the embedded photo into an email using SMTP code and an SMTP Server located within the company's infrastructure. As the photo is saved on the Citrix XenApp Server and not on the mobile device, the corporate SMTP server can be used without opening the server for external access.

The full version of this application is actually being used in a commercial environment and has proven invaluable for employers to keep track of mobile workers, essentially providing evidence that an employee is where they say they are. This application is also being used without the integration of an ERP system, and simply provides an employer photographic and GPS evidence of where an employee is at any time they request it. In this instance an employer contacts the mobile employee and requests a "Punch Card" of where they are at that time. The employee then uses XAFacePunch to submit the information, again via an SMTP server located within the company's infrastructure. With the combination of the photo, the GPS co-ordinates, and the time and date, the employer can be confident that the employee is where they say they are.

The next stage is to work on some facial recognition software that can further analyse the photo once received and confirm the photo matches the user based on a company database. This has been requested of us to include, however it may be a little beyond us at this stage.

Yes Big Brother is truly watching.

This program could be modified for other applications such as the case of Ambulance workers, where a patient is in need of medical attention and using the embedded image and GPS location provided by this program, the information rich photo could be sent to a central database and distributed to Ambulance workers for rapid deployment and preparation of the situation. There are many other applications if you think outside of a time keeping program.

You must install the Citrix Mobility Pack as detailed at http://support.citrix.com/proddocs/topicxenapp65-mobility-packps-mobility-pack-install.html

This utility is FREEWARE and was written by Warren Simondson of Ctrl-Alt-Del IT Consultancy, Australia.

www.ctrl-alt-del.com.au

This program and the code may not be reproduced for profit.

SDK's used in this program:

Citrix MOBILITY SDK - http://community.citrix.com/display/xa/Download+SDKS
Microsoft Windows 2008 SDK - http://msdn.microsoft.com/downloads

IN NO EVENT WILL CTRL-ALT-DEL IT CONSULTANCY BE LIABLE TO YOU FOR ANY GENERAL, SPECIAL, INDIRECT, CONSEQUENTIAL, INCIDENTAL OR OTHER DAMAGES ARISING OUT OF THIS PRODUCT.

Comments

Your comments or questions are more than welcome for this topic. Comments can be posted on the Citrix Community Mobility SDK forum or you can use our Ctrl-Alt-Del IT Consultancy web form to ask questions directly.
We hope that this page is of great assistance to you.

The Application

System Requirements

Download
Download the Executable for XAFacePunch here (VS10 C++ compiled):
XAFacePunch.zip

Instructions for Use

  1. Download XAFacePunch.zip from Ctrl-Alt-Del IT Consultancy
  2. Unzip the file into the desired directory on your Citrix XenApp 6.5 Server. The program is a single executable and is not an install package so it can be run immediately after copying to your system
  3. Ensure Microsoft Visual C++ 2010 Redistributable Package is installed.
  4. Ensure Citrix Mobility Pack is installed.
  5. Publish XAFacePunch.exe via the Citrix Access Console, selecting the approriate users to delivery the application to.
  6. Once the application is published, connect your mobile device to the Citrix Receiver configure to point to your Web Interface site or Service site. Launch the application as show below.
  7. Please note: For the camera to work correctly you must enable access to the SD card on the mobile device via the citrix receiver otherwise the error code 0x0000002c will occur. The error code 0x0000002C equates to CMP_ERROR_CLIENT_DRIVE_UNAVAILABLE in the cmpenum.h include file. This error code means that that the device is currently not supporting client drive mapping (CDM). By default, this is what the Citrix Receiver does. In order to change the default, you need to run Receiver and select settings. Follow these settings for your OS version:
    • Android: Press the menu button and then select "Session Options". The first item should be "SD card access". Change this setting to either Read or Full access. Read access should be enough but you might want Full access if you want the application to store files on the Android SD card. The reason for this is that Receiver saves the image to the SD card for the application to pick up using CDM.
    • IOS: Press the settings button. Select Advanced and then turn on "Shared Documents" (aka client drive mapping) which is needed to transfer the pictures from the receiver to the Citrix server.
    Also make sure the Mobility option and client drive mapping are enabled in the Citrix Group Policy.
    Thanks to Jeff Muir of Citrix Systems for this.
  8. Additional Note: Turn off that annnoying Special keys option whilst you're in the Citrix Receiver Options.
  9. Please Note: obviously the camera of the mobile device is important here. However the picture taken by a mobile device could end up being around 1 - 3 Mb in size on average, which could take some time to travel from the phone back to the XenApp Server. To date there is no way that you can reduce the size of this image via the Citrix Mobilty SDK.

XAFacePunch Example

Designed to provide a digital Punch Card Time keeping Device from Citrix XenApp 6.5 and your mobile device (with Camera and GPS), this little program will provide a simple, mobile method for performing such a task. Using the Citrix Receiver on your mobile device, this application can provide a company with an instant update on the location of a user with photographic and GPS location evidence of the persons location. Launch the application from the Citrix Receiver for your mobile device and the rest is easy.

XAFACEPUNCH has been designed to run on virtually all Mobile devices, with some features not available on some devices. A camera and GPs capabilities must be available on the device. As an employee, just have mobile device at the ready, lauch the application and wait for the main screen to appear.

XAFacePunch Example
XAFacePunch Example

When the application is available, Press the "TAP here for PHOTO" button.

After pressing the button, the device's camera will appear. Take a photo of yourself and when you are happy that the picture is acceptable, press Done on the Camera. You will be returned to XAFACEPUNCH where the image will begin processing.

XAFacePunch Example
XAFacePunch Example

During processing, the device will request permission to determine your location. Press ALLOW to continue.

The device will continue to process the image. There can be some delay due to the image size. If your device is using a slow connection, this process make take several minutes. In some cases the GPS location information will also be unavailable, leaving the GPS location blank.

XAFacePunch Example
XAFacePunch Example

Once processed, the application will display the image which you took with your camera. Within the image, information containing your username, the current date and time and your GPS location will be embedded into the picture.You can view this picture on your device. The next stage, which is not included in this example, is to send the picture as an email via an SMTP server (located within the company infrastrcuture) to an ERP system or just simply to the Time Keeping person at the company, for further processing.

That's right, no more old sytle punch clocks anywhere in sight!

XAFacePunch Example

The Code

System Requirements

Download
Download the source code for XAFacePunch here (VS10 C++ compiled):
XAFacePunch_src.zip

Tips of Programming with the Mobility SDK
The following are some tips that I found may help everyone as they write their first app using the Citrix Mobility SDK. These tips are based on coding your application in Win32 or MFC using Micrsoft Visual C++.

Key Areas
The key area to this application is retrieving the GPS co-ordinates from the mobile device using the Windows Location API. The following subroutine is the primary code that allows the application to retrieve this information through the Citrix Receiver.

The code listed below outlines the sub routine.

/********************************************************************
*
* GETLOCINFO
*
* Get user information from system
* ENTRY:
* none
*
* EXIT:
* nothing
*
********************************************************************/
void GETLOCINFO () {

// Location API Code - with thanks to http://www.mapping-tools.com

// our location specific private data members
LOCATION_REPORT_STATUS status;
double lfCurLat, lfCurLng; //variable for Longitudw and Latitude
TCHAR tmp6[MAX_PATH]; //temporary string

// Define our report objects
CComPtr spLoc; // This is the main Location interface

// These store the reports we request from spLoc
CComPtr spLocationReport; // This is our location report object
CComPtr spLatLongReport; // This is our LatLong report object

//init vars
memset( &tmp6, 0, sizeof(tmp6) );
_tcscpy(tmp6, _T(""));

// Create the Location object
status = REPORT_NOT_SUPPORTED;
if (SUCCEEDED(spLoc.CoCreateInstance(CLSID_Location)))
{
// Array of report types of interest.
// Civic addresses/etc also supported
IID REPORT_TYPES[] = { IID_ILatLongReport };

// Request permissions for this user account to receive location
// data for all the types defined in REPORT_TYPES
// The final parameter (TRUE) indicates a synchronous request
// use FALSE to request asynchronous calls
if (FAILED(spLoc->RequestPermissions(NULL, REPORT_TYPES, ARRAYSIZE(REPORT_TYPES), TRUE)))
{
AfxMessageBox("Warning: Unable to request permissions.\n");
} else {

// Get the report status
if (SUCCEEDED(spLoc->GetReportStatus(IID_ILatLongReport, &status)))
{
//if you really want to know the status of the location services report - add this
/*
switch (status) // If there is an error, print the error
{
case REPORT_RUNNING:
// If the status for the current report is running
AfxMessageBox("Report received okay");
break;
case REPORT_NOT_SUPPORTED:
AfxMessageBox("No devices detected.");
break;
case REPORT_ERROR:
AfxMessageBox("Report error.");
break;
case REPORT_ACCESS_DENIED:
AfxMessageBox("Access denied to reports.");
break;
case REPORT_INITIALIZING:
AfxMessageBox("Report is initializing.");
break;
} //switch
*/

// Get the current location report (ILocationReport) and
// then get a ILatLongReport from it
// Check they are are reported okay and not null
if ( (SUCCEEDED( spLoc->GetReport(IID_ILatLongReport, &spLocationReport)) )
&& (SUCCEEDED( spLocationReport->QueryInterface(&spLatLongReport)) ))
{
lfCurLat = 0;
lfCurLng = 0;

// Fetch the latitude & longitude
spLatLongReport->GetLatitude(&lfCurLat);
spLatLongReport->GetLongitude(&lfCurLng);

// Format them into a string for display
_stprintf(_T(tmp6), _T("Lat: %.6f, Lng:%.6f"), lfCurLat, lfCurLng);
_tcscpy(nfoStr3, tmp6);

} //if succeeded

} //if Succeeded
} // if failed
// We have completed our call
} //if succeed
return;
}

Comments

Your comments or questions are more than welcome for this topic. Comments can be posted on the Citrix Community Mobility SDK forum or you can use our Ctrl-Alt-Del IT Consultancy web form to ask questions directly.
We hope that this page is of great assistance to you.