@Override public void onCreate() { super.onCreate(); // Get application class instance. mApp = (HostDeviceApplication) this.getApplication(); // EventManagerの初期化 EventManager.INSTANCE.setController(new MemoryCacheController()); // ファイル管理クラスの作成 mFileMgr = new FileManager(this); mFileDataManager = new FileDataManager(mFileMgr); // add supported profiles addProfile(new HostConnectProfile(BluetoothAdapter.getDefaultAdapter())); addProfile(new HostNotificationProfile()); addProfile(new HostDeviceOrientationProfile()); addProfile(new HostBatteryProfile()); addProfile(new HostMediaStreamingRecordingProfile()); addProfile(new HostPhoneProfile()); addProfile(new HostSettingsProfile()); addProfile(new HostMediaPlayerProfile()); addProfile(new HostFileProfile(mFileMgr)); addProfile(new HostFileDescriptorProfile(mFileDataManager)); addProfile(new HostVibrationProfile()); addProfile(new HostProximityProfile()); addProfile(new HostCanvasProfile()); addProfile(new HostTouchProfile()); addProfile(new HostKeyEventProfile()); // バッテリー関連の処理と値の保持 mHostBatteryManager = new HostBatteryManager(); mHostBatteryManager.getBatteryInfo(this.getContext()); mIfBatteryCharge = new IntentFilter(); mIfBatteryCharge.addAction(Intent.ACTION_BATTERY_CHANGED); mIfBatteryCharge.addAction(Intent.ACTION_BATTERY_LOW); mIfBatteryCharge.addAction(Intent.ACTION_BATTERY_OKAY); mIfBatteryConnect = new IntentFilter(); mIfBatteryConnect.addAction(Intent.ACTION_POWER_CONNECTED); mIfBatteryConnect.addAction(Intent.ACTION_POWER_DISCONNECTED); // オーバーレイ mCameraOverlay = new CameraOverlay(this); mCameraOverlay.setFileManager(mFileMgr); // MediaPlayer (Video) IntentFilter. mIfMediaPlayerVideo = new IntentFilter(); mIfMediaPlayerVideo.addAction(VideoConst.SEND_VIDEOPLAYER_TO_HOSTDP); }
@Override public void onDestroy() { // hue SDKの後始末 PHHueSDK hueSDK = PHHueSDK.getInstance(); hueSDK.getNotificationManager().unregisterSDKListener(mPhListener); hueSDK.disableAllHeartbeat(); PHBridge bridge = hueSDK.getSelectedBridge(); if (bridge != null) { hueSDK.disconnect(bridge); } super.onDestroy(); }
@Override public void onCreate() { super.onCreate(); addProfile(new HueLightProfile()); // hue SDKの初期化 PHHueSDK hueSDK = PHHueSDK.getInstance(); hueSDK.setAppName(HueConstants.APNAME); hueSDK.getNotificationManager().registerSDKListener(mPhListener); // 前もってキャッシュをupdateしておく PHBridgeSearchManager sm = (PHBridgeSearchManager) hueSDK.getSDKService(PHHueSDK.SEARCH_BRIDGE); sm.search(true, true); }
@Override public void onCreate() { super.onCreate(); EventManager.INSTANCE.setController(new DBCacheController(this)); LocalOAuth2Main.initialize(getApplicationContext()); addProfile(new TestNotificationProfile()); addProfile(new TestFileProfile(new FileManager(getApplicationContext()))); addProfile(new TestMediaStreamRecordingProfile()); addProfile(new TestMediaPlayerProfile()); addProfile(new TestPhoneProfile()); addProfile(new TestFileDescriptorProfile()); addProfile(new TestSettingsProfile()); addProfile(new TestVibrationProfile()); addProfile(new TestBatteryProfile()); addProfile(new TestConnectProfile()); addProfile(new TestProximityProfile()); addProfile(new TestDeviceOrientationProfile()); // 独自プロファイル addProfile(new TestUniqueProfile()); addProfile(new TestJSONConversionProfile()); }
@Override public void onDestroy() { super.onDestroy(); mFileDataManager.stopTimer(); }