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
9ba619f9
Commit
9ba619f9
authored
Aug 27, 2022
by
NGUYEN HOANG SON
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
implement CMD 'saveJson'
parent
705ee87e
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
35 additions
and
0 deletions
+35
-0
ABVJE_BL/src/jp/agentec/abook/abv/bl/common/constant/ABookKeys.java
+5
-0
ABVJE_UI_Android/src/jp/agentec/abook/abv/ui/home/activity/OperationListActivity.java
+30
-0
No files found.
ABVJE_BL/src/jp/agentec/abook/abv/bl/common/constant/ABookKeys.java
View file @
9ba619f9
...
@@ -101,6 +101,7 @@ public class ABookKeys {
...
@@ -101,6 +101,7 @@ public class ABookKeys {
public
static
final
String
REFRESH_CONTENT
=
"refreshContent"
;
public
static
final
String
REFRESH_CONTENT
=
"refreshContent"
;
public
static
final
String
RESET_SEARCH
=
"resetSearch"
;
public
static
final
String
RESET_SEARCH
=
"resetSearch"
;
public
static
final
String
CHANGE_OPERATION_GROUP_MASTER
=
"changeOperationGroupMaster"
;
public
static
final
String
CHANGE_OPERATION_GROUP_MASTER
=
"changeOperationGroupMaster"
;
public
static
final
String
SAVE_JSON
=
"saveJson"
;
}
}
...
@@ -236,4 +237,8 @@ public class ABookKeys {
...
@@ -236,4 +237,8 @@ public class ABookKeys {
public
static
final
String
CMD_GET_DEVICE_INFO
=
"getDeviceInfo"
;
// CMSのインターフェースのパラメータ:cmd
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_DEVICE_TYPE
=
"deviceType"
;
// CMSのインターフェースのパラメータ:devicetype
public
static
final
String
TASK_QUESTION_ID
=
"qid"
;
// CMSのインターフェースのパラメータ:qid
public
static
final
String
TASK_QUESTION_ID
=
"qid"
;
// CMSのインターフェースのパラメータ:qid
public
static
final
String
JSON_NAME
=
"jsonName"
;
public
static
final
String
JSON_DATA
=
"jsonData"
;
}
}
ABVJE_UI_Android/src/jp/agentec/abook/abv/ui/home/activity/OperationListActivity.java
View file @
9ba619f9
...
@@ -16,6 +16,7 @@ import android.view.Window;
...
@@ -16,6 +16,7 @@ import android.view.Window;
import
android.webkit.JavascriptInterface
;
import
android.webkit.JavascriptInterface
;
import
android.webkit.WebSettings
;
import
android.webkit.WebSettings
;
import
android.webkit.WebView
;
import
android.webkit.WebView
;
import
android.webkit.WebViewClient
;
import
android.widget.AbsListView
;
import
android.widget.AbsListView
;
import
android.widget.AdapterView
;
import
android.widget.AdapterView
;
import
android.widget.ArrayAdapter
;
import
android.widget.ArrayAdapter
;
...
@@ -168,6 +169,17 @@ public class OperationListActivity extends ABVUIActivity {
...
@@ -168,6 +169,17 @@ public class OperationListActivity extends ABVUIActivity {
mCheckWebView
.
setOverScrollMode
(
View
.
OVER_SCROLL_NEVER
);
//オーバースクロールしない。
mCheckWebView
.
setOverScrollMode
(
View
.
OVER_SCROLL_NEVER
);
//オーバースクロールしない。
mCheckWebView
.
setVerticalScrollBarEnabled
(
false
);
//スクロールバーを消す。
mCheckWebView
.
setVerticalScrollBarEnabled
(
false
);
//スクロールバーを消す。
mCheckWebView
.
addJavascriptInterface
(
jsInf
,
"android"
);
mCheckWebView
.
addJavascriptInterface
(
jsInf
,
"android"
);
mCheckWebView
.
setWebViewClient
(
new
WebViewClient
()
{
@Override
public
boolean
shouldOverrideUrlLoading
(
WebView
view
,
String
url
)
{
//fix FileUriExposedException error when webview load url with file://
// if (Uri.parse(url).getScheme().equals("file")) {
// view.loadUrl(url);
// return true;
// }
return
super
.
shouldOverrideUrlLoading
(
view
,
url
);
}
});
if
(
Logger
.
isDebugEnabled
())
{
if
(
Logger
.
isDebugEnabled
())
{
mCheckWebView
.
setWebContentsDebuggingEnabled
(
true
);
mCheckWebView
.
setWebContentsDebuggingEnabled
(
true
);
}
}
...
@@ -391,6 +403,11 @@ public class OperationListActivity extends ABVUIActivity {
...
@@ -391,6 +403,11 @@ public class OperationListActivity extends ABVUIActivity {
}
}
});
});
break
;
break
;
case
ABookKeys
.
CMD_KEY
.
SAVE_JSON
:
if
(
jsonParam
.
has
(
ABookKeys
.
JSON_NAME
))
{
saveJson
(
jsonParam
.
getString
(
ABookKeys
.
JSON_NAME
),
jsonParam
.
getString
(
ABookKeys
.
JSON_DATA
));
}
break
;
}
}
}
}
}
}
...
@@ -1731,4 +1748,17 @@ public class OperationListActivity extends ABVUIActivity {
...
@@ -1731,4 +1748,17 @@ public class OperationListActivity extends ABVUIActivity {
});
});
}
}
}
}
private
void
saveJson
(
String
jsonName
,
String
jsonData
)
{
if
(
StringUtil
.
isNullOrEmpty
(
jsonName
))
{
Logger
.
d
(
TAG
,
"saveJson:jsonName is null or empty"
);
return
;
}
String
filePath
=
getCacheDir
().
getAbsolutePath
()
+
"/"
+
jsonName
;
try
{
FileUtil
.
createFile
(
filePath
,
jsonData
);
}
catch
(
IOException
e
)
{
};
}
}
}
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