for this week i have to do 3 tasks .Below is the tasks given :
1)I have to give the reading of the accelerometer of the device using the application
2) i have to make the application read the longitude and the latitude on the current location of the device
3)I have to get the reading of the gyroscope of the device using application
For the first task i have to give the reading of the device's accelerometer by using application
accelerometer is a device that give the reading of the device that include 3 entries whosekeys are "x", "y", "z" and whose values contain device’s acceleration about the corresponding axes.This component that can detect shaking and measure acceleration approximately in three dimensions using SI units (m/s2). The sign of the acceleration values must be according to the right-hand convention in a local coordinate system (see figure below).
- xAccel: 0 when the phone is at rest on a flat surface, positive when the phone is tilted to the right (i.e., its left side is raised), and negative when the phone is tilted to the left (i.e., its right size is raised).
- yAccel: 0 when the phone is at rest on a flat surface, positive when its bottom is raised, and negative when its top is raised.
- zAccel: Equal to -9.8 (earth's gravity in meters per second per second when the device is at rest parallel to the ground with the display facing up, 0 when perpendicular to the ground, and +9.8 when facing down. The value can also be affected by accelerating it with or against gravity.
so here is the coding on how to get the reading of the accelerometer from our device.
this is the interface that we are going to see on the screen right after the page been opened . so we have 3 rows and 2 columns . In this interface it will give us 3 reading on x axis , y axis and z axis and the value of each axis been initialized to 0.00.The 'test' button is sed to get the treading of each axis if the device change in its direction.
label 4 indicates the reading that will be appeared in x axis .
label 5 indicates the reading that will be appeared in y axis .label 6 indicates the reading that will be appeared in z axis .
so in this coding once we push on the 'test button' the reading from the accelerometer of each axis will be written in the label of each its representative .
For the 2nd task i ave to give the reading of the latitude and the longitude of the device.So as we know in order to get the location of the user e have to know the longitude and the latitude of the user so in order to get it i am using the location sensor that already installed in apps so this is the design of interface
for this screen it will find and load our current latitude and longitude on the device.
for the last task i have to get the reading of gyroscope of the from the application but unfortunately the reading does not appear after a long waiting .
so here the interface of the apps and its coding . i hope that sir can help me with this problem
.

