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
40f44ee0
Commit
40f44ee0
authored
Feb 18, 2019
by
Lee Jaebin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ソース分離
parent
65919394
Hide whitespace changes
Inline
Side-by-side
Showing
29 changed files
with
28 additions
and
1259 deletions
+28
-1259
ABVJE_BL/src/jp/agentec/abook/abv/bl/acms/client/json/content/ActionInfoJSON.java
+27
-32
ABVJE_BL/src/jp/agentec/abook/abv/bl/data/ABVDataCache.java
+0
-2
ABVJE_BL/src/jp/agentec/abook/abv/bl/dto/BeaconHistoryDto.java
+0
-28
ABVJE_BL/src/jp/agentec/abook/abv/bl/dto/DashBoardListDto.java
+0
-18
ABVJE_BL/src/jp/agentec/abook/abv/bl/dto/DashboardDto.java
+0
-24
ABVJE_BL/src/jp/agentec/abook/abv/bl/dto/LockDto.java
+0
-26
ABVJE_BL/src/jp/agentec/abook/abv/bl/dto/SiteDto.java
+0
-48
ABVJE_BL/src/jp/agentec/abook/abv/bl/logic/ContentObjectLogLogic.java
+0
-3
ABVJE_BL/src/jp/agentec/abook/abv/bl/logic/PushMessageLogic.java
+1
-1
ABVJE_BL/src/jp/agentec/adf/net/socket/ReceivePacketNotification.java
+0
-27
ABVJE_BL/src/jp/agentec/adf/net/socket/ServerService.java
+0
-115
ABVJE_BL/src/jp/agentec/adf/net/socket/SocketUtil.java
+0
-192
ABVJE_BL/src/jp/agentec/adf/net/socket/UdpReceiver.java
+0
-117
ABVJE_BL/test/jp/agentec/abook/abv/bl/data/dao/BeaconHistoryDaoTest.java
+0
-63
ABVJE_BL/test/jp/agentec/abook/abv/bl/data/dao/SiteDaoTest.java
+0
-56
ABVJE_BL/test/jp/agentec/abook/abv/bl/data/dao/SubscriptionHistoryDaoTest.java
+0
-113
ABVJE_Launcher_Android/AndroidManifest.xml
+0
-13
ABVJE_UI_Android/res/layout/ac_enquete_webview.xml
+0
-7
ABVJE_UI_Android/res/layout/ac_html_webview.xml
+0
-7
ABVJE_UI_Android/res/layout/ac_html_xwalk.xml
+0
-7
ABVJE_UI_Android/src/jp/agentec/abook/abv/launcher/android/OnBootReceiver.java
+0
-25
ABVJE_UI_Android/src/jp/agentec/abook/abv/ui/common/activity/ABVAuthenticatedActivity.java
+0
-84
ABVJE_UI_Android/src/jp/agentec/abook/abv/ui/common/activity/ABVContentViewActivity.java
+0
-40
ABVJE_UI_Android/src/jp/agentec/abook/abv/ui/common/appinfo/AppDefType.java
+0
-10
ABVJE_UI_Android/src/jp/agentec/abook/abv/ui/common/appinfo/options/DefaultOptions.java
+0
-49
ABVJE_UI_Android/src/jp/agentec/abook/abv/ui/common/appinfo/options/LargeOptions.java
+0
-51
ABVJE_UI_Android/src/jp/agentec/abook/abv/ui/common/appinfo/options/MidOptions.java
+0
-51
ABVJE_UI_Android/src/jp/agentec/abook/abv/ui/viewer/activity/ContentViewActivity.java
+0
-24
ABVJE_UI_Android/src/jp/agentec/abook/abv/ui/viewer/activity/HTMLXWalkWebViewActivity.java
+0
-26
No files found.
ABVJE_BL/src/jp/agentec/abook/abv/bl/acms/client/json/content/ActionInfoJSON.java
View file @
40f44ee0
...
@@ -24,7 +24,6 @@ public class ActionInfoJSON extends AbstractJSON {
...
@@ -24,7 +24,6 @@ public class ActionInfoJSON extends AbstractJSON {
public
static
final
int
CONTENTLINK_ACTION
=
10
;
public
static
final
int
CONTENTLINK_ACTION
=
10
;
public
static
final
int
HTML_ACTION
=
11
;
public
static
final
int
HTML_ACTION
=
11
;
public
static
final
int
ENQUETE_ACTION
=
12
;
public
static
final
int
ENQUETE_ACTION
=
12
;
public
static
final
int
BEACON_ACTION
=
13
;
public
static
final
int
EXAM_ACTION
=
14
;
public
static
final
int
EXAM_ACTION
=
14
;
public
static
final
int
QUIZ_ACTION
=
15
;
// TBD
public
static
final
int
QUIZ_ACTION
=
15
;
// TBD
...
@@ -222,7 +221,7 @@ public class ActionInfoJSON extends AbstractJSON {
...
@@ -222,7 +221,7 @@ public class ActionInfoJSON extends AbstractJSON {
// public String getContentName() {
// public String getContentName() {
// return JsonUtil.getString(root, "contentName");
// return JsonUtil.getString(root, "contentName");
// }
// }
//
//
// /**
// /**
// * CONTENTLINK_ACTION(10)
// * CONTENTLINK_ACTION(10)
// * @return
// * @return
...
@@ -230,7 +229,31 @@ public class ActionInfoJSON extends AbstractJSON {
...
@@ -230,7 +229,31 @@ public class ActionInfoJSON extends AbstractJSON {
// public long getContractContentId() {
// public long getContractContentId() {
// return JsonUtil.getLong(root, "contractContentId");
// return JsonUtil.getLong(root, "contractContentId");
// }
// }
// public String getObjectName() { // null可
// return JsonUtil.getString(root, "objectName", "");
// }
// public String getContentName() {
// return JsonUtil.getString(root, "contentName");
// }
//
// public int getContractContentId() {
// return root.getInt("contractContentId");
// }
//
// public String getContentURL() {
// return JsonUtil.getString(root, "contentURL");
// }
//
// public long getMajor() {
// return JsonUtil.getLong(root, "major");
// }
//
// public long getMinor() {
// return JsonUtil.getLong(root, "minor");
// }
/**
/**
* ENQUETE_ACTION(12)
* ENQUETE_ACTION(12)
* @return
* @return
...
@@ -254,11 +277,7 @@ public class ActionInfoJSON extends AbstractJSON {
...
@@ -254,11 +277,7 @@ public class ActionInfoJSON extends AbstractJSON {
public
long
getObjectId
()
{
// 旧フォーマットではなしなのでデフォルト0に。-1はコンテンツを識別するのに使用しているので0にする。
public
long
getObjectId
()
{
// 旧フォーマットではなしなのでデフォルト0に。-1はコンテンツを識別するのに使用しているので0にする。
return
JsonUtil
.
getLong
(
root
,
"objectId"
,
0
);
return
JsonUtil
.
getLong
(
root
,
"objectId"
,
0
);
}
}
public
String
getObjectName
()
{
// null可
return
JsonUtil
.
getString
(
root
,
"objectName"
,
""
);
}
public
String
getEnquete
()
{
public
String
getEnquete
()
{
String
fileName
=
root
.
getString
(
"enquete"
);
// 空は不可
String
fileName
=
root
.
getString
(
"enquete"
);
// 空は不可
if
(
fileName
.
equals
(
""
))
{
if
(
fileName
.
equals
(
""
))
{
...
@@ -271,31 +290,7 @@ public class ActionInfoJSON extends AbstractJSON {
...
@@ -271,31 +290,7 @@ public class ActionInfoJSON extends AbstractJSON {
public
String
getQuestionNo
()
{
// デフォルト"0"
public
String
getQuestionNo
()
{
// デフォルト"0"
return
JsonUtil
.
getString
(
root
,
"questionNo"
,
"0"
);
return
JsonUtil
.
getString
(
root
,
"questionNo"
,
"0"
);
}
}
/**
* BEACON_ACTION(13)
* @return
*/
public
String
getContentName
()
{
return
JsonUtil
.
getString
(
root
,
"contentName"
);
}
public
int
getContractContentId
()
{
return
root
.
getInt
(
"contractContentId"
);
}
public
String
getContentURL
()
{
return
JsonUtil
.
getString
(
root
,
"contentURL"
);
}
public
long
getMajor
()
{
return
JsonUtil
.
getLong
(
root
,
"major"
);
}
public
long
getMinor
()
{
return
JsonUtil
.
getLong
(
root
,
"minor"
);
}
public
int
getShowResult
()
{
public
int
getShowResult
()
{
return
root
.
getInt
(
"showResult"
);
return
root
.
getInt
(
"showResult"
);
}
}
...
...
ABVJE_BL/src/jp/agentec/abook/abv/bl/data/ABVDataCache.java
View file @
40f44ee0
...
@@ -6,7 +6,6 @@ import java.util.Collections;
...
@@ -6,7 +6,6 @@ import java.util.Collections;
import
java.util.Date
;
import
java.util.Date
;
import
java.util.List
;
import
java.util.List
;
import
jp.agentec.abook.abv.bl.acms.type.DeliveryType
;
import
jp.agentec.abook.abv.bl.acms.type.LoginStatus
;
import
jp.agentec.abook.abv.bl.acms.type.LoginStatus
;
import
jp.agentec.abook.abv.bl.acms.type.SecurityPolicyType
;
import
jp.agentec.abook.abv.bl.acms.type.SecurityPolicyType
;
import
jp.agentec.abook.abv.bl.acms.type.ServiceOption.ServiceOptionId
;
import
jp.agentec.abook.abv.bl.acms.type.ServiceOption.ServiceOptionId
;
...
@@ -16,7 +15,6 @@ import jp.agentec.abook.abv.bl.data.dao.AbstractDao;
...
@@ -16,7 +15,6 @@ import jp.agentec.abook.abv.bl.data.dao.AbstractDao;
import
jp.agentec.abook.abv.bl.data.dao.AcmsDao
;
import
jp.agentec.abook.abv.bl.data.dao.AcmsDao
;
import
jp.agentec.abook.abv.bl.data.dao.MemberInfoDao
;
import
jp.agentec.abook.abv.bl.data.dao.MemberInfoDao
;
import
jp.agentec.abook.abv.bl.data.dao.ServiceOptionDao
;
import
jp.agentec.abook.abv.bl.data.dao.ServiceOptionDao
;
import
jp.agentec.abook.abv.bl.dto.DashboardDto
;
import
jp.agentec.abook.abv.bl.dto.MemberInfoDto
;
import
jp.agentec.abook.abv.bl.dto.MemberInfoDto
;
import
jp.agentec.abook.abv.bl.dto.ServiceOptionDto
;
import
jp.agentec.abook.abv.bl.dto.ServiceOptionDto
;
import
jp.agentec.abook.abv.bl.logic.ContractLogic
;
import
jp.agentec.abook.abv.bl.logic.ContractLogic
;
...
...
ABVJE_BL/src/jp/agentec/abook/abv/bl/dto/BeaconHistoryDto.java
deleted
100644 → 0
View file @
65919394
package
jp
.
agentec
.
abook
.
abv
.
bl
.
dto
;
import
java.util.Date
;
public
class
BeaconHistoryDto
extends
AbstractDto
{
public
int
beaconHistoryId
;
public
int
major
;
public
int
minor
;
public
Date
insertDate
;
public
Date
updateDate
;
@Override
public
String
[]
getKeyValues
()
{
return
new
String
[]
{
""
+
beaconHistoryId
};
}
@Override
public
Object
[]
getInsertValues
()
{
return
new
Object
[]
{
beaconHistoryId
,
major
,
minor
,
insertDate
,
updateDate
};
}
@Override
public
Object
[]
getUpdateValues
()
{
return
new
Object
[]
{
updateDate
,
major
,
minor
};
}
}
\ No newline at end of file
ABVJE_BL/src/jp/agentec/abook/abv/bl/dto/DashBoardListDto.java
deleted
100644 → 0
View file @
65919394
package
jp
.
agentec
.
abook
.
abv
.
bl
.
dto
;
import
java.util.List
;
/**
* DashBaordList 저장
* @author Chae
* @version 1.0.0
*/
public
class
DashBoardListDto
{
public
int
listId
;
public
String
listName
;
public
String
item
;
public
boolean
checked
;
public
List
<
List
<
ContentDto
>>
contentList
;
public
int
lastViewPage
=
0
;
}
ABVJE_BL/src/jp/agentec/abook/abv/bl/dto/DashboardDto.java
deleted
100644 → 0
View file @
65919394
package
jp
.
agentec
.
abook
.
abv
.
bl
.
dto
;
/**
* 대쉬보드 dto
* @author cym
* @version 1.0.0
*/
public
class
DashboardDto
{
public
String
type
;
public
int
status
;
public
int
dispOrder
;
public
int
genreId
;
public
DashboardDto
()
{
}
public
DashboardDto
(
String
type
,
int
status
,
int
dispOrder
,
int
genreId
)
{
this
.
type
=
type
;
this
.
status
=
status
;
this
.
dispOrder
=
dispOrder
;
this
.
genreId
=
genreId
;
}
}
ABVJE_BL/src/jp/agentec/abook/abv/bl/dto/LockDto.java
deleted
100644 → 0
View file @
65919394
package
jp
.
agentec
.
abook
.
abv
.
bl
.
dto
;
import
java.util.Date
;
/**
* ロック情報を格納します。
* @author Minhyuk Seok
* @version 1.0.0
*/
public
class
LockDto
extends
AbstractDto
{
public
int
folderId
;
public
int
folderPosition
;
public
byte
[]
prevFolderList
;
public
Date
insertDate
;
@Override
public
Object
[]
getInsertValues
()
{
return
new
Object
[]{
folderId
,
folderPosition
,
prevFolderList
,
insertDate
};
}
@Override
public
String
[]
getKeyValues
()
{
return
new
String
[]{
""
+
folderId
};
}
}
ABVJE_BL/src/jp/agentec/abook/abv/bl/dto/SiteDto.java
deleted
100644 → 0
View file @
65919394
package
jp
.
agentec
.
abook
.
abv
.
bl
.
dto
;
import
java.util.Date
;
public
class
SiteDto
extends
AbstractDto
{
public
Integer
siteId
;
public
String
siteUrl
;
public
String
siteName
;
public
String
downloadUrl
;
public
String
logSendUrl
;
public
String
enqueteSendUrl
;
public
Integer
delFlg
;
public
Date
insertDate
;
public
Date
updateDate
;
public
SiteDto
()
{
}
public
SiteDto
(
Integer
siteId
,
String
siteUrl
,
String
siteName
,
String
downloadUrl
,
String
logSendUrl
,
String
enqueteSendUrl
,
Integer
delFlg
,
Date
insertDate
,
Date
updateDate
)
{
super
();
this
.
siteId
=
siteId
;
this
.
siteUrl
=
siteUrl
;
this
.
siteName
=
siteName
;
this
.
downloadUrl
=
downloadUrl
;
this
.
logSendUrl
=
logSendUrl
;
this
.
enqueteSendUrl
=
enqueteSendUrl
;
this
.
delFlg
=
delFlg
;
this
.
insertDate
=
insertDate
;
this
.
updateDate
=
updateDate
;
}
@Override
public
String
[]
getKeyValues
()
{
return
new
String
[]{
""
+
siteId
};
}
@Override
public
Object
[]
getInsertValues
()
{
return
new
Object
[]{
siteId
,
siteUrl
,
siteName
,
downloadUrl
,
logSendUrl
,
enqueteSendUrl
,
delFlg
,
insertDate
,
updateDate
};
}
@Override
public
Object
[]
getUpdateValues
()
{
return
new
Object
[]{
siteUrl
,
siteName
,
downloadUrl
,
logSendUrl
,
enqueteSendUrl
,
delFlg
,
insertDate
,
updateDate
,
siteId
};
}
}
ABVJE_BL/src/jp/agentec/abook/abv/bl/logic/ContentObjectLogLogic.java
View file @
40f44ee0
...
@@ -150,9 +150,6 @@ public class ContentObjectLogLogic extends AbstractLogic {
...
@@ -150,9 +150,6 @@ public class ContentObjectLogLogic extends AbstractLogic {
case
ActionInfoJSON
.
HTML_ACTION
:
case
ActionInfoJSON
.
HTML_ACTION
:
actionValue
=
actionInfoJSON
.
getHtml
()
+
".zip"
;
actionValue
=
actionInfoJSON
.
getHtml
()
+
".zip"
;
break
;
break
;
case
ActionInfoJSON
.
BEACON_ACTION
:
actionValue
=
""
+
actionInfoJSON
.
getContentURL
();
break
;
case
ActionInfoJSON
.
CONTENTLINK_ACTION
:
case
ActionInfoJSON
.
CONTENTLINK_ACTION
:
actionValue
=
""
+
actionInfoJSON
.
getContentId
();
actionValue
=
""
+
actionInfoJSON
.
getContentId
();
break
;
break
;
...
...
ABVJE_BL/src/jp/agentec/abook/abv/bl/logic/PushMessageLogic.java
View file @
40f44ee0
...
@@ -45,7 +45,7 @@ public class PushMessageLogic extends AbstractLogic {
...
@@ -45,7 +45,7 @@ public class PushMessageLogic extends AbstractLogic {
AcmsMessageJSON
json
=
AcmsClient
.
getInstance
(
cache
.
getUrlPath
(),
networkAdapter
).
sendPushMessageRequest
(
param
);
AcmsMessageJSON
json
=
AcmsClient
.
getInstance
(
cache
.
getUrlPath
(),
networkAdapter
).
sendPushMessageRequest
(
param
);
Logger
.
d
(
TAG
,
" status="
+
json
.
httpStatus
);
Logger
.
d
(
TAG
,
" status="
+
json
.
httpStatus
);
if
(
json
.
httpStatus
==
ABookKeys
.
HTTP_STATUS_SUCCESS
)
{
if
(
json
.
httpStatus
==
ABookKeys
.
HTTP_STATUS_SUCCESS
)
{
Logger
.
e
(
TAG
,
"sendPushMessageRequest httpStatus="
+
json
.
httpStatus
);
Logger
.
v
(
TAG
,
"sendPushMessageRequest httpStatus="
+
json
.
httpStatus
);
return
true
;
return
true
;
}
}
return
false
;
return
false
;
...
...
ABVJE_BL/src/jp/agentec/adf/net/socket/ReceivePacketNotification.java
deleted
100644 → 0
View file @
65919394
package
jp
.
agentec
.
adf
.
net
.
socket
;
import
java.net.InetAddress
;
public
class
ReceivePacketNotification
{
public
InetAddress
address
;
public
int
port
;
public
String
msg
;
public
ReceivePacketNotification
(
InetAddress
address
,
int
port
,
String
msg
)
{
this
.
address
=
address
;
this
.
port
=
port
;
this
.
msg
=
msg
;
}
@Override
public
String
toString
()
{
return
address
+
":"
+
port
+
" : "
+
msg
;
}
@Override
public
boolean
equals
(
Object
o
)
{
ReceivePacketNotification
target
=
(
ReceivePacketNotification
)
o
;
return
(
address
+
":"
+
msg
).
equals
(
target
.
address
+
":"
+
target
.
msg
);
// 発信側ポートは常に変わるので無視
}
}
ABVJE_BL/src/jp/agentec/adf/net/socket/ServerService.java
deleted
100644 → 0
View file @
65919394
package
jp
.
agentec
.
adf
.
net
.
socket
;
import
java.io.BufferedReader
;
import
java.io.IOException
;
import
java.io.InputStreamReader
;
import
java.net.ServerSocket
;
import
java.net.Socket
;
import
java.util.Observable
;
import
jp.agentec.abook.abv.bl.common.CommonExecutor
;
import
jp.agentec.abook.abv.bl.common.log.Logger
;
/**
* ServerSocketをラップしたクラス
* 特徴:
* ・String(1行の文字列)ベースでSocket通信を行うことを想定
* ・来た文字列はそのままReceivePacketNotificationにラップしてObserverに通知する
* 例外が発生した場合、ExceptionをObserverに通知する。
* ・Threadで常時起動
*
* @author tsukada
*
*/
public
class
ServerService
extends
Observable
{
private
static
final
String
TAG
=
"ServerService"
;
private
ServerSocket
serverSocket
=
null
;
private
boolean
keep
=
true
;
private
int
port
;
private
Thread
thread
;
public
ServerService
(
int
port
)
{
this
.
port
=
port
;
}
private
Runnable
runnable
=
new
Runnable
()
{
@Override
public
void
run
()
{
try
{
serverSocket
=
new
ServerSocket
(
port
);
Logger
.
i
(
TAG
,
SocketUtil
.
getDebugInfo
(
serverSocket
));
}
catch
(
IOException
e
)
{
Logger
.
e
(
TAG
,
"new ServerSocket failed. "
+
port
,
e
);
setChanged
();
notifyObservers
(
e
);
return
;
}
while
(
keep
)
{
try
{
final
Socket
socket
=
serverSocket
.
accept
();
Logger
.
i
(
TAG
,
SocketUtil
.
getDebugInfo
(
socket
));
CommonExecutor
.
execute
(
new
Runnable
()
{
@Override
public
void
run
()
{
try
{
BufferedReader
input
=
new
BufferedReader
(
new
InputStreamReader
(
socket
.
getInputStream
()));
setChanged
();
notifyObservers
(
new
ReceivePacketNotification
(
socket
.
getInetAddress
(),
socket
.
getPort
(),
input
.
readLine
()));
}
catch
(
IOException
e
)
{
Logger
.
e
(
TAG
,
"socket read failed."
,
e
);
}
}
});
}
catch
(
IOException
e
)
{
if
(
keep
)
{
setChanged
();
notifyObservers
(
e
);
Logger
.
e
(
TAG
,
"serverSocket.accept failed."
,
e
);
}
if
(
serverSocket
.
isClosed
())
{
break
;
}
}
}
}
};
public
boolean
isRunning
()
{
return
thread
!=
null
&&
thread
.
isAlive
()
&&
serverSocket
!=
null
&&
!
serverSocket
.
isClosed
();
}
public
void
stopAll
()
{
keep
=
false
;
try
{
if
(
thread
!=
null
)
{
thread
.
interrupt
();
}
}
catch
(
Exception
e
)
{
}
try
{
if
(
serverSocket
!=
null
)
{
serverSocket
.
close
();
}
}
catch
(
Exception
e
)
{
}
deleteObservers
();
}
public
void
startThread
()
{
if
(
thread
==
null
||
!
thread
.
isAlive
())
{
keep
=
true
;
thread
=
new
Thread
(
runnable
);
}
try
{
thread
.
start
();
}
catch
(
IllegalThreadStateException
e
)
{
// ignore
}
}
}
ABVJE_BL/src/jp/agentec/adf/net/socket/SocketUtil.java
deleted
100644 → 0
View file @
65919394
package
jp
.
agentec
.
adf
.
net
.
socket
;
import
java.io.BufferedWriter
;
import
java.io.IOException
;
import
java.io.OutputStreamWriter
;
import
java.io.PrintWriter
;
import
java.net.DatagramPacket
;
import
java.net.DatagramSocket
;
import
java.net.InetAddress
;
import
java.net.InetSocketAddress
;
import
java.net.InterfaceAddress
;
import
java.net.NetworkInterface
;
import
java.net.ServerSocket
;
import
java.net.Socket
;
import
java.net.SocketException
;
import
java.net.UnknownHostException
;
import
java.util.Enumeration
;
import
jp.agentec.abook.abv.bl.common.log.Logger
;
public
class
SocketUtil
{
private
static
final
String
TAG
=
"SocketUtil"
;
private
static
InetAddress
ALL_BROADCAST_ADDRESS
;
static
{
try
{
System
.
setProperty
(
"java.net.preferIPv4Stack"
,
"true"
);
ALL_BROADCAST_ADDRESS
=
InetAddress
.
getByName
(
"255.255.255.255"
);
}
catch
(
UnknownHostException
e
)
{
Logger
.
e
(
TAG
,
"set ALL_BROADCAST_ADDRESS failed."
,
e
);
}
}
/**
* UDPパケットをブロードキャストする
*
* @param port ポート番号
* @param msg メッセージ
* @param isSameNetwork 同一ネットワークのみか全てか(ルータが対応していればルータ越え可能)
* @throws IOException
*/
public
static
void
sendUdpBroadcast
(
int
port
,
String
msg
,
boolean
isSameNetwork
)
throws
IOException
{
InetAddress
address
=
isSameNetwork
?
getLocalIpAddress
(
true
):
ALL_BROADCAST_ADDRESS
;
sendUdpPacket
(
address
,
port
,
msg
,
true
);
}
/**
* UDPパケットを送信する
*
* @param address
* @param port
* @param msg
* @param isBroadcast
* @throws IOException
*/
public
static
void
sendUdpPacket
(
InetAddress
address
,
int
port
,
String
msg
,
boolean
isBroadcast
)
throws
IOException
{
DatagramSocket
socket
=
null
;
try
{
socket
=
new
DatagramSocket
(
null
);
socket
.
setReuseAddress
(
true
);
socket
.
setBroadcast
(
isBroadcast
);
socket
.
bind
(
new
InetSocketAddress
(
0
));
byte
[]
buf
=
msg
.
getBytes
();
DatagramPacket
packet
=
new
DatagramPacket
(
buf
,
buf
.
length
,
address
,
port
);
socket
.
send
(
packet
);
}
finally
{
if
(
socket
!=
null
)
{
try
{
socket
.
close
();
}
catch
(
Exception
e
)
{
}
}
}
}
/**
* UDPソケットを作成する。
*
* @param port
* @return
*/
public
static
DatagramSocket
createDatagramSocket
(
int
port
)
{
try
{
DatagramSocket
socket
=
new
DatagramSocket
(
null
);
socket
.
setReuseAddress
(
true
);
socket
.
setBroadcast
(
true
);
socket
.
bind
(
new
InetSocketAddress
(
port
));
return
socket
;
}
catch
(
SocketException
e
)
{
Logger
.
e
(
TAG
,
"createDatagramSocket failed."
,
e
);
}
return
null
;
}
/**
* IPアドレスを取得します。(最初に見つかったアドレスを返す)
*
* @param isBroadcast trueにするとブロードキャストアドレスを、falseにするとローカルアドレスを返します。
* @return ブロードキャストアドレスを返します。nullの場合もあります。
* @throws SocketException
*/
public
static
InetAddress
getLocalIpAddress
(
boolean
isBroadcast
)
throws
SocketException
{
Enumeration
<
NetworkInterface
>
interfaces
=
NetworkInterface
.
getNetworkInterfaces
();
while
(
interfaces
.
hasMoreElements
())
{
NetworkInterface
networkInterface
=
interfaces
.
nextElement
();
if
(!
networkInterface
.
isLoopback
())
{
for
(
InterfaceAddress
address
:
networkInterface
.
getInterfaceAddresses
())
{
if
(
address
.
getBroadcast
()
!=
null
)
{
if
(
isBroadcast
)
{
return
address
.
getBroadcast
();
}
else
{
return
address
.
getAddress
();
}
}
}
}
}
return
null
;
}
/**
* 宛先にメッセージを送信する(TCP)
*
* @param address
* @param port
* @param msg
* @throws IOException
*/
public
static
void
sendTcpMessage
(
InetAddress
address
,
int
port
,
String
msg
)
throws
IOException
{
Socket
socket
=
null
;
PrintWriter
out
=
null
;
try
{
socket
=
new
Socket
(
address
,
port
);
if
(
socket
.
isConnected
())
{
out
=
new
PrintWriter
(
new
BufferedWriter
(
new
OutputStreamWriter
(
socket
.
getOutputStream
())),
true
);
out
.
println
(
msg
);
}
}
finally
{
if
(
out
!=
null
)
{
out
.
close
();
}
if
(
socket
!=
null
)
{
try
{
socket
.
close
();
}
catch
(
IOException
e
)
{
}
}
}
}
public
static
String
getDebugInfo
(
DatagramSocket
socket
)
{
if
(
socket
==
null
)
{
return
null
;
}
try
{
return
String
.
format
(
"Socket Info: inetAddress=%s, localSocketAddress=%s, remoteSocketAddress=%s, soTimeout=%s"
,
socket
.
getInetAddress
(),
socket
.
getLocalSocketAddress
(),
socket
.
getRemoteSocketAddress
(),
socket
.
getSoTimeout
());
}
catch
(
SocketException
e
)
{
Logger
.
e
(
TAG
,
"getDebugInfo error."
,
e
);
return
null
;
}
}
public
static
String
getDebugInfo
(
ServerSocket
socket
)
{
if
(
socket
==
null
)
{
return
null
;
}
try
{
return
String
.
format
(
"Socket Info: inetAddress=%s, localSocketAddress=%s, soTimeout=%s"
,
socket
.
getInetAddress
(),
socket
.
getLocalSocketAddress
(),
socket
.
getSoTimeout
());
}
catch
(
IOException
e
)
{
Logger
.
e
(
TAG
,
"getDebugInfo error."
,
e
);
}
return
null
;
}
public
static
String
getDebugInfo
(
Socket
socket
)
{
if
(
socket
==
null
)
{
return
null
;
}
try
{
return
String
.
format
(
"Socket Info: inetAddress=%s, localSocketAddress=%s, remoteSocketAddress=%s, soTimeout=%s"
,
socket
.
getInetAddress
(),
socket
.
getLocalSocketAddress
(),
socket
.
getRemoteSocketAddress
(),
socket
.
getSoTimeout
());
}
catch
(
IOException
e
)
{
Logger
.
e
(
TAG
,
"getDebugInfo error."
,
e
);
}
return
null
;
}
}
ABVJE_BL/src/jp/agentec/adf/net/socket/UdpReceiver.java
deleted
100644 → 0
View file @
65919394
package
jp
.
agentec
.
adf
.
net
.
socket
;
import
java.net.DatagramPacket
;
import
java.net.DatagramSocket
;
import
java.net.SocketException
;
import
java.util.Observable
;
import
jp.agentec.abook.abv.bl.common.log.Logger
;
import
jp.agentec.adf.util.StringUtil
;
/**
* UDPレシーバクラス
*
* 特徴:
* ・StringベースでSocket通信を行うことを想定
* ・来た文字列はそのままReceivePacketNotificationにラップしてObserverに通知する
* 例外が発生した場合、ExceptionをObserverに通知する。
* ・Threadで常時起動
*
* @author tsukada
*
*/
public
class
UdpReceiver
extends
Observable
{
private
static
final
String
TAG
=
"UdpReceiver"
;
private
DatagramSocket
socket
=
null
;
private
boolean
keep
=
true
;
private
int
port
;
private
Thread
thread
;
public
UdpReceiver
(
int
port
)
{
this
.
port
=
port
;
}
private
Runnable
runnable
=
new
Runnable
()
{
@Override
public
void
run
()
{
byte
[]
buf
=
new
byte
[
256
];
try
{
socket
=
SocketUtil
.
createDatagramSocket
(
port
);
DatagramPacket
packet
=
new
DatagramPacket
(
buf
,
buf
.
length
);
Logger
.
i
(
TAG
,
"UdpReceiver started. "
+
SocketUtil
.
getDebugInfo
(
socket
));
while
(
keep
)
{
packet
.
setLength
(
buf
.
length
);
socket
.
receive
(
packet
);
String
msg
=
new
String
(
packet
.
getData
(),
0
,
packet
.
getLength
());
Logger
.
d
(
TAG
,
"receive message. from=%s, msg=%s"
,
packet
.
getSocketAddress
(),
msg
);
if
(
StringUtil
.
isNullOrWhiteSpace
(
msg
))
{
continue
;
}
else
{
setChanged
();
notifyObservers
(
new
ReceivePacketNotification
(
packet
.
getAddress
(),
packet
.
getPort
(),
msg
));
}
}
}
catch
(
SocketException
e
)
{
if
(
keep
)
{
Logger
.
e
(
"UdpReceiver encounter error."
,
e
);
setChanged
();
notifyObservers
(
e
);
}
else
{
Logger
.
i
(
"UdpReceiver already closed."
);
}
}
catch
(
Exception
e
)
{
Logger
.
e
(
"UdpReceiver encounter error."
,
e
);
setChanged
();
notifyObservers
(
e
);
}
finally
{
closeSocket
();
}
}
};
public
boolean
isRunning
()
{
return
thread
!=
null
&&
thread
.
isAlive
()
&&
socket
!=
null
&&
!
socket
.
isClosed
();
}
public
void
stopAll
()
{
keep
=
false
;
try
{
if
(
thread
!=
null
)
{
thread
.
interrupt
();
}
}
catch
(
Exception
e
)
{
}
closeSocket
();
deleteObservers
();
}
private
void
closeSocket
()
{
try
{
if
(
socket
!=
null
)
{
socket
.
close
();
}
}
catch
(
Exception
e
)
{
}
}
public
void
startThread
()
{
if
(
thread
==
null
||
!
thread
.
isAlive
())
{
keep
=
true
;
thread
=
new
Thread
(
runnable
);
}
try
{
thread
.
start
();
}
catch
(
IllegalThreadStateException
e
)
{
// ignore
}
}
}
ABVJE_BL/test/jp/agentec/abook/abv/bl/data/dao/BeaconHistoryDaoTest.java
deleted
100644 → 0
View file @
65919394
package
jp
.
agentec
.
abook
.
abv
.
bl
.
data
.
dao
;
import
jp.agentec.abook.abv.bl.common.ABVEnvironment
;
import
jp.agentec.abook.abv.bl.common.db.SQLiteOpenHelper
;
import
jp.agentec.abook.abv.bl.common.db.impl.JDBCSQLiteOpenHelper
;
import
jp.agentec.abook.abv.bl.data.DBConnector
;
import
jp.agentec.abook.abv.bl.dto.BeaconHistoryDto
;
import
junit.framework.TestCase
;
import
junit.framework.TestSuite
;
public
class
BeaconHistoryDaoTest
extends
TestCase
{
private
BeaconHistoryDao
dao
=
new
BeaconHistoryDao
();
public
BeaconHistoryDaoTest
(
String
string
)
{
super
(
string
);
}
@Override
protected
void
setUp
()
throws
Exception
{
super
.
setUp
();
ABVEnvironment
.
getInstance
().
isReader
=
true
;
DBConnector
conn
=
DBConnector
.
getInstance
();
SQLiteOpenHelper
sqlLiteOpenHelper
=
new
JDBCSQLiteOpenHelper
(
"test.db"
,
0
);
conn
.
setSqlLiteOpenHelper
(
sqlLiteOpenHelper
);
((
JDBCSQLiteOpenHelper
)
sqlLiteOpenHelper
).
onCreate
(
conn
.
getDatabase
());
}
public
static
TestSuite
suite
()
{
TestSuite
suite
=
new
TestSuite
(
"BeaconHistoryDaoTest"
);
// suite.addTest(new BeaconHistoryDaoTest("testInsert"));
// suite.addTest(new BeaconHistoryDaoTest("testUpdate"));
suite
.
addTest
(
new
BeaconHistoryDaoTest
(
"testInsertOrUpdate"
));
return
suite
;
}
@Override
protected
void
tearDown
()
throws
Exception
{
super
.
tearDown
();
}
public
void
testInsert
()
{
BeaconHistoryDto
dto
=
new
BeaconHistoryDto
();
dto
.
major
=
Integer
.
parseInt
(
"4F4F"
,
16
);
dto
.
minor
=
Integer
.
parseInt
(
"5871"
,
16
);
dao
.
insert
(
dto
);
}
public
void
testUpdate
()
{
BeaconHistoryDto
dto
=
new
BeaconHistoryDto
();
dto
.
major
=
Integer
.
parseInt
(
"4F4F"
,
16
);
dto
.
minor
=
Integer
.
parseInt
(
"5871"
,
16
);
dao
.
update
(
dto
);
}
public
void
testInsertOrUpdate
()
{
BeaconHistoryDto
dto
=
new
BeaconHistoryDto
();
dto
.
major
=
Integer
.
parseInt
(
"4FAF"
,
16
);
dto
.
minor
=
Integer
.
parseInt
(
"5871"
,
16
);
dao
.
insertOrUpdate
(
dto
);
}
}
ABVJE_BL/test/jp/agentec/abook/abv/bl/data/dao/SiteDaoTest.java
deleted
100644 → 0
View file @
65919394
package
jp
.
agentec
.
abook
.
abv
.
bl
.
data
.
dao
;
import
java.util.Date
;
import
jp.agentec.abook.abv.bl.common.db.SQLiteOpenHelper
;
import
jp.agentec.abook.abv.bl.common.db.impl.JDBCSQLiteOpenHelper
;
import
jp.agentec.abook.abv.bl.data.DBConnector
;
import
jp.agentec.abook.abv.bl.dto.SiteDto
;
import
junit.framework.TestCase
;
public
class
SiteDaoTest
extends
TestCase
{
SiteDao
siteDao
=
AbstractDao
.
getDao
(
SiteDao
.
class
);
@Override
protected
void
setUp
()
throws
Exception
{
super
.
setUp
();
DBConnector
conn
=
DBConnector
.
getInstance
();
SQLiteOpenHelper
sqlLiteOpenHelper
=
new
JDBCSQLiteOpenHelper
(
"test.db"
,
0
);
conn
.
setSqlLiteOpenHelper
(
sqlLiteOpenHelper
);
((
JDBCSQLiteOpenHelper
)
sqlLiteOpenHelper
).
onCreate
(
conn
.
getDatabase
());
}
@Override
protected
void
tearDown
()
throws
Exception
{
super
.
tearDown
();
}
public
void
testInsert
()
throws
Exception
{
SiteDto
dto
=
new
SiteDto
(
1
,
"http://aaa"
,
"sitesss"
,
"http://aaa/d"
,
"http://aaa/l"
,
"http://aaa/e"
,
0
,
new
Date
(),
new
Date
());
siteDao
.
insert
(
dto
);
System
.
out
.
println
(
siteDao
.
getDto
(
2
).
siteUrl
);
}
public
void
testUpdate
()
throws
Exception
{
SiteDto
dto
=
new
SiteDto
(
1
,
"http://aaa/U"
,
"sitesssU"
,
"http://aaa/d"
,
"http://aaa/l"
,
"http://aaa/e/u"
,
0
,
new
Date
(),
new
Date
());
siteDao
.
update
(
dto
);
System
.
out
.
println
(
siteDao
.
getDto
(
1
).
siteUrl
);
}
public
void
testLastUpdate
()
throws
Exception
{
System
.
out
.
println
(
siteDao
.
getLastUpdate
());
}
public
void
testInsertOrUpdate
()
throws
Exception
{
SiteDto
dto
=
new
SiteDto
(
3
,
"http://aa33a222"
,
"sitesss"
,
"http://aaa/d"
,
"http://aaa/l"
,
"http://aaa/e"
,
0
,
new
Date
(),
new
Date
());
siteDao
.
insertOrUpdate
(
dto
);
}
public
void
testExists
()
throws
Exception
{
System
.
out
.
println
(
siteDao
.
exists
(
0
));
System
.
out
.
println
(
siteDao
.
exists
(
1
));
}
}
ABVJE_BL/test/jp/agentec/abook/abv/bl/data/dao/SubscriptionHistoryDaoTest.java
deleted
100644 → 0
View file @
65919394
package
jp
.
agentec
.
abook
.
abv
.
bl
.
data
.
dao
;
import
java.util.Date
;
import
jp.agentec.abook.abv.bl.common.db.SQLiteOpenHelper
;
import
jp.agentec.abook.abv.bl.common.db.impl.JDBCSQLiteOpenHelper
;
import
jp.agentec.abook.abv.bl.data.DBConnector
;
import
jp.agentec.abook.abv.bl.dto.SubscriptionHistoryDto
;
import
junit.framework.TestCase
;
public
class
SubscriptionHistoryDaoTest
extends
TestCase
{
SubscriptionHistoryDao
subscriptionHistoryDao
=
AbstractDao
.
getDao
(
SubscriptionHistoryDao
.
class
);
@Override
protected
void
setUp
()
throws
Exception
{
super
.
setUp
();
DBConnector
conn
=
DBConnector
.
getInstance
();
SQLiteOpenHelper
sqlLiteOpenHelper
=
new
JDBCSQLiteOpenHelper
(
"test.db"
,
0
);
conn
.
setSqlLiteOpenHelper
(
sqlLiteOpenHelper
);
((
JDBCSQLiteOpenHelper
)
sqlLiteOpenHelper
).
onCreate
(
conn
.
getDatabase
());
}
@Override
protected
void
tearDown
()
throws
Exception
{
super
.
tearDown
();
}
public
void
testInsert
()
throws
Exception
{
SubscriptionHistoryDto
dto
=
new
SubscriptionHistoryDto
();
dto
.
subscriptionHistoryId
=
1
;
dto
.
purchaseHistoryId
=
1L
;
dto
.
contentSetId
=
2
;
dto
.
contentSetName
=
"aaaa"
;
dto
.
allFlg
=
1
;
dto
.
productId
=
"aproductIdb"
;
dto
.
orderId
=
"aaorderId"
;
dto
.
packageName
=
"hoge.aaa"
;
dto
.
purchaseTime
=
1234L
;
dto
.
purchaseState
=
0
;
dto
.
developerPayload
=
"abaddsf"
;
dto
.
purchaseToken
=
"arerae"
;
dto
.
autoRenewing
=
true
;
dto
.
startTimeMillis
=
3456L
;
dto
.
expiryTimeMillis
=
78910L
;
dto
.
sentFlg
=
0
;
dto
.
delFlg
=
0
;
dto
.
insertDate
=
new
Date
();
dto
.
updateDate
=
new
Date
();
subscriptionHistoryDao
.
insert
(
dto
);
System
.
out
.
println
(
subscriptionHistoryDao
.
getDto
(
1
).
orderId
);
}
public
void
testUpdate
()
throws
Exception
{
SubscriptionHistoryDto
dto
=
new
SubscriptionHistoryDto
();
dto
.
subscriptionHistoryId
=
1
;
dto
.
purchaseHistoryId
=
1L
;
dto
.
contentSetId
=
2
;
dto
.
contentSetName
=
"bbbb"
;
dto
.
allFlg
=
1
;
dto
.
productId
=
"aproductIdb"
;
dto
.
orderId
=
"aaorderId"
;
dto
.
packageName
=
"hoge.aaa"
;
dto
.
purchaseTime
=
1234L
;
dto
.
purchaseState
=
0
;
dto
.
developerPayload
=
"abaddsf"
;
dto
.
purchaseToken
=
"arerae"
;
dto
.
autoRenewing
=
true
;
dto
.
startTimeMillis
=
3456L
;
dto
.
expiryTimeMillis
=
78910L
;
dto
.
sentFlg
=
0
;
dto
.
delFlg
=
0
;
dto
.
insertDate
=
new
Date
();
dto
.
updateDate
=
new
Date
();
subscriptionHistoryDao
.
update
(
dto
);
System
.
out
.
println
(
subscriptionHistoryDao
.
getDto
(
1
).
orderId
);
}
public
void
testLastUpdate
()
throws
Exception
{
System
.
out
.
println
(
subscriptionHistoryDao
.
getSubscriptionHistorMax
());
}
public
void
testInsertOrUpdate
()
throws
Exception
{
SubscriptionHistoryDto
dto
=
new
SubscriptionHistoryDto
();
dto
.
subscriptionHistoryId
=
1
;
dto
.
purchaseHistoryId
=
1L
;
dto
.
contentSetId
=
2
;
dto
.
contentSetName
=
"cccc"
;
dto
.
allFlg
=
1
;
dto
.
productId
=
"aproductIdb"
;
dto
.
orderId
=
"aaorderId"
;
dto
.
packageName
=
"hoge.aaa"
;
dto
.
purchaseTime
=
1234L
;
dto
.
purchaseState
=
0
;
dto
.
developerPayload
=
"abaddsf"
;
dto
.
purchaseToken
=
"arerae"
;
dto
.
autoRenewing
=
true
;
dto
.
startTimeMillis
=
3456L
;
dto
.
expiryTimeMillis
=
78910L
;
dto
.
sentFlg
=
0
;
dto
.
delFlg
=
0
;
dto
.
insertDate
=
new
Date
();
dto
.
updateDate
=
new
Date
();
subscriptionHistoryDao
.
insertOrUpdate
(
dto
);
}
public
void
testExists
()
throws
Exception
{
System
.
out
.
println
(
subscriptionHistoryDao
.
exists
(
"0"
));
System
.
out
.
println
(
subscriptionHistoryDao
.
exists
(
"1"
));
}
}
ABVJE_Launcher_Android/AndroidManifest.xml
View file @
40f44ee0
...
@@ -44,18 +44,6 @@
...
@@ -44,18 +44,6 @@
android:label=
"@string/app_name"
android:label=
"@string/app_name"
android:theme=
"@style/ABook"
android:theme=
"@style/ABook"
android:largeHeap=
"true"
>
android:largeHeap=
"true"
>
<service
android:name =
"jp.agentec.abook.abv.launcher.android.AutoDownloadService"
>
</service>
<receiver
android:name=
"jp.agentec.abook.abv.launcher.android.OnBootReceiver"
>
<intent-filter>
<action
android:name=
"android.intent.action.BOOT_COMPLETED"
/>
<action
android:name=
"android.intent.action.PACKAGE_REPLACED"
/>
<action
android:name=
"android.intent.action.ACTION_MY_PACKAGE_REPLACED"
/>
</intent-filter>
</receiver>
<service
android:name=
"jp.agentec.abook.abv.cl.push.ABVFcmListenerService"
>
<service
android:name=
"jp.agentec.abook.abv.cl.push.ABVFcmListenerService"
>
<intent-filter>
<intent-filter>
<action
android:name=
"com.google.firebase.MESSAGING_EVENT"
></action>
<action
android:name=
"com.google.firebase.MESSAGING_EVENT"
></action>
...
@@ -212,7 +200,6 @@
...
@@ -212,7 +200,6 @@
<action
android:name=
"android.intent.action.MAIN"
/>
<action
android:name=
"android.intent.action.MAIN"
/>
</intent-filter>
</intent-filter>
</activity>
</activity>
<!--Voip-->
<!-- ABookCheck対応 -->
<!-- ABookCheck対応 -->
<activity
android:name=
"jp.agentec.abook.abv.ui.home.activity.ProjectListActivity"
<activity
android:name=
"jp.agentec.abook.abv.ui.home.activity.ProjectListActivity"
...
...
ABVJE_UI_Android/res/layout/ac_enquete_webview.xml
View file @
40f44ee0
...
@@ -150,13 +150,6 @@
...
@@ -150,13 +150,6 @@
android:layout_height=
"match_parent"
android:layout_height=
"match_parent"
android:layout_marginLeft=
"0dp"
/>
android:layout_marginLeft=
"0dp"
/>
<FrameLayout
android:id=
"@+id/streamingLayout"
android:layout_width=
"match_parent"
android:layout_height=
"match_parent"
android:layout_marginLeft=
"0dp"
android:visibility=
"gone"
/>
<ProgressBar
<ProgressBar
android:id=
"@+id/refresh_prog"
android:id=
"@+id/refresh_prog"
style=
"?android:attr/progressBarStyleLarge"
style=
"?android:attr/progressBarStyleLarge"
...
...
ABVJE_UI_Android/res/layout/ac_html_webview.xml
View file @
40f44ee0
...
@@ -204,13 +204,6 @@
...
@@ -204,13 +204,6 @@
android:layout_height=
"match_parent"
android:layout_height=
"match_parent"
android:layout_marginLeft=
"0dp"
/>
android:layout_marginLeft=
"0dp"
/>
<FrameLayout
android:id=
"@+id/streamingLayout"
android:layout_width=
"match_parent"
android:layout_height=
"match_parent"
android:layout_marginLeft=
"0dp"
android:visibility=
"gone"
/>
<ProgressBar
<ProgressBar
android:id=
"@+id/refresh_prog"
android:id=
"@+id/refresh_prog"
style=
"?android:attr/progressBarStyleLarge"
style=
"?android:attr/progressBarStyleLarge"
...
...
ABVJE_UI_Android/res/layout/ac_html_xwalk.xml
View file @
40f44ee0
...
@@ -209,13 +209,6 @@
...
@@ -209,13 +209,6 @@
android:layout_height=
"match_parent"
android:layout_height=
"match_parent"
android:layout_marginLeft=
"0dp"
/>
android:layout_marginLeft=
"0dp"
/>
<FrameLayout
android:id=
"@+id/streamingLayout"
android:layout_width=
"match_parent"
android:layout_height=
"match_parent"
android:layout_marginLeft=
"0dp"
android:visibility=
"gone"
/>
<ProgressBar
<ProgressBar
android:id=
"@+id/refresh_prog"
android:id=
"@+id/refresh_prog"
style=
"?android:attr/progressBarStyleLarge"
style=
"?android:attr/progressBarStyleLarge"
...
...
ABVJE_UI_Android/src/jp/agentec/abook/abv/launcher/android/OnBootReceiver.java
deleted
100644 → 0
View file @
65919394
package
jp
.
agentec
.
abook
.
abv
.
launcher
.
android
;
import
java.util.Calendar
;
import
jp.agentec.abook.abv.bl.common.log.Logger
;
import
android.app.AlarmManager
;
import
android.app.PendingIntent
;
import
android.content.BroadcastReceiver
;
import
android.content.Context
;
import
android.content.Intent
;
import
android.content.res.Resources
;
// Booting시 자동적으로 서비스 시작을 하기 위한 부분
// アプリ起動時、PushServiceサービスを開始させる
public
class
OnBootReceiver
extends
BroadcastReceiver
{
@Override
public
void
onReceive
(
Context
context
,
Intent
intent
)
{
if
(
intent
.
getAction
().
equals
(
Intent
.
ACTION_BOOT_COMPLETED
)
||
intent
.
getAction
().
equals
(
Intent
.
ACTION_PACKAGE_REPLACED
)
||
intent
.
getAction
().
equals
(
Intent
.
ACTION_MY_PACKAGE_REPLACED
))
{
// 自動ダウンロードチェックの開始
// TODO later ABVNoAuthenticatedActivityとソース重複のため統一
Resources
res
=
context
.
getResources
();
}
}
}
\ No newline at end of file
ABVJE_UI_Android/src/jp/agentec/abook/abv/ui/common/activity/ABVAuthenticatedActivity.java
View file @
40f44ee0
...
@@ -759,90 +759,6 @@ public abstract class ABVAuthenticatedActivity extends ABVActivity implements Co
...
@@ -759,90 +759,6 @@ public abstract class ABVAuthenticatedActivity extends ABVActivity implements Co
public
abstract
boolean
contentValidCheckAndDownload
(
long
contentId
);
public
abstract
boolean
contentValidCheckAndDownload
(
long
contentId
);
/**
* Beacon共通ダイアログ表示
* @param contentId
* @param contentURL
* @param objectId
* @param xWalkView
* @return
*/
public
ABookAlertDialog
showBeacon
(
long
contentId
,
String
contentURL
,
final
long
objectId
,
final
XWalkView
xWalkView
)
{
Logger
.
d
(
TAG
,
"[ShowBeaconDialog]"
);
String
qrCodePath
=
ABVEnvironment
.
getInstance
().
getContentCacheDirectoryPath
(
contentId
)
+
"qrcode.jpg"
;
boolean
success
=
false
;
try
{
// QRコード生成
Bitmap
bitmap
=
BitmapUtil
.
createQrCode
(
contentURL
,
300
);
success
=
BitmapUtil
.
outputFile
(
bitmap
,
qrCodePath
,
true
);
// ファイル出力
}
catch
(
WriterException
e
)
{
Logger
.
e
(
TAG
,
"create QR Code failed."
,
e
);
return
null
;
}
if
(!
success
)
{
Logger
.
w
(
TAG
,
AndroidStringUtil
.
format
(
this
,
R
.
string
.
save_fail
,
R
.
string
.
show_qrcode_title
));
handleErrorMessageToast
(
AndroidStringUtil
.
format
(
this
,
R
.
string
.
save_fail
,
R
.
string
.
show_qrcode_title
));
return
null
;
}
final
WebView
beaconWebView
=
new
WebView
(
this
);
beaconWebView
.
setBackgroundColor
(
0
);
WebSettings
settings
=
beaconWebView
.
getSettings
();
settings
.
setLoadsImagesAutomatically
(
true
);
// イメージを自動的にロードする
settings
.
setJavaScriptEnabled
(
true
);
// JavaScriptを有効にする
settings
.
setAppCacheEnabled
(
false
);
settings
.
setCacheMode
(
WebSettings
.
LOAD_NO_CACHE
);
// HTMLファイルを読み込む
String
data
=
RawResourceUtil
.
readAsString
(
this
,
R
.
raw
.
beacon
);
if
(
data
!=
null
)
{
data
=
data
.
replaceAll
(
"%QRCODE_SRC%"
,
qrCodePath
);
// QRコードのパス置き換え
}
if
(
data
!=
null
)
{
data
=
data
.
replaceAll
(
"%URL%"
,
contentURL
);
}
FrameLayout
.
LayoutParams
paramWebView
=
new
FrameLayout
.
LayoutParams
(
ViewGroup
.
LayoutParams
.
WRAP_CONTENT
,
ViewGroup
.
LayoutParams
.
WRAP_CONTENT
);
paramWebView
.
gravity
=
Gravity
.
TOP
;
ScrollView
scroll
=
new
ScrollView
(
this
);
scroll
.
addView
(
beaconWebView
,
paramWebView
);
LinearLayout
layout
=
new
LinearLayout
(
this
);
layout
.
setBackgroundColor
(
Color
.
WHITE
);
layout
.
setLayoutParams
(
new
LinearLayout
.
LayoutParams
(
FP
,
FP
));
LinearLayout
.
LayoutParams
paramScroll
=
new
LinearLayout
.
LayoutParams
(
FP
,
FP
);
layout
.
addView
(
scroll
,
paramScroll
);
layout
.
setPadding
(
3
,
3
,
3
,
3
);
final
ABVContentViewActivity
contentViewActivity
=
activityHandlingHelper
.
getContentViewActivity
();
// Webビューを表示するアラート
ABookAlertDialog
dialog
=
new
ABookAlertDialog
(
this
)
{
@Override
public
boolean
dispatchTouchEvent
(
MotionEvent
ev
)
{
return
super
.
dispatchTouchEvent
(
ev
);
}
};
dialog
.
setCanceledOnTouchOutside
(
false
);
dialog
.
setView
(
layout
);
final
ABookAlertDialog
dialogF
=
dialog
;
beaconWebView
.
setWebViewClient
(
new
WebViewClient
()
{
@Override
public
void
onPageFinished
(
final
WebView
view
,
String
url
)
{
// HTMLのロードが終わったタイミングでアラートダイアログを表示する
super
.
onPageFinished
(
beaconWebView
,
url
);
dialogF
.
show
();
if
(
contentViewActivity
!=
null
&&
objectId
!=
-
1
)
{
contentViewActivity
.
objectIdPopupMap
.
put
(
objectId
,
dialogF
);
}
if
(
xWalkView
!=
null
)
{
// xWalkViewがnullではない場合、javaScriptでopengetitsshareコマンド実行
javaScriptSignageCmd
(
ABookKeys
.
CMD_GETITS_OPEN_SHARE
,
xWalkView
);
}
}
});
beaconWebView
.
loadDataWithBaseURL
(
"file:///android_res/raw/beacon.html"
,
data
,
"text/html"
,
"UTF-8"
,
null
);
return
dialog
;
}
public
void
startContentViewActivity
(
long
contentId
)
{
public
void
startContentViewActivity
(
long
contentId
)
{
startContentViewActivity
(
contentId
,
0
);
startContentViewActivity
(
contentId
,
0
);
}
}
...
...
ABVJE_UI_Android/src/jp/agentec/abook/abv/ui/common/activity/ABVContentViewActivity.java
View file @
40f44ee0
...
@@ -115,7 +115,6 @@ public abstract class ABVContentViewActivity extends ABVAuthenticatedActivity {
...
@@ -115,7 +115,6 @@ public abstract class ABVContentViewActivity extends ABVAuthenticatedActivity {
protected
ConcurrentHashMap
<
Long
,
Object
>
objectIdPopupMap
=
new
ConcurrentHashMap
<>();
protected
ConcurrentHashMap
<
Long
,
Object
>
objectIdPopupMap
=
new
ConcurrentHashMap
<>();
protected
int
mCurrentPageNumber
=
0
;
// 表示中のページ番号(0からスタート)
protected
int
mCurrentPageNumber
=
0
;
// 表示中のページ番号(0からスタート)
protected
ABookAlertDialog
beaconDialog
;
public
Long
mProjectId
;
public
Long
mProjectId
;
protected
int
mXWalkOpenType
=
-
1
;
protected
int
mXWalkOpenType
=
-
1
;
...
@@ -457,12 +456,6 @@ public abstract class ABVContentViewActivity extends ABVAuthenticatedActivity {
...
@@ -457,12 +456,6 @@ public abstract class ABVContentViewActivity extends ABVAuthenticatedActivity {
@Override
@Override
public
void
finish
()
{
public
void
finish
()
{
//Getits共有ダイアログを閉じる処理
if
(
beaconDialog
!=
null
)
{
beaconDialog
.
dismiss
();
beaconDialog
=
null
;
}
// ホームをリロードさせる
// ホームをリロードさせる
ActivityHandlingHelper
.
getInstance
().
setRequireHomeReload
(
true
);
ActivityHandlingHelper
.
getInstance
().
setRequireHomeReload
(
true
);
super
.
finish
();
super
.
finish
();
...
@@ -675,39 +668,6 @@ public abstract class ABVContentViewActivity extends ABVAuthenticatedActivity {
...
@@ -675,39 +668,6 @@ public abstract class ABVContentViewActivity extends ABVAuthenticatedActivity {
finish
();
finish
();
}
}
/**
* Getits共有ダイアログ
* @param contentURL
* @param webView
* @return
*/
public
ABookAlertDialog
getBeaconDialog
(
String
contentURL
,
final
WebView
webView
)
{
FrameLayout
.
LayoutParams
paramWebView
=
new
FrameLayout
.
LayoutParams
(
ViewGroup
.
LayoutParams
.
WRAP_CONTENT
,
ViewGroup
.
LayoutParams
.
WRAP_CONTENT
);
paramWebView
.
gravity
=
Gravity
.
TOP
;
ScrollView
scroll
=
new
ScrollView
(
this
);
scroll
.
addView
(
webView
,
paramWebView
);
LinearLayout
layout
=
new
LinearLayout
(
this
);
layout
.
setBackgroundColor
(
Color
.
WHITE
);
layout
.
setLayoutParams
(
new
LinearLayout
.
LayoutParams
(
FP
,
FP
));
LinearLayout
.
LayoutParams
paramScroll
=
new
LinearLayout
.
LayoutParams
(
FP
,
FP
);
layout
.
addView
(
scroll
,
paramScroll
);
layout
.
setPadding
(
3
,
3
,
3
,
3
);
// Webビューを表示するアラート
ABookAlertDialog
dialog
=
new
ABookAlertDialog
(
this
)
{
@Override
public
boolean
dispatchTouchEvent
(
MotionEvent
ev
)
{
return
super
.
dispatchTouchEvent
(
ev
);
}
};
dialog
.
setCanceledOnTouchOutside
(
false
);
dialog
.
setView
(
layout
);
return
dialog
;
}
protected
void
createCheckToolbar
()
{
protected
void
createCheckToolbar
()
{
final
RelativeLayout
fl
;
final
RelativeLayout
fl
;
if
(
projectDto
!=
null
&&
projectDto
.
projectType
==
ProjectType
.
PDF
&&
if
(
projectDto
!=
null
&&
projectDto
.
projectType
==
ProjectType
.
PDF
&&
...
...
ABVJE_UI_Android/src/jp/agentec/abook/abv/ui/common/appinfo/AppDefType.java
View file @
40f44ee0
...
@@ -3,11 +3,6 @@ package jp.agentec.abook.abv.ui.common.appinfo;
...
@@ -3,11 +3,6 @@ package jp.agentec.abook.abv.ui.common.appinfo;
public
interface
AppDefType
{
public
interface
AppDefType
{
String
APP_PACKAGE
=
"jp.agentec.abook.abv.launcher.android"
;
String
APP_PACKAGE
=
"jp.agentec.abook.abv.launcher.android"
;
interface
Intent
{
String
Action_Receive_iBeacon_Message
=
"jp.agentec.abook.action.Receive_iBeacon_Message"
;
String
Action_Receive_Message
=
"jp.agentec.abook.action.Receive_Message"
;
}
interface
ViewMode
{
interface
ViewMode
{
int
THUMB
=
1
;
int
THUMB
=
1
;
int
PANEL
=
2
;
int
PANEL
=
2
;
...
@@ -208,11 +203,6 @@ public interface AppDefType {
...
@@ -208,11 +203,6 @@ public interface AppDefType {
int
OBJECTVR_TYPE_ID
=
14
;
int
OBJECTVR_TYPE_ID
=
14
;
}
}
interface
BeaconKey
{
String
major
=
"major"
;
String
minor
=
"minor"
;
}
interface
PushMessageKey
{
interface
PushMessageKey
{
String
message
=
"message"
;
String
message
=
"message"
;
String
shareKey
=
"shareKey"
;
String
shareKey
=
"shareKey"
;
...
...
ABVJE_UI_Android/src/jp/agentec/abook/abv/ui/common/appinfo/options/DefaultOptions.java
deleted
100644 → 0
View file @
65919394
package
jp
.
agentec
.
abook
.
abv
.
ui
.
common
.
appinfo
.
options
;
import
android.content.Context
;
/**
* @author tauchi
*
*/
public
class
DefaultOptions
extends
AbstractOptions
{
public
DefaultOptions
(
Context
context
)
{
super
(
context
);
}
@Override
public
int
getSettingMenuAccount
()
{
return
1
;
}
@Override
public
int
getSettingMenuAppInfo
()
{
return
1
;
}
@Override
public
int
getSettingMenuLogout
()
{
return
0
;
}
@Override
public
int
getSettingMenuPasswordChange
()
{
return
0
;
}
@Override
public
int
getSettingMenuLogInfo
()
{
return
1
;
}
@Override
public
int
getViewerMenuTextcopy
()
{
return
0
;
}
@Override
public
int
getViewerMenuMarking
()
{
return
0
;
}
}
ABVJE_UI_Android/src/jp/agentec/abook/abv/ui/common/appinfo/options/LargeOptions.java
deleted
100644 → 0
View file @
65919394
package
jp
.
agentec
.
abook
.
abv
.
ui
.
common
.
appinfo
.
options
;
import
jp.agentec.abook.abv.bl.acms.type.ServiceOption.ServiceOptionId
;
import
jp.agentec.abook.abv.bl.data.ABVDataCache
;
import
android.content.Context
;
/**
* @author tauchi
*
*/
public
class
LargeOptions
extends
AbstractOptions
{
public
LargeOptions
(
Context
context
)
{
super
(
context
);
}
@Override
public
int
getSettingMenuAccount
()
{
return
1
;
}
@Override
public
int
getSettingMenuAppInfo
()
{
return
1
;
}
@Override
public
int
getSettingMenuLogout
()
{
return
1
;
}
@Override
public
int
getSettingMenuPasswordChange
()
{
return
1
;
}
@Override
public
int
getSettingMenuLogInfo
()
{
return
1
;
}
@Override
public
int
getViewerMenuTextcopy
()
{
return
ABVDataCache
.
getInstance
().
serviceOption
.
isServiceOptionEnable
(
ServiceOptionId
.
PdfTextCopy
)
?
1
:
0
;
}
@Override
public
int
getViewerMenuMarking
()
{
return
ABVDataCache
.
getInstance
().
serviceOption
.
isMarking
()
?
1
:
0
;
}
}
ABVJE_UI_Android/src/jp/agentec/abook/abv/ui/common/appinfo/options/MidOptions.java
deleted
100644 → 0
View file @
65919394
package
jp
.
agentec
.
abook
.
abv
.
ui
.
common
.
appinfo
.
options
;
import
jp.agentec.abook.abv.bl.acms.type.ServiceOption.ServiceOptionId
;
import
jp.agentec.abook.abv.bl.data.ABVDataCache
;
import
android.content.Context
;
/**
* @author tauchi
*
*/
public
class
MidOptions
extends
AbstractOptions
{
public
MidOptions
(
Context
context
)
{
super
(
context
);
}
@Override
public
int
getSettingMenuAccount
()
{
return
1
;
}
@Override
public
int
getSettingMenuAppInfo
()
{
return
1
;
}
@Override
public
int
getSettingMenuLogout
()
{
return
1
;
}
@Override
public
int
getSettingMenuPasswordChange
()
{
return
1
;
}
@Override
public
int
getSettingMenuLogInfo
()
{
return
1
;
}
@Override
public
int
getViewerMenuTextcopy
()
{
return
0
;
}
@Override
public
int
getViewerMenuMarking
()
{
return
ABVDataCache
.
getInstance
().
serviceOption
.
isMarking
()
?
1
:
0
;
}
}
ABVJE_UI_Android/src/jp/agentec/abook/abv/ui/viewer/activity/ContentViewActivity.java
View file @
40f44ee0
...
@@ -2645,30 +2645,6 @@ public class ContentViewActivity extends ABVContentViewActivity {
...
@@ -2645,30 +2645,6 @@ public class ContentViewActivity extends ABVContentViewActivity {
case
ActionInfoJSON
.
BALLOON_ACTION
:
case
ActionInfoJSON
.
BALLOON_ACTION
:
showBalloon
(
actionInfoJSON
.
getContentHTML
(),
pageNumber
,
actionInfoJSON
.
getObjectId
());
showBalloon
(
actionInfoJSON
.
getContentHTML
(),
pageNumber
,
actionInfoJSON
.
getObjectId
());
break
;
break
;
case
ActionInfoJSON
.
BEACON_ACTION
:
final
long
actionJsonObjectId
=
actionInfoJSON
.
getObjectId
();
if
(
objectIdPopupMap
.
containsKey
(
actionJsonObjectId
)
||
(
beaconDialog
!=
null
&&
beaconDialog
.
isShowing
()))
{
Logger
.
d
(
TAG
,
"Already Open Beacon Dialog"
);
break
;
}
beaconDialog
=
showBeacon
(
contentId
,
actionInfoJSON
.
getContentURL
(),
actionJsonObjectId
,
null
);
if
(
beaconDialog
==
null
)
{
Logger
.
d
(
TAG
,
"beaconDialog is null"
);
break
;
}
final
int
pageIdx
=
pageNumber
;
beaconDialog
.
setNegativeButton
(
R
.
string
.
cancel
,
new
DialogInterface
.
OnClickListener
()
{
@Override
public
void
onClick
(
DialogInterface
dialog
,
int
whichButton
)
{
if
(
meetingManager
.
isSendable
())
{
meetingManager
.
sendWs
(
MeetingManager
.
CMD_CLOSEPOPUP
,
getContentId
(),
pageIdx
,
objectId
,
null
);
}
objectIdPopupMap
.
remove
(
actionJsonObjectId
);
beaconDialog
.
dismiss
();
}
});
break
;
case
ActionInfoJSON
.
MEMO_ACTION
:
case
ActionInfoJSON
.
MEMO_ACTION
:
break
;
break
;
case
ActionInfoJSON
.
HTML_ACTION
:
case
ActionInfoJSON
.
HTML_ACTION
:
...
...
ABVJE_UI_Android/src/jp/agentec/abook/abv/ui/viewer/activity/HTMLXWalkWebViewActivity.java
View file @
40f44ee0
...
@@ -341,32 +341,6 @@ public class HTMLXWalkWebViewActivity extends ParentWebViewActivity {
...
@@ -341,32 +341,6 @@ public class HTMLXWalkWebViewActivity extends ParentWebViewActivity {
if
(
ret
!=
null
&&
!
ret
.
startsWith
(
ABookKeys
.
OK
))
{
if
(
ret
!=
null
&&
!
ret
.
startsWith
(
ABookKeys
.
OK
))
{
showSimpleAlertDialog
(
getRString
(
R
.
string
.
error
),
ret
);
showSimpleAlertDialog
(
getRString
(
R
.
string
.
error
),
ret
);
}
}
}
else
if
(
url
.
startsWith
(
ABookKeys
.
GETITS_OPEN_SHARE
))
{
Map
<
String
,
String
>
param
=
new
HashMap
<
String
,
String
>();
for
(
String
key
:
uri
.
getQueryParameterNames
())
{
param
.
put
(
key
,
uri
.
getQueryParameter
(
key
));
}
String
shareUrl
=
null
;
if
(
param
.
containsKey
(
ABookKeys
.
PARAM_SHARE_URL
))
{
shareUrl
=
(
String
)
param
.
get
(
ABookKeys
.
PARAM_SHARE_URL
);
}
if
(
beaconDialog
!=
null
&&
beaconDialog
.
isShowing
())
{
Logger
.
d
(
TAG
,
"Already Open Beacon Dialog"
);
return
true
;
}
beaconDialog
=
showBeacon
(
contentId
,
shareUrl
,
-
1
,
webView
);
if
(
beaconDialog
==
null
)
{
Logger
.
d
(
TAG
,
"beaconDialog is null"
);
return
true
;
}
beaconDialog
.
setNegativeButton
(
R
.
string
.
cancel
,
new
DialogInterface
.
OnClickListener
()
{
@Override
public
void
onClick
(
DialogInterface
dialog
,
int
whichButton
)
{
javaScriptSignageCmd
(
ABookKeys
.
CMD_GETITS_CLOSE_SHARE
,
webView
);
dialog
.
dismiss
();
}
});
Logger
.
v
(
TAG
,
"Beacon Dialog is open"
);
}
else
if
(
url
.
contains
(
ABookKeys
.
ABOOK_CHECK_API
))
{
}
else
if
(
url
.
contains
(
ABookKeys
.
ABOOK_CHECK_API
))
{
commonShouldOverrideUrlLoading
(
uri
,
null
);
commonShouldOverrideUrlLoading
(
uri
,
null
);
}
}
...
...
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