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
0a777699
Commit
0a777699
authored
Aug 27, 2022
by
NGUYEN HOANG SON
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'features/1.4.400_49464' into features/1.4.400
* features/1.4.400_49464: implement CMD 'saveJson'
parents
92ba5522
9ba619f9
Hide 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 @
0a777699
...
...
@@ -104,6 +104,7 @@ public class ABookKeys {
public
static
final
String
REFRESH_CONTENT
=
"refreshContent"
;
public
static
final
String
RESET_SEARCH
=
"resetSearch"
;
public
static
final
String
CHANGE_OPERATION_GROUP_MASTER
=
"changeOperationGroupMaster"
;
public
static
final
String
SAVE_JSON
=
"saveJson"
;
}
...
...
@@ -239,4 +240,8 @@ public class ABookKeys {
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
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 @
0a777699
...
...
@@ -16,6 +16,7 @@ import android.view.Window;
import
android.webkit.JavascriptInterface
;
import
android.webkit.WebSettings
;
import
android.webkit.WebView
;
import
android.webkit.WebViewClient
;
import
android.widget.AbsListView
;
import
android.widget.AdapterView
;
import
android.widget.ArrayAdapter
;
...
...
@@ -168,6 +169,17 @@ public class OperationListActivity extends ABVUIActivity {
mCheckWebView
.
setOverScrollMode
(
View
.
OVER_SCROLL_NEVER
);
//オーバースクロールしない。
mCheckWebView
.
setVerticalScrollBarEnabled
(
false
);
//スクロールバーを消す。
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
())
{
mCheckWebView
.
setWebContentsDebuggingEnabled
(
true
);
}
...
...
@@ -392,6 +404,11 @@ public class OperationListActivity extends ABVUIActivity {
}
});
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
;
}
}
}
...
...
@@ -1732,4 +1749,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