Here is a small snippet to implement shake detection in Gideros mobile. This is not any sophisticated approach, only measuring if acceleration exceeds provided threshold.

--need accelerometer
require "accelerometer"
--start measuring acceleration

--store last values
local last_x = 0
local last_y = 0
local last_z = 0

--time interval for calculation
local interval = 100
--acceleration threshold
local threshold = 500
--function to detect shakes
local function detectShake()
	-- get accelerometer values
	local x, y, z = accelerometer:getAcceleration()
 	--calculate speed
	local speed = math.abs(x+y+z - last_x - last_y - last_z)/ interval * 10000;
	--check if it exceeds threshold
	if(speed > threshold) then
		--do what you want to do on shake
	--store values
	last_x = x;
	last_y = y;
	last_z = z;
--create a timer to measure for specified period of time
local timer =
timer:addEventListener(Event.TIMER, detectShake)