Commit bbfc0958 by Jeong Gilmo

#32917 芯温センサー

- 芯温センサーと繋がる機能追加
- 芯温センサーからデータを受診する機能追加
- 芯温センサーのデータをCMSに転送する機能追加
parent a01ca2f5
...@@ -126,6 +126,7 @@ public class Constant { ...@@ -126,6 +126,7 @@ public class Constant {
int AccessFineLocation = 1; int AccessFineLocation = 1;
int Camera = 2; int Camera = 2;
int Audio =3; int Audio =3;
int Bluetooth = 4; // Bluetooth ディバイス情報:beacon
} }
public interface TaskReportLevel { public interface TaskReportLevel {
...@@ -156,4 +157,11 @@ public class Constant { ...@@ -156,4 +157,11 @@ public class Constant {
int NO = 0; int NO = 0;
int YES = 1; int YES = 1;
} }
// 連携機器の区分
public interface DeviceType {
int thermomete = 1; // 芯温系
int sensor = 2; // おくだけセンサー
int barcode = 3; // バーコード
}
} }
...@@ -119,4 +119,9 @@ public class ABookKeys { ...@@ -119,4 +119,9 @@ public class ABookKeys {
public static final String HAS_AUTHORITY = "hasAuthority"; public static final String HAS_AUTHORITY = "hasAuthority";
// #32926 作業報告画面改善 end // #32926 作業報告画面改善 end
public static final String CLOSE_TASK_REPORT = "closeTaskReport"; public static final String CLOSE_TASK_REPORT = "closeTaskReport";
// ディバイス情報取得
public static final String CMD_GET_DEVICE_INFO = "getDeviceInfo"; // CMSのインターフェースのパラメータ:cmd
public static final String TASK_DEVICE_TYPE = "deviceType"; // CMSのインターフェースのパラメータ:devicetype
public static final String TASK_QUESTION_ID = "qid"; // CMSのインターフェースのパラメータ:qid
} }
...@@ -1382,5 +1382,6 @@ ...@@ -1382,5 +1382,6 @@
<string name="msg_connected_bluetooth">%sに接続されました。</string> <string name="msg_connected_bluetooth">%sに接続されました。</string>
<string name="msg_ble_not_connect">接続が停止しました。</string> <string name="msg_ble_not_connect">接続が停止しました。</string>
<string name="msg_ble_connect_error">%sと接続されていません。\n%sと接続状態を設定画面の機器連携から確認してください。</string> <string name="msg_ble_connect_error">%sと接続されていません。\n%sと接続状態を設定画面の機器連携から確認してください。</string>
<string name="msg_permission_dialog_bluetooth">ブルートゥース利用権限が必要です。\nアプリ設定画面へ遷移します。</string>
</resources> </resources>
...@@ -1383,5 +1383,6 @@ ...@@ -1383,5 +1383,6 @@
<string name="msg_connected_bluetooth">%s에 접속되었습니다</string> <string name="msg_connected_bluetooth">%s에 접속되었습니다</string>
<string name="msg_ble_not_connect">접속이 정지되었습니다.</string> <string name="msg_ble_not_connect">접속이 정지되었습니다.</string>
<string name="msg_ble_connect_error">%s랑 접속되지않습니다.\n%s와의 접속상태를 설정화면의 기기연결에서 확인해주세요.</string> <string name="msg_ble_connect_error">%s랑 접속되지않습니다.\n%s와의 접속상태를 설정화면의 기기연결에서 확인해주세요.</string>
<string name="msg_permission_dialog_bluetooth">블루투스이용권한이 필요합니다.\n설정화면으로 이동합니다.</string>
</resources> </resources>
\ No newline at end of file
...@@ -1382,5 +1382,6 @@ ...@@ -1382,5 +1382,6 @@
<string name="msg_connected_bluetooth">Connected to %s</string> <string name="msg_connected_bluetooth">Connected to %s</string>
<string name="msg_ble_not_connect">The connection has stopped.</string> <string name="msg_ble_not_connect">The connection has stopped.</string>
<string name="msg_ble_connect_error">Not connected with% %s. \nCheck %s and connection status from the device linkage on the setting screen.</string> <string name="msg_ble_connect_error">Not connected with% %s. \nCheck %s and connection status from the device linkage on the setting screen.</string>
<string name="msg_permission_dialog_bluetooth">You need Bluetooth access authority. \nIt changes to the application setting.</string>
</resources> </resources>
\ No newline at end of file
...@@ -4,6 +4,7 @@ package jp.agentec.abook.abv.ui.viewer.activity; ...@@ -4,6 +4,7 @@ package jp.agentec.abook.abv.ui.viewer.activity;
* @author jang * @author jang
*/ */
import android.app.Activity;
import android.app.AlertDialog; import android.app.AlertDialog;
import android.app.Dialog; import android.app.Dialog;
import android.content.Context; import android.content.Context;
...@@ -135,6 +136,8 @@ import jp.agentec.abook.abv.ui.common.util.PatternStringUtil; ...@@ -135,6 +136,8 @@ import jp.agentec.abook.abv.ui.common.util.PatternStringUtil;
import jp.agentec.abook.abv.ui.common.view.ABVEditText; import jp.agentec.abook.abv.ui.common.view.ABVEditText;
import jp.agentec.abook.abv.ui.common.view.ABVPopupListWindow; import jp.agentec.abook.abv.ui.common.view.ABVPopupListWindow;
import jp.agentec.abook.abv.ui.common.vo.Size; import jp.agentec.abook.abv.ui.common.vo.Size;
//import jp.agentec.abook.abv.ui.home.activity.BarCodeReaderActivity;
import jp.agentec.abook.abv.ui.home.activity.PairingSettingActivity;
import jp.agentec.abook.abv.ui.home.helper.ABookCheckWebViewHelper; import jp.agentec.abook.abv.ui.home.helper.ABookCheckWebViewHelper;
import jp.agentec.abook.abv.ui.home.helper.ActivityHandlingHelper; import jp.agentec.abook.abv.ui.home.helper.ActivityHandlingHelper;
import jp.agentec.abook.abv.ui.Interface.MovePageInterface; import jp.agentec.abook.abv.ui.Interface.MovePageInterface;
...@@ -3766,6 +3769,32 @@ public class ContentViewActivity extends ABVContentViewActivity { ...@@ -3766,6 +3769,32 @@ public class ContentViewActivity extends ABVContentViewActivity {
} }
mUploadMessage.onReceiveValue(result); mUploadMessage.onReceiveValue(result);
break; break;
// 機器連携と繋がる処理 get DeviceInfo
case REQUEST_ENABLEBLUETOOTH: // Bluetooth有効化要求
if( Activity.RESULT_CANCELED == resultCode )
{ // 有効にされなかった
ABVToastUtil.showMakeText(getApplicationContext(), R.string.bluetooth_is_not_working, Toast.LENGTH_SHORT);
return;
}
break;
case REQUEST_CONNECTDEVICE: // デバイス接続要求
String strDeviceName;
if( Activity.RESULT_OK == resultCode ) {
// デバイスリストアクティビティからの情報の取得
strDeviceName = intent.getStringExtra( PairingSettingActivity.EXTRAS_DEVICE_NAME );
mDeviceAddress = intent.getStringExtra( PairingSettingActivity.EXTRAS_DEVICE_ADDRESS );
setUserPref(strDeviceName, mDeviceAddress, 1);
} else {
strDeviceName = "";
mDeviceAddress = "";
setUserPref(strDeviceName, mDeviceAddress, 0);
}
break;
// case REQUEST_BARCODE_READER: // バーコードレーダから読み取ったデータの処理
// if (Activity.RESULT_OK == resultCode) {
// setBarCodeData(intent.getStringExtra(BarCodeReaderActivity.BARCODE_READING_DATA));
// }
// break;
} }
mUploadMessage = null; mUploadMessage = null;
} }
......
package jp.agentec.abook.abv.ui.viewer.activity; package jp.agentec.abook.abv.ui.viewer.activity;
import android.app.Activity; import android.app.Activity;
import android.bluetooth.BluetoothAdapter;
import android.bluetooth.BluetoothDevice;
import android.bluetooth.BluetoothGatt;
import android.bluetooth.BluetoothGattCallback;
import android.bluetooth.BluetoothGattCharacteristic;
import android.bluetooth.BluetoothGattDescriptor;
import android.bluetooth.BluetoothGattService;
import android.bluetooth.BluetoothManager;
import android.bluetooth.BluetoothProfile;
import android.content.Context; import android.content.Context;
import android.content.DialogInterface; import android.content.DialogInterface;
import android.content.Intent;
import android.net.Uri; import android.net.Uri;
import android.view.View; import android.view.View;
import android.webkit.ValueCallback; import android.webkit.ValueCallback;
...@@ -10,11 +20,15 @@ import android.widget.Button; ...@@ -10,11 +20,15 @@ import android.widget.Button;
import android.widget.ImageButton; import android.widget.ImageButton;
import android.widget.LinearLayout; import android.widget.LinearLayout;
import android.widget.ProgressBar; import android.widget.ProgressBar;
import android.widget.Toast;
import java.io.File; import java.io.File;
import java.nio.ByteBuffer;
import java.nio.ByteOrder;
import java.util.Date; import java.util.Date;
import java.util.HashMap; import java.util.HashMap;
import java.util.Map; import java.util.Map;
import java.util.UUID;
import jp.agentec.abook.abv.bl.acms.type.OperationType; import jp.agentec.abook.abv.bl.acms.type.OperationType;
import jp.agentec.abook.abv.bl.common.ABVEnvironment; import jp.agentec.abook.abv.bl.common.ABVEnvironment;
...@@ -37,6 +51,7 @@ import jp.agentec.abook.abv.ui.common.constant.ErrorMessage; ...@@ -37,6 +51,7 @@ import jp.agentec.abook.abv.ui.common.constant.ErrorMessage;
import jp.agentec.abook.abv.ui.common.dialog.ABookAlertDialog; import jp.agentec.abook.abv.ui.common.dialog.ABookAlertDialog;
import jp.agentec.abook.abv.ui.common.util.AlertDialogUtil; import jp.agentec.abook.abv.ui.common.util.AlertDialogUtil;
import jp.agentec.abook.abv.ui.common.util.PatternStringUtil; import jp.agentec.abook.abv.ui.common.util.PatternStringUtil;
import jp.agentec.abook.abv.ui.home.activity.PairingSettingActivity;
import jp.agentec.abook.abv.ui.home.helper.ABookCheckWebViewHelper; import jp.agentec.abook.abv.ui.home.helper.ABookCheckWebViewHelper;
import jp.agentec.abook.abv.ui.home.helper.ActivityHandlingHelper; import jp.agentec.abook.abv.ui.home.helper.ActivityHandlingHelper;
import jp.agentec.abook.abv.ui.home.helper.ContentViewHelper; import jp.agentec.abook.abv.ui.home.helper.ContentViewHelper;
...@@ -429,4 +444,34 @@ public class ParentWebViewActivity extends ABVContentViewActivity { ...@@ -429,4 +444,34 @@ public class ParentWebViewActivity extends ABVContentViewActivity {
public void callViewLoadUrl(String url) { public void callViewLoadUrl(String url) {
webViewLoadUrl(url); webViewLoadUrl(url);
} }
// 機能の有効化ダイアログの操作結果
@Override
protected void onActivityResult( int requestCode, int resultCode, Intent data )
{
switch( requestCode )
{
case REQUEST_ENABLEBLUETOOTH: // Bluetooth有効化要求
if( Activity.RESULT_CANCELED == resultCode )
{ // 有効にされなかった
return;
}
break;
case REQUEST_CONNECTDEVICE: // デバイス接続要求
String strDeviceName;
if( Activity.RESULT_OK == resultCode )
{
// デバイスリストアクティビティからの情報の取得
// strDeviceName = data.getStringExtra( DeviceListActivity.EXTRAS_DEVICE_NAME );
mDeviceAddress = data.getStringExtra( PairingSettingActivity.EXTRAS_DEVICE_ADDRESS );
}
else
{
strDeviceName = "";
mDeviceAddress = "";
}
break;
}
super.onActivityResult( requestCode, resultCode, data );
}
} }
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment