Iphone camera (4g) with motion detector

I’m thinking about the possibilities on how to use an iphone as a security camera. The solution has to include this:

  • Using an iphone’s camera
  • The iphone only has 4g
  • The camera must only record if there is a motion detection

Thanks in advance!