Developing Android Application 4
Weekly Review:
I suggested to concentrate on developing a puzzle game as our main project. I came to such conclusion due to several reasons:
1) Being able work with databases(basic knowledge enough)
2) Easy to peak up an idea(We can find the type of puzzle game for instance from old books)
3) Working with graphical interface
My proposal was declined and we come to decision to create unique application which uses android sensors. From official website I read about position and monitor sensor:
Motion sensor - accelerometer, gravity, gyroscope, linear acceleration and rotation vector sensors are used for monitoring device movement such tilt, shake and rotation. For instance by using accelerometer, I constructed an app which by shaking it you can change the background color. I wrote simple xml interface for changing background and MainActivity.java class I initialized SensorManager variable which is responsible for initializing the type of the sensor. We should consider more about activity life-cycle here rather than on standard application. So, we should include on onPause, onResume and OnStop function. Only using data from accelerometer is not enough, we should write physical formulas to gain our goal. In my case, I used three type of accelerations(accel. in x, y and z axis) which is provided by my accelerometer sensor. Then, I used such formula - "(x^2+y^2+z^2)/(earth gravity)^2" to detect how much force was spent to shake it. If it is more than 200, it changes the background color to green or red.
By Dr. Ulrich proposal we decided to develop a game where you need to draw a sign or figure with your phone(on air not on screen). Later with our team, we decided to develop a labyrinth game where you need follow your map(given on screen of phone) by moving with your two legs.
Comments