Many visitors to Palestine and other countries need information about the buildings specially Archaeological
buildings while they passing beside it at their round, For this information they should ask Tour Guide or peoples, at many
times they didn't find answers for their questions, this paper will propose System (android application) to solve this problem.
The only thing should the visitor do is to direct his mobile towards the building to get the information about it. The application
will work as compass to determine the mobile direction using the Orientation sensor, in addition it will Determine the
longitude and latitude after accessing location APIs, then use the direction and GPS location to determine the building that
user direct his mobile towards using a new algorithm this paper will propose.
2. APPLICATION BASICS
The application based on two basics :
Determine the mobile direction .
Determine the longitude and latitude after
accessing location APIs in the package
android.location .
3. DETERMINE THE MOBILE DIRECTION
Android devices have built-in many types of sensors
The Android sensor framework uses a standard 3-
axis coordinate
You can access sensors
available on the device and
acquire raw sensor data by
using the Android sensor
Framework which is part of
the android.hardware package.
4. TYPE_ORIENTATION SENSOR
In our application we need
TYPE_ORIENTATION sensor which is a sensor
Measures degrees of rotation that a device makes
around all three physical axes (x, y, z) to
Determine device position.
available in all android platforms (Android1.5
(API Level 3) to Android 4.0 (API Level 14))
determine a device's position relative to the
magnetic North Pole.
5. CONT..
The orientation sensor return multi-dimensional
arrays
SensorEvent.values[0] Azimuth (angle
around the z-
axis).
SensorEvent.values[1] Pitch (angle
around the x-
axis).
SensorEvent.values[2] Roll (angle
around the y-
axis).
8. ANDROID MOBILE LOCATION
Android has two types of location strategies GPS
and Android's Network Location Provider.
GPS is most accurate, but it is only works
outdoors.
Android's Network Location Provider
determines user location using cell tower and
Wi-Fi signals, providing location information in a
way that works indoors and outdoors,
responds faster, and uses less battery power.
The developer can use both GPS and the
Network Location Provider, or just one.
9. GPS
Our application need to Determine the longitude
and latitude after accessing location APIs in the
package android.location
10. CONT..
In order to receive location updates from
NETWORK_PROVIDER or GPS_PROVIDER, we
must request user permission by declaring
either the ACCESS_COARSE_LOCATION or
ACCESS_FINE_LOCATION permission,
respectively, in our Android manifest file.
As we will use GPS_PROVIDER in our
application we need
ACCESS_FINE_LOCATION permission :
<uses-permission
android:name="android.permission.ACCESS_FINE
_LOCATION
" />
11. •the name of the provider
• the minimum time
interval for notifications
in milliseconds
• a callback method that
the Location Manager calls
when the user location
changes
•the minimum distance
interval for notifications,
in meters .
12. THE IDEA LIFE CYCLE
Many inputs and no results out tracks
15. THE FINAL IDEA
How can I Combine location and Direction to
Detect BZU Buildings Using Android Devices.
The idea of detecting the building which the
user directed his mobile towards is:
Dividing the map into 25 squares .
Rearrange buildings relative to the user location
depending on the fact that (As you go north of the
equator the latitude increases and As you go east
from the prime meridian the longitude increases)
Compute the priority for the buildings
16. STEP1
25 square = 5*5 matrix
READ FROM TXT FILE:
( 6 ) longitudes
( 6 )latitudes
Find column , row
Square = area[row][column]
retrieve all buildings in that
square
increase
decrease
E
S
17. STEP2
MyLongLong
if (Mylong >= Long) {
if (MyLat >= Lat) )
relative_Location = 2;
// 2 south west
else
relative_Location = 3 ;
//3 north west
}
Else
if (MyLat>= Lat ) {
relative_Location = 1;
//1 south east
else
relative_Location = 0 ;
//0= north east
18. STEP2
X =|MyLong – Long1|
Y =|MyLLat – Lat1|
∂ = tan -1
(x/y)
I have degree from sensor
AS the user directed his
mobile towards SE
B = 180 - degree
Difference1 = |B - ∂|
MyLong Long1
MyLat
19. CONT..
X =|MyLong – Long1|
Y =|MyLLat – Lat1|
∂ = tan -1
(x/y)
I have degree from sensor
AS the user directed his
mobile towards SE
B = 180 - degree
Difference2 = |B - ∂|
chose MIN(Diff1 , Diff2)