All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
UnityAndroidConnectivityService.h
1 // Copyright eeGeo Ltd (2012-2014), All Rights Reserved
2 
3 #pragma once
4 
5 #include <jni.h>
6 #include "IConnectivityService.h"
7 #include "CallbackCollection.h"
8 #include <string>
9 
10 struct AndroidNativeState;
11 
12 namespace Eegeo
13 {
14  namespace Android
15  {
17  {
18  public:
21 
22  bool HasConnectivity();
23  Web::ConnectivityType GetConnectivityType();
24  void SetConnectivityType(const int connectivityType, const std::string& wifiSSID);
25 
26  const std::string& GetSSIDForCurrentWifi();
27 
28  void RegisterConnectivityChangedCallback(Helpers::ICallback1<const bool&>& callback);
29  void UnregisterConnectivityChangedCallback(Helpers::ICallback1<const bool&>& callback);
30 
31  private:
32 
33  std::string m_currentSSID;
34 
35  bool m_hasConnectivity;
36  int m_connectivityType;
37 
39 
40  void SetHasConnectivity(const bool hasConnectivity, const std::string& wifiSSID);
41  void GetInitialConnectivity();
42  };
43  }
44 }
45 
46 extern "C"
47 {
48  JNIEXPORT void JNICALL Java_com_eegeo_web_ConnectivityServiceJniMethods_SetConnectivityType(
49  JNIEnv* jenv, jobject obj,
50  jlong nativeObjectPtr,
51  jint connectivityType,
52  jstring jWifiSSID);
53 }