Here is the logic. You have to have some basic understanding of App Inventor. The most important thing is that App Inventor lets you develop mobile apps for the Android platform without writing any code using programming languages. Instead you create your apps by dragging and dropping components on screen.
Here is a video on App Inventor. Go to http://appinventor.mit.edu for more info