Android based distributed tracker application LOG LIFE

tibburfrogtownΚινητά – Ασύρματες Τεχνολογίες

14 Δεκ 2013 (πριν από 3 χρόνια και 8 μήνες)

162 εμφανίσεις

Android  based  distributed  tracker  application
 
LOG  LIFE
 
by
 
Ameet  Chhatwal
,  Anup  Ahire,  Abhishek  kamble
 
Project  Description:
 
We  developed
 an
 
android
-­‐
based  distributed
 
application,  which  is  analogous  to  a  tracker  application.  Our  
application  named  LOGLIFE  als
o  adds  innovative  feature  of  maintaining  the  log  of  all  the  places  visited.  It  
also  has  a  feature  to  locate  the  current  position  on  Google  map.  The  log  is  saved  in  the  form  of  readable  
complete  address  and  the  time.  The  application  takes  input  from  user  ab
out  the  minimum  time  and  
distances  the  user  want  between  two  log  entries.  So  the  application  is  very  much  flexible  and  scalable  
according  to  user  needs.  The  application  uses  the  GPS  chip  inside  the  device  to  take  location  in  terms  of  
geographical  coordinat
es  that  is  longitude  and  latitudes.  
 To  convert  the  coordinates  into  readable  
address  we  establish  contact  with  Google  server  with  appropriate  rights  and  get  the  readable  address  
and  depending  on  the  user  input  maintains  the  log.    The  log  is  being  saved  on
 the  SD  card  (memory)  
inside  the  device.  
The  process  of  retrieving  the  location  of  a  place  is  termed  as  location  based  services  
and  
the  process
 of  getting  the  readable  address  is  called  reverse  geo  coding.  
The  application  uses  
Google  map  API  to  show  locati
on  on  map.  The  application  also  provides  a  user  friendly  simple  user  
interface  design.
 
Analysis  of  1st
 research  paper:
 
 Title:  Research  on  Mobile  Location  Service  Design  Based  on  Android
 
Authors:
 Xianhua  Shu,  Zhenjun  Du,  Rong  Chen
 
Analysis:    This  research  
paper  gives  detail  about  android  Architecture  that  can  be  used  for  location
-­‐
based  services.    It  describes  android  architecture  layers  such  as  application  layer,  application  framework  
layer,  libraries,  android  runtime  layer,  and  Linux  kernel  in  great  depth.
 
 
Android  architecture  layers:  
 
1]  Application  layer:  
 
Application  layer  includes  set  of  core  applications  such  as  email  client,  SMS  application,  map
-­‐
 
application,  web  browser  etc.  All  applications  are  written  using  JAVA  programming  language.
 
2]  Applicatio
n  Framework:  
 
The  application  architecture  is  designed  to  simplify  the  reusing  of  all  components.    Application  
framework  is  also  called  
as  core  applications,  which
 comes  with  android  package.  Activity  manager,  
Window  manager  content  providers,  view  systems
 are  some  of  the  examples  of  application  framework.
 
 
 
3]  Libraries:
 
 Android  has  set  of  C/C++  libraries  used  by  various  components  of  the  android  system.
 
4]  Android  runtime:
 
 Android  includes  a  set  of  core  libraries  that  provides  most  of  the  functionality  
available  in  the  core  
libraries  of  the  Java  programming  language.
 
5]
 Linux  Kernel
:
 
 Android  is  based  on  Linux  kernel  for  core  system  functionalities  such  as  memory  management,  
security,  
driver
 model  etc.
 
The  given  research  paper  also  describes  the  detail  v
iew  about  anatomy  of  android  application  such  as  
Activity,  Intent  Receiver,  Service  and  Content  Provider
.
 
1]  Activity:  
 
 Activity  is  the  basic  building  block  of  the  android.  Activity  is  the  single  screen  in  the  application.
 
Each  
activity  is  implemented  as  
a  single  class  that  extends  the  Activity  base  class.  Moving  to  another  screen  
results  in  different  activity.  When  new  activity  starts  previous  screen  is  paused  and  stored  in  the  history  
stack.  User  can  return  to  previous  activity  using  history  stack.  Activ
ities  can  also  be  deleted  from  the  
history  stacks.  Android  uses  a  special  class  called  intent  to  move  from  screen  to  screen.  Two  important  
part  of  the  intent  are  “action”  and  “data”.  Typical  actions  are  MAIN,  VIEW,  PICK,  EDIT  etc.
 
The  data  is  
expressed  as  
a  Uniform  Resource  Indicator  (URI).
 
2]  Intent  Receiver:  
 
Intent  receiver  is  used  when  there  is  a  need  of  execution  of  code  with  external  event.  Intent  receivers  
are  registered  in  AndroidManifest.xml,  but  they  can  also  be  registered  using  Context.registerRe
ceiver  
method.
 
3]  Service:    
 
A  service  is  a  code  that  is  long  lived  and  runs  without  UI.  Basically  this  provides  a  functionality  to  run  the  
code  in  the  background  continuously.  Activity  could  start  a  service  using  the  Context.startService  
method  to  run  in  
the  background.
 
4]  Content  Provider:  
 
A  content  provider  is  useful  if  you  want  your  application's  data  to  be  shared  with  other  applications.  A  
content  provider  is  a  class  that  implements  a  standard  set  of  methods  to  let  other  applications  store  and  
retriev
e  the  type  of  data  that  is  handled  by  that  content  provider.
 
Research  paper  explains  integrat
ion  of  
Google  map  on  android  platform  and  the  features  that
 being  
offered  for  dealing  with  different  map  
functionalities
 on  an  android  platform.
 Map  view,  Map  API  
and  
Location  based  API  is  used  for  implementing  map  functionality.
 
 
Map  view:  
 
Map  view  is  used  to  display  view  of  the  map  on  android  phone.  Zoom  features  are  also  provided  in  map  
view.  Map  view  also  supports  multi
-­‐
layer  overlays  and  user  can  draw  picture,
 string,  coordinates  on  the  
map.  Map  view  is  required  to  be  added  into  the  layout,  as  follows:
 
 
 
 
Other  necessary  view  such  as  an  edit  text  and  a  button  can  be  added.  Android  location  based  API  is  used  
to  get  the  users  current  position  and  display  the  loc
ation  on  the  screen.  Location  manager  is  used  to  get  
the  coordinates  value.
 
 
Next,  set  up  a  Geo
 
Point  and  assign  to  it  the  latPoint  and  lngPoint  values  that  we  retrieved  from  the  GPS,  
and  use  the  controller  to  move  the  map  to  current  location.  
 
 
Accordin
g  to  change  in  geographical  co
-­‐
ordinates  overlay  can  be  used  to  display  the  trace  of  the  route.  
Different  map  views  such  as  satellite  or  traffic  view  can  also  be  used  such  as  myMap.setSatellite  (true);  
myMap.setTraffic  (false).  
 
In  short  android  provides  d
etailed  map  functionality  that  can  be  used  for  variety  of  applications
 
 
Analysis  of  2nd
 research  paper:
 
 Title:  
Location  Based  Services  using  Android
 
Authors:
 
Sandeep  Kumar,  Mohammed  Abdul  Qadeer,  Archana  Gupta
 
Analysis:    
 
This  research  paper  talks  about  L
ocation  based  services.    It  gives  description  of  
location
-­‐
based
 services  
and  importance  of  location  based  services  in  different  fields.  It  categorizes  different  types  of  
location
-­‐
based
 services  such  as  location  tracking  service,  emergency
-­‐
 safety  medical/h
ealth  services,  information  
services,  and  navigation/routing.    It  describes  the  architecture  of  
location
-­‐
based
 services  in  detail.  
 
There  are  three  architectures  of  Location  Based  Services:
 
1]  Pull  Based  model:  
 
Location  proxy  is  there  between  client  and  L
BS  application.  When  the  client  initiates  the  request  goes  to  
location  proxy  and  then  it  is  forwarded  to  appropriate  LBS  application.  LBS  application  offers  the  
service,  
which
 is  pulled  by  the  client.
 
2]  Poll  Based  model:    
 
In  
poll
-­‐
based
 approach  LBS  appli
cation  keeps  polling  the  LBS  server  on  demand  of  the  LBS  client.
 
3]  Push  Based  model:  
 
In  push  based  model  LBS  application  pushes  location
-­‐
aware  information  to  client  according  to  the  user  
preference  by  tracking  the  position  of  mobile  users.  
 
 
Research  pa
per  also  talks  about  access  to  the  following  components  to  facilitates  the  implementation  of  
LBS  services  
 
1]  Location  Manager:  
 
This  class  of  android  is  present  to  manage  all  other  components  needed  to  establish  a  LBS  system.  
 
2]  Location  provider:  
 
It  re
presents  technology  to  determine  physical  location.  Location  provider  deals  with  the  available  
provider  and  selects  the  appropriate  one  based  on  different  parameters.
 
To  get  list  of  available  providers  following  code  snippet  can  be  used  
 
 
In  addition  spec
ific  GPS  provider  can  also  be  accessed  by  static  variables  defined  in  Location  Manager  
class  as  shown  below.
 
 
For  finding  the  provider  based  on  the  criteria  class  is  used  
 
 
Geoc
oding:
 
Reverse  G
eocoding  is  way  to  convert  geographical  coordinates  (longitud
e,  latitude)  into  street  address
 
and  in  forward  G
eocoding  street  address  is  converted  into  geographical
 coordinates
.
 
Forward  Geocoding  code  snippet:  
 
 
 
 
Reverse  Geo
 
coding  code  snippet:
 
 
Design
 of  the  Project:  
 
The  flowchart  explains  various  mod
ules  and  design  of  the  project.
 
 
 We  have  two  activities  in  our  software  design.    First  Activity  deals  with  GUI  part.  We  have  designed  user  
friendly  GUI  accepting  the  parameter  such  as  time  and  distance  from  the  user  to  update  the  tracking  
status.  On  gett
ing  the  input  parameter  such  as  time  and  distance  from  user  we  have  used  android  
location  based  services  to  acquire  the  longitude  and  latitude  of  its  current  position.    In  our  application  
we  will  keep  the  LOG  of  the  current  Location.      We  have  performed
 Re
verse  G
eoC
oding  to  get  the  actual  
street  address  so  that  user  can  identify  it  position  as  valid  street  address.  
 
     After  saving  all  the  LOGS  we  have  given  
provision  to
 locate  user’s  position  on  the  Google  map  for  a  
particular  date  and  time  so  user  doesn’t
 
need  to
 just  read  the  logs  a  file  
format  but
 user  can  
have  a  real  
time  experience  to  
see  its  position  on  the  Google  map  with  street  address.
 
Please  find  the  below  the  java  files/functionalities  and  its  corresponding  functionality
 
1]
 
LogLife.java  :    It  d
eals  with  GUI  part  .  It  uses  Location  base  services  to  display  longitude  and  latitude.  
Based  on  the  longitude  and  latitude  it  will  keep  on  creating  Log  files  on  SD  card.
 
2]
 
LocationOnMap.java:  It  uses  Google  map  libraries  to  display  the  location  on  map  by  
placing  android  
icon  on  the  
respective  location
.
 
3]  ReverseGeoCode.java:  It  is  basically  used  for  performing  longitude  and  latitude  to  the  actual  street  
address  .It  takes  the  location  
object  as
 input  establish  connection  with  Google  server  which  returns  
the  
address  in  XML  format.  
 
4]  ReverseGeoCodeOutput.java:  It  deals  with  parsing  of  the  XML  address  from  the  
Google
 server  to  get  
the  actual  address  in  string  format.
 
5]
 
Other  helper  classes  used:    a]  
Geo
Point
:    To  locate  a  
point  on  a  map    b]  MapController:
 To  give  zoom  
in  /out  functionality    to  the  map.
 
Locagon  Based  Services  
GPS  Receiver  
Geographic  co  ordinates  
Reverse  look  up  (Google  Map  API)  
Readable  address  
6]
 
Views  Used:  a]  Map  View:  To  display  map.  B]Text  View:  To  place  components  like  spinners,
 
Button,
 
Text
.
 
Installation  Manual:
 
 The  deliverables  consists  of  .apk  files.  Android  is  capable  of  running  .apk  fil
es.  There  are  2  files  namely  
LogLife.apk  and  Gmaps.apk.  To  install  the  application  the  procedure  
is:  
-­‐
 
1.

If  the  device  doesn’t  have  a  file  explorer  we  need  to  download  it  from  android  market  place.  
You  can  use  “AndExplorer”.  To  download  it  from  marketplace  y
ou  need  a  
Google
 account  and  
WiFI  network.  Just  search  the  applicaion  in  Android  market  place  and  install  it.  It  is  free  of  cost.
 
2.

Next  step  is  
connecting
 the  device  to  the  computer  and  turn  on  the  USB
-­‐
mode  to  transfer  files.
 
3.

Transfer  the  .apk  files  mentioned  
above  to  the  SDcard.
 
4.

Now  eject  the  SDcard  and  turn  of  the  USB
-­‐
mode.
 
5.

Start  the  explorer  (AndExplorer)  and  look  for  the  .apk  files  you  just  transferred.
 
6.

Click  on  the  files  and  then  click  on  install  button.  This  will  install  the  application  in  the  device.
 
7.

Ins
tall  both  the  files  similarly.
 
8.

Now  two  more  widgets  will  appear  on  the  home  screen.
 
9.

One  will  show  the  name  LogLife  with  the  logo  and  other  will  be  just  a  logo  similar  to  that  of    the  
android  market  place  logo.
 
10.

The  application  is  now  ready  to  be  used.
 
User  
Manual
:
 
Once  all  the  installation  part  is  done  Loglife  icon  will  appear  on  home  screen  of  the  device.  Just  click  on  
it.  You  will  see  this  screen
-­‐
 
 
The  1
st
 dropdown  list  specifies  time  in  seconds  and  2
nd
 specifies  distance  in  meters.  You  can  select  some  
va
lue  or  even  leave  them  to  be  same  as  default.  Then  click  on  the  “Start  Track”  button.  The  tracking  will  
start  an
d  the  location  with  address  and  co  ordinates  will  appear  on  the  screen.  To  check  the  log  go  to  
the  explorer  and  check  the  contents  of  SDcard.  Lo
ok  for  file  named  Loglife
-­‐
“timestamp”.txt.  time  stamp  
will  be  in  the  format  of  dd
-­‐
mm
-­‐
yy
-­‐
time.  Select  the  file  and  
you
 can  see  all  the  places  you  visited  and  the  
time  of  visit.
 
Next  to  test  the  Map  Api  click  on  the  other  icon  on  home  screen  as  explained  in  
installation.  You  will  see  
this  screen:
 
 
This  is  how  you
 can  see  the  current  location  on  Google  Map  Api.  
 
To  quit  all  the  application  Go  to  
Setting  >  Application  >  Manage  application
.
 
Click  the  application  to  quit  and  then  click  on  force  quit.
 
Results  from  
Running  Software:  
 
 
Each  time  the  application  is  run  a  loglife
-­‐
“timestamp”.txt  file  is  generated  which  has  entries  of  the  
address  of  all  the  places  we  visited  with  the  time  of  visit.
 
What  we  have  learnt  from  the  project:
 
The  project  taught  us  many  innovati
ve  things  to  work  on.  The  Android  platform  by  Google  was  the  
novice  technology  we  learnt.  
We  came  to  know  all  the  installation  needed  to  program  on  android  like  
the  SDK,  Eclipse  ADT  plug
-­‐
in  that  are  very  important  from  developers  point  of  view.  We  learnt  t
he  
android  architecture.  Also  the  research  papers  help  us  understand  the  location
-­‐
based  services
 for  the  
cell  phones.  We  now  know  how  to  establish  connection  with  Google  server  using  the  private  key.  We  
also  learnt  how  to  use  Google  Map  API  interface,  whic
h  again  requires  a  private  key.  We  
also  
accomplished
 parsing  the  XML  format  and  retrieve  
the  readable  address.  
We  also  came  to  know  how  to
 
interact  with  the  storage  of  the  android  device.  
We  learnt  the  concepts  of  Geo  Coding  and  Reverse  Geo  
c
oding.
 The  mos
t  important  thing  we  learnt  is  how  a  project  progresses  through  various  stages  of  
software  development  cycle  through  weekly  updates,  versions  and  presentation.
 
Possible  future  work:
 
Photo  
tagging:
   LBS  can  be  used  to  tag  the  photos  clicked  from  camera  and  
can  be  showed  on  the  map  
on  the  location  where  they  were  clicked.
 
GPS  
device:
 Extending  the  application  with  some  distance  algorithms
 like  dijikstra  shortest  
path  and
 
including  more  parameters
 like  speed,  distance
,  it  can  used  for  as  a  GPS.
 
Individual  Work
:
 
Anup  Ahire:
 Worked  on  Location  based  services.  Researched  a  lot  on  Geo  Coding  and  reverse  Geocoding  
and  implemented  them.  Also  worked  on  presentations.
 
Ameet  Chattwal:
 
Worked  on  the  Google  Map  API  in  android  and  embedded  them  into  the  application,  
develo
ped  the  initial  module  of  location  based  services,  designed  and  implemented  the  GUI  in  android,  
worked  on  presentation  and  did  documentation  part.  
 
Abhishek  Kamble
:  
Did  major  part  of  presentation,  analyzed  the  research  papers  thoroughly,  worked  
on  
presentation
,  also  did  the  through  testing  of  the  application.