Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
A
abook_check
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
abook_android
abook_check
Commits
bbfc0958
You need to sign in or sign up before continuing.
Commit
bbfc0958
authored
Apr 18, 2019
by
Jeong Gilmo
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
#32917 芯温センサー
- 芯温センサーと繋がる機能追加 - 芯温センサーからデータを受診する機能追加 - 芯温センサーのデータをCMSに転送する機能追加
parent
a01ca2f5
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
310 additions
and
0 deletions
+310
-0
ABVJE_BL/src/jp/agentec/abook/abv/bl/common/Constant.java
+8
-0
ABVJE_BL/src/jp/agentec/abook/abv/bl/common/constant/ABookKeys.java
+5
-0
ABVJE_Res_Default_Android/res/values-ja/strings.xml
+1
-0
ABVJE_Res_Default_Android/res/values-ko/strings.xml
+2
-0
ABVJE_Res_Default_Android/res/values/strings.xml
+2
-0
ABVJE_UI_Android/src/jp/agentec/abook/abv/ui/common/activity/ABVContentViewActivity.java
+218
-0
ABVJE_UI_Android/src/jp/agentec/abook/abv/ui/viewer/activity/ContentViewActivity.java
+29
-0
ABVJE_UI_Android/src/jp/agentec/abook/abv/ui/viewer/activity/ParentWebViewActivity.java
+45
-0
No files found.
ABVJE_BL/src/jp/agentec/abook/abv/bl/common/Constant.java
View file @
bbfc0958
...
...
@@ -126,6 +126,7 @@ public class Constant {
int
AccessFineLocation
=
1
;
int
Camera
=
2
;
int
Audio
=
3
;
int
Bluetooth
=
4
;
// Bluetooth ディバイス情報:beacon
}
public
interface
TaskReportLevel
{
...
...
@@ -156,4 +157,11 @@ public class Constant {
int
NO
=
0
;
int
YES
=
1
;
}
// 連携機器の区分
public
interface
DeviceType
{
int
thermomete
=
1
;
// 芯温系
int
sensor
=
2
;
// おくだけセンサー
int
barcode
=
3
;
// バーコード
}
}
ABVJE_BL/src/jp/agentec/abook/abv/bl/common/constant/ABookKeys.java
View file @
bbfc0958
...
...
@@ -119,4 +119,9 @@ public class ABookKeys {
public
static
final
String
HAS_AUTHORITY
=
"hasAuthority"
;
// #32926 作業報告画面改善 end
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
}
ABVJE_Res_Default_Android/res/values-ja/strings.xml
View file @
bbfc0958
...
...
@@ -1382,5 +1382,6 @@
<string
name=
"msg_connected_bluetooth"
>
%sに接続されました。
</string>
<string
name=
"msg_ble_not_connect"
>
接続が停止しました。
</string>
<string
name=
"msg_ble_connect_error"
>
%sと接続されていません。\n%sと接続状態を設定画面の機器連携から確認してください。
</string>
<string
name=
"msg_permission_dialog_bluetooth"
>
ブルートゥース利用権限が必要です。\nアプリ設定画面へ遷移します。
</string>
</resources>
ABVJE_Res_Default_Android/res/values-ko/strings.xml
View file @
bbfc0958
...
...
@@ -1383,5 +1383,6 @@
<string
name=
"msg_connected_bluetooth"
>
%s에 접속되었습니다
</string>
<string
name=
"msg_ble_not_connect"
>
접속이 정지되었습니다.
</string>
<string
name=
"msg_ble_connect_error"
>
%s랑 접속되지않습니다.\n%s와의 접속상태를 설정화면의 기기연결에서 확인해주세요.
</string>
<string
name=
"msg_permission_dialog_bluetooth"
>
블루투스이용권한이 필요합니다.\n설정화면으로 이동합니다.
</string>
</resources>
\ No newline at end of file
ABVJE_Res_Default_Android/res/values/strings.xml
View file @
bbfc0958
...
...
@@ -1382,5 +1382,6 @@
<string
name=
"msg_connected_bluetooth"
>
Connected to %s
</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_permission_dialog_bluetooth"
>
You need Bluetooth access authority. \nIt changes to the application setting.
</string>
</resources>
\ No newline at end of file
ABVJE_UI_Android/src/jp/agentec/abook/abv/ui/common/activity/ABVContentViewActivity.java
View file @
bbfc0958
package
jp
.
agentec
.
abook
.
abv
.
ui
.
common
.
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.DialogInterface
;
import
android.content.Intent
;
import
android.content.pm.ActivityInfo
;
import
android.content.pm.PackageManager
;
import
android.database.Cursor
;
import
android.location.Location
;
import
android.net.Uri
;
import
android.os.Bundle
;
import
android.os.Handler
;
import
android.provider.MediaStore
;
import
android.util.Pair
;
import
android.view.Gravity
;
import
android.view.KeyEvent
;
import
android.view.MotionEvent
;
...
...
@@ -28,11 +40,14 @@ import org.json.adf.JSONObject;
import
java.io.File
;
import
java.io.FileNotFoundException
;
import
java.nio.ByteBuffer
;
import
java.nio.ByteOrder
;
import
java.util.ArrayList
;
import
java.util.HashMap
;
import
java.util.Iterator
;
import
java.util.List
;
import
java.util.Map
;
import
java.util.UUID
;
import
java.util.concurrent.ConcurrentHashMap
;
import
jp.agentec.abook.abv.bl.acms.client.json.content.ContentJSON
;
...
...
@@ -56,6 +71,7 @@ import jp.agentec.abook.abv.bl.websocket.MeetingManager;
import
jp.agentec.abook.abv.cl.environment.DeviceInfo
;
import
jp.agentec.abook.abv.cl.helper.ContentMarkingFileHelper
;
import
jp.agentec.abook.abv.cl.util.AndroidStringUtil
;
import
jp.agentec.abook.abv.cl.util.BleManagerUtil
;
import
jp.agentec.abook.abv.cl.util.ContentLogUtil
;
import
jp.agentec.abook.abv.cl.util.LocationManagerUtil
;
import
jp.agentec.abook.abv.cl.util.PreferenceUtil
;
...
...
@@ -70,6 +86,8 @@ import jp.agentec.abook.abv.ui.common.util.ABVToastUtil;
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.view.ABVPopupListWindow
;
//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.ABookPermissionHelper
;
import
jp.agentec.abook.abv.ui.home.helper.ActivityHandlingHelper
;
...
...
@@ -138,6 +156,17 @@ public abstract class ABVContentViewActivity extends ABVAuthenticatedActivity {
public
int
mButtonStatus
;
// 保存ボタンチェック
protected
boolean
mAddReport
;
// 作業追加区分
// 定数
public
static
final
int
REQUEST_ENABLEBLUETOOTH
=
1
;
// Bluetooth機能の有効化要求時の識別コード
public
static
final
int
REQUEST_CONNECTDEVICE
=
2
;
// デバイス接続要求時の識別コード
// public final static int REQUEST_BARCODE_READER = 3; // バーコードリーダの職別コード
// メンバー変数
public
String
mDeviceAddress
=
""
;
// デバイスアドレス
private
BleManagerUtil
bleManagerUtil
;
// Bluetoothの接続
// 機器連携のコマンドの設問ID
public
String
mQid
=
""
;
@Override
protected
void
onCreate
(
Bundle
savedInstanceState
)
{
super
.
onCreate
(
savedInstanceState
);
...
...
@@ -206,6 +235,40 @@ public abstract class ABVContentViewActivity extends ABVAuthenticatedActivity {
contentDownloader
.
pauseAll
();
showUpdateContentAlert
(
contentId
);
// get Device info
bleManagerUtil
=
new
BleManagerUtil
(
this
,
new
BleManagerUtil
.
BleManagerUtilListener
()
{
@Override
public
void
onConnectionState
()
{
// 接続
putUserPref
(
UserPrefKey
.
BLUETOOTH_DEVICE_TEMPERATURE_CONNECTED
,
1
);
ABVToastUtil
.
showMakeText
(
getApplicationContext
(),
String
.
format
(
getString
(
R
.
string
.
msg_connected_bluetooth
),
getString
(
R
.
string
.
thermometer
)),
Toast
.
LENGTH_SHORT
);
}
@Override
public
void
onDisConnectionState
()
{
// 切断
putUserPref
(
UserPrefKey
.
BLUETOOTH_DEVICE_TEMPERATURE_CONNECTED
,
0
);
ABVToastUtil
.
showMakeText
(
getApplicationContext
(),
getString
(
R
.
string
.
msg_ble_not_connect
),
Toast
.
LENGTH_SHORT
);
}
@Override
public
void
onGetDeviceInfo
(
String
strTemp
)
{
// 機器のデータ
Toast
.
makeText
(
getApplicationContext
(),
strTemp
,
Toast
.
LENGTH_SHORT
).
show
();
Logger
.
d
(
TAG
,
"get temperature [%s]"
,
strTemp
);
setThermometerData
(
strTemp
);
}
@Override
public
void
onGetDeviceInfoFailed
()
{
// 機器のエラー
putUserPref
(
UserPrefKey
.
BLUETOOTH_DEVICE_TEMPERATURE_CONNECTED
,
0
);
ABookAlertDialog
alert
=
AlertDialogUtil
.
createAlertDialog
(
ABVContentViewActivity
.
this
,
R
.
string
.
thermometer
);
alert
.
setMessage
(
String
.
format
(
getString
(
R
.
string
.
msg_ble_connect_error
),
getString
(
R
.
string
.
thermometer
),
getString
(
R
.
string
.
thermometer
)));
alert
.
setButton
(
DialogInterface
.
BUTTON_POSITIVE
,
getString
(
R
.
string
.
ok
),
(
DialogInterface
.
OnClickListener
)
null
);
alert
.
show
();
}
});
bleManagerUtil
.
startDeviceInfo
();
}
private
void
showUpdateContentAlert
(
long
contentId
)
{
...
...
@@ -305,6 +368,14 @@ public abstract class ABVContentViewActivity extends ABVAuthenticatedActivity {
if
(!
getRBoolean
(
R
.
bool
.
use_cache
)
&&
objectId
==
-
1
)
{
ContentFileExtractor
.
getInstance
().
removeContentCash
(
contentId
);
}
// 接続されている機器と切断する。
if
(
null
!=
bleManagerUtil
.
mBluetoothGatt
)
{
bleManagerUtil
.
mBluetoothGatt
.
close
();
bleManagerUtil
.
mBluetoothGatt
=
null
;
putUserPref
(
AppDefType
.
UserPrefKey
.
BLUETOOTH_DEVICE_TEMPERATURE_CONNECTED
,
0
);
}
}
public
long
getContentId
()
{
...
...
@@ -1063,6 +1134,28 @@ public abstract class ABVContentViewActivity extends ABVAuthenticatedActivity {
ErrorMessage
.
showErrorMessageToast
(
getApplicationContext
(),
ErrorCode
.
E107
);
}
}
// ビーコンデータを受信して目的のデバイスIDの信号から値を取得する
// 1:芯温系 2:置くだけセンサー 3:バーコード
else
if
(
mCmd
.
equals
(
ABookKeys
.
CMD_GET_DEVICE_INFO
))
{
int
device_type
=
0
;
if
(
abookCheckParam
.
containsKey
(
ABookKeys
.
TASK_DEVICE_TYPE
))
{
device_type
=
Integer
.
valueOf
(
abookCheckParam
.
get
(
ABookKeys
.
TASK_DEVICE_TYPE
));
// ディバイスのタイプ取得
mQid
=
abookCheckParam
.
get
(
ABookKeys
.
TASK_QUESTION_ID
);
// 設問ID取得
// 1:芯温系 2:置くだけセンサー 3:バーコード
if
(
device_type
==
Constant
.
DeviceType
.
thermomete
)
{
// 芯温系
setThermometerDeviceInfo
((
Integer
.
valueOf
(
abookCheckParam
.
get
(
ABookKeys
.
TASK_DEVICE_TYPE
))
==
Constant
.
DeviceType
.
thermomete
));
// } else if (device_type == Constant.DeviceType.sensor) { // 置くだけセンサー
// ErrorMessage.showErrorMessageToast(getApplicationContext(), "Not ready !!!!"); // set Error Message
// } else if (device_type == Constant.DeviceType.barcode) { // バーコード
// setBarcodeDeviceInfo();
}
else
{
ErrorMessage
.
showErrorMessageToast
(
getApplicationContext
(),
"Device is not working"
);
// set Error Message
}
}
else
{
ErrorMessage
.
showErrorMessageToast
(
getApplicationContext
(),
"Device is not working"
);
// set Error Message
}
}
}
public
void
commonAttachedDataUrl
(
String
data
)
{
...
...
@@ -1310,4 +1403,129 @@ public abstract class ABVContentViewActivity extends ABVAuthenticatedActivity {
}
}
}
/**
* ディバイスのバーコードの情報取得
*
*/
// protected void setBarcodeDeviceInfo() {
// //カメラパーミッションチェック
// ABookPermissionHelper helper = new ABookPermissionHelper(this, Constant.ABookPermissionType.Camera, null);
// if (!helper.checkMultiPermissions(true)) {
// Logger.w(TAG,"startCameraIntent Camera Permission false");
// return;
// }
// Intent barcodeactivityIntent = new Intent( this, BarCodeReaderActivity.class );
// startActivityForResult( barcodeactivityIntent, REQUEST_BARCODE_READER );
// }
/**
* BLEディバイスの芯温系の情報取得
* @param showPermissionDialogFlg
*/
protected
void
setThermometerDeviceInfo
(
final
boolean
showPermissionDialogFlg
)
{
ABookPermissionHelper
helper
=
new
ABookPermissionHelper
(
this
,
Constant
.
ABookPermissionType
.
Bluetooth
,
null
);
if
(
helper
.
checkMultiPermissions
(
showPermissionDialogFlg
))
{
if
(
getUserPref
(
UserPrefKey
.
BLUETOOTH_DEVICE_TEMPERATURE_ADDRESS
,
""
).
length
()
>
0
)
{
String
strDeviceName
=
getUserPref
(
UserPrefKey
.
BLUETOOTH_DEVICE_TEMPERATURE_NAME
,
""
);
// ローカルに保存されている場合保存されているディバイス情報を読み込んで処理する。
bleManagerUtil
.
mDeviceAddress
=
getUserPref
(
UserPrefKey
.
BLUETOOTH_DEVICE_TEMPERATURE_ADDRESS
,
""
);
int
deviceUsed
=
getUserPref
(
UserPrefKey
.
BLUETOOTH_DEVICE_TEMPERATURE_CONNECTED
,
0
);
// 取得したデバイスリストアクティビティからの情報をローカルに保存
setUserPref
(
strDeviceName
,
bleManagerUtil
.
mDeviceAddress
,
deviceUsed
);
// Android端末のBluetooth機能の有効化要求
requestBluetoothFeature
();
// 接続
bleManagerUtil
.
connect
();
}
else
{
setPairingSetting
();
// 接続するのために機器設定画面に遷移する。
}
}
else
{
Logger
.
w
(
TAG
,
"onGetDeviceInfoFailed Connect BLE Device false"
);
// リソースパターンの適用
afterABookCheckApi
(
mCmd
,
""
,
1
,
PatternStringUtil
.
patternToString
(
getApplicationContext
(),
R
.
string
.
msg_location_search_fail
,
getUserPref
(
AppDefType
.
UserPrefKey
.
RESOURCE_PATTERN_TYPE
,
0
)),
null
);
}
}
// Android端末のBluetooth機能の有効化要求
public
void
requestBluetoothFeature
()
{
if
(
bleManagerUtil
.
mBluetoothAdapter
.
isEnabled
()
)
{
return
;
}
// デバイスのBluetooth機能が有効になっていないときは、有効化要求(ダイアログ表示)
Intent
enableBtIntent
=
new
Intent
(
BluetoothAdapter
.
ACTION_REQUEST_ENABLE
);
startActivityForResult
(
enableBtIntent
,
REQUEST_ENABLEBLUETOOTH
);
}
// 機能の有効化Activityの操作結果
@Override
protected
void
onActivityResult
(
int
requestCode
,
int
resultCode
,
Intent
data
)
{
switch
(
requestCode
)
{
case
REQUEST_ENABLEBLUETOOTH:
// Bluetooth有効化要求
if
(
Activity
.
RESULT_CANCELED
==
resultCode
)
{
// 有効にされなかった
ABVToastUtil
.
showMakeText
(
getApplicationContext
(),
getString
(
R
.
string
.
bluetooth_is_not_working
),
Toast
.
LENGTH_SHORT
);
return
;
}
break
;
case
REQUEST_CONNECTDEVICE:
// デバイス接続要求
String
strDeviceName
;
if
(
Activity
.
RESULT_OK
==
resultCode
)
{
// デバイスリストアクティビティからの情報の取得
bleManagerUtil
.
mDeviceAddress
=
mDeviceAddress
;
strDeviceName
=
data
.
getStringExtra
(
PairingSettingActivity
.
EXTRAS_DEVICE_NAME
);
bleManagerUtil
.
mDeviceAddress
=
data
.
getStringExtra
(
PairingSettingActivity
.
EXTRAS_DEVICE_ADDRESS
);
// 取得したデバイスリストアクティビティからの情報をローカルに保存
setUserPref
(
strDeviceName
,
bleManagerUtil
.
mDeviceAddress
,
1
);
}
else
{
strDeviceName
=
""
;
bleManagerUtil
.
mDeviceAddress
=
""
;
setUserPref
(
strDeviceName
,
bleManagerUtil
.
mDeviceAddress
,
0
);
}
break
;
// case REQUEST_BARCODE_READER: // バーコードの要求
// setBarCodeData(data.getStringExtra(BarCodeReaderActivity.BARCODE_READING_DATA)); // バーコードの読み取りデータ
// break;
}
super
.
onActivityResult
(
requestCode
,
resultCode
,
data
);
}
// 機器連携の設定画面を表示する。
public
void
setPairingSetting
()
{
Intent
devicelistactivityIntent
=
new
Intent
(
this
,
PairingSettingActivity
.
class
);
startActivityForResult
(
devicelistactivityIntent
,
REQUEST_CONNECTDEVICE
);
}
// 機器連携の情報をローカルに保存する。
public
void
setUserPref
(
String
deviceName
,
String
deviceAddress
,
int
deviceUsed
)
{
putUserPref
(
UserPrefKey
.
BLUETOOTH_DEVICE_TEMPERATURE_NAME
,
deviceName
);
putUserPref
(
UserPrefKey
.
BLUETOOTH_DEVICE_TEMPERATURE_ADDRESS
,
deviceAddress
);
putUserPref
(
UserPrefKey
.
BLUETOOTH_DEVICE_TEMPERATURE_CONNECTED
,
deviceUsed
);
}
// CMS側にバーコードリーダーから読み取ったデータを転送する。
// protected void setBarCodeData(String barcodeData) {
// Logger.v(TAG, "barcode [%s]", barcodeData);
// JSONObject barcodeJson = new JSONObject();
// barcodeJson.put(ABookKeys.TASK_QUESTION_ID, mQid);
// barcodeJson.put("value", barcodeData);
// afterABookCheckApi(mCmd, "", 0, "", barcodeJson.toString());
//
// Toast.makeText( getApplicationContext(), barcodeData, Toast.LENGTH_SHORT ).show();
// Logger.v(TAG, "barcode JSON [%s]", barcodeJson.toString());
//
// }
// CMS側に芯温計からのデータを転送する。
protected
void
setThermometerData
(
String
strTemp
)
{
Logger
.
v
(
TAG
,
"thermometer [%s]"
,
strTemp
);
JSONObject
thermometerDataJson
=
new
JSONObject
();
thermometerDataJson
.
put
(
ABookKeys
.
TASK_QUESTION_ID
,
mQid
);
thermometerDataJson
.
put
(
"value"
,
strTemp
);
afterABookCheckApi
(
mCmd
,
""
,
0
,
""
,
thermometerDataJson
.
toString
());
Logger
.
v
(
TAG
,
"thermometer JSON [%s]"
,
thermometerDataJson
.
toString
());
}
}
ABVJE_UI_Android/src/jp/agentec/abook/abv/ui/viewer/activity/ContentViewActivity.java
View file @
bbfc0958
...
...
@@ -4,6 +4,7 @@ package jp.agentec.abook.abv.ui.viewer.activity;
* @author jang
*/
import
android.app.Activity
;
import
android.app.AlertDialog
;
import
android.app.Dialog
;
import
android.content.Context
;
...
...
@@ -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.ABVPopupListWindow
;
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.ActivityHandlingHelper
;
import
jp.agentec.abook.abv.ui.Interface.MovePageInterface
;
...
...
@@ -3766,6 +3769,32 @@ public class ContentViewActivity extends ABVContentViewActivity {
}
mUploadMessage
.
onReceiveValue
(
result
);
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
;
}
...
...
ABVJE_UI_Android/src/jp/agentec/abook/abv/ui/viewer/activity/ParentWebViewActivity.java
View file @
bbfc0958
package
jp
.
agentec
.
abook
.
abv
.
ui
.
viewer
.
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.DialogInterface
;
import
android.content.Intent
;
import
android.net.Uri
;
import
android.view.View
;
import
android.webkit.ValueCallback
;
...
...
@@ -10,11 +20,15 @@ import android.widget.Button;
import
android.widget.ImageButton
;
import
android.widget.LinearLayout
;
import
android.widget.ProgressBar
;
import
android.widget.Toast
;
import
java.io.File
;
import
java.nio.ByteBuffer
;
import
java.nio.ByteOrder
;
import
java.util.Date
;
import
java.util.HashMap
;
import
java.util.Map
;
import
java.util.UUID
;
import
jp.agentec.abook.abv.bl.acms.type.OperationType
;
import
jp.agentec.abook.abv.bl.common.ABVEnvironment
;
...
...
@@ -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.util.AlertDialogUtil
;
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.ActivityHandlingHelper
;
import
jp.agentec.abook.abv.ui.home.helper.ContentViewHelper
;
...
...
@@ -429,4 +444,34 @@ public class ParentWebViewActivity extends ABVContentViewActivity {
public
void
callViewLoadUrl
(
String
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
);
}
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment