Exploit Smartphone Sensors for Indoor Navigation
At first, we need to configure some information for using SensInav as a library to other app or customizing the features of this app. For example, to communicate with the remote side server script, HOME_URL must be updated at util/Util.java as below.
....
private String HOME_URL = "_URL_TO_SERVER_SIDE_SCRIPT_";
....
The default value of HOME_URL, a building name, and the lowest and the highest floor of a building can be updated at the settings() method of NavConstructorActivity class.
....
private void settings(){
Intent i = this.getIntent();
if(i.hasExtra("URL")){
String url = i.getStringExtra("URL");
Util.getInstance().setUrl(url);
}
.....
if(i.hasExtra("BUILDING_NAME")){
String bn = i.getStringExtra("BUILDING_NAME");
MapInfo.getInstance().buildingName = bn;
......
}
if(i.hasExtra("LOWEST_FLOOR")){
fromFloor = i.getIntExtra("LOWEST_FLOOR", 0);
}
if(i.hasExtra("HIGHEST_FLOOR")){
toFloor = i.getIntExtra("HIGHEST_FLOOR", 30);
}
}
....
The default value and threshold for the walking step distance are 0.6 meter and 0.8 meter, respectively. On the otherhand, the threshold value for gyroscope reading is 1.0f. However, these values can be updated according to the following code segment.
....
MapInfo.getInstance().STEP_DISTANCE = _NEW_VALUE_;
MapInfo.getInstance().STEP_THRESHOLD = _NEW_VALUE_;
MapInfo.getInstance().GYROSCOPE_THRESHOLD = _NEW_VALUE_;
....
Moreover, appearances of the map can be changed by updating the colors, strokes at init() method of mapview/MyCanvas.java class.