Adding demo activity and gateway parsing functions from Noah Branch