All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
AndroidLocationService.h
1 // Copyright eeGeo Ltd (2012-2014), All Rights Reserved
2 
3 #pragma once
4 
5 #include <jni.h>
6 #include "ILocationService.h"
7 #include "Types.h"
8 #include "VectorMath.h"
9 #include "InteriorId.h"
10 
11 struct AndroidNativeState;
12 
13 namespace Eegeo
14 {
15  namespace Android
16  {
18  {
19  private:
20  double latRadians;
21  double lonRadians;
22  double altitudeMeters;
23  double horizontalAccuracyMeters;
24  double headingDegrees;
25  bool hasLocation;
26  bool hasAccuracy;
27  bool hasAltitude;
28  bool hasHeading;
29  bool isAuthorized;
30 
31  AndroidNativeState* pState;
32 
33  void UpdateLatLongFromJNI();
34  void UpdateHeadingFromJNI();
35 
36  jclass m_locationServiceClass;
37  jclass m_headingServiceClass;
38  jobject m_headingServiceInstance;
39 
40  public:
43 
44  void StopListening();
45 
46  const bool GetIsAuthorized() const { return isAuthorized; }
47 
48  bool IsIndoors();
49  Resources::Interiors::InteriorId GetInteriorId();
50  bool GetLocation(Eegeo::Space::LatLong& latlong);
51  bool GetAltitude(double& altitude);
52  bool GetFloorIndex(int& floorIndex);
53  bool GetHorizontalAccuracy(double& accuracy);
54  bool GetHeadingDegrees(double& headingDegrees);
55  };
56  }
57 }