Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
yotta
/
pictogram
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
60
Merge Requests
0
Pipelines
Wiki
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
70bb2d89
authored
Feb 20, 2017
by
Fernando Martínez Santiago
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
issues #944 closed
parent
4e6d32c1
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
7 additions
and
5 deletions
android/Pictogram/commonlibrary/build.gradle
android/Pictogram/commonlibrary/src/main/java/com/yottacode/pictogram/dao/PCBDBHelper.java
android/Pictogram/commonlibrary/src/main/java/com/yottacode/pictogram/grammar/Vocabulary.java
android/Pictogram/commonlibrary/src/main/java/com/yottacode/pictogram/net/NetService.java
android/Pictogram/commonlibrary/build.gradle
View file @
70bb2d89
...
...
@@ -24,7 +24,7 @@ android {
resValue
"bool"
,
"ssl_connect"
,
"true"
resValue
"bool"
,
"force_img_download"
,
"false"
resValue
"integer"
,
"netservice_timing"
,
"5"
resValue
"integer"
,
"netservice_force_restfull_synchro"
,
"0"
resValue
"integer"
,
"netservice_force_restfull_synchro"
,
"
3
0"
}
debug
{
resValue
"string"
,
"server"
,
"https://dev.yottacode.com"
...
...
@@ -32,7 +32,7 @@ android {
resValue
"bool"
,
"ssl_connect"
,
"false"
resValue
"bool"
,
"force_img_download"
,
"false"
resValue
"integer"
,
"netservice_timing"
,
"5"
resValue
"integer"
,
"netservice_force_restfull_synchro"
,
"0"
resValue
"integer"
,
"netservice_force_restfull_synchro"
,
"
3
0"
}
}
}
...
...
android/Pictogram/commonlibrary/src/main/java/com/yottacode/pictogram/dao/PCBDBHelper.java
View file @
70bb2d89
...
...
@@ -182,6 +182,7 @@ public class PCBDBHelper extends SQLiteOpenHelper {
ContentValues
values
=
new
ContentValues
(
5
);
values
.
put
(
"id_stu"
,
id_stu
);
db
.
beginTransaction
();
for
(
Picto
picto
:
vocabulary
)
{
//Log.e(LOG_TAG,"inserting "+picto.get_id()+":"+picto.get_translation()+":"+picto.get_json_attrs());
newsize
++;
...
...
@@ -194,7 +195,8 @@ public class PCBDBHelper extends SQLiteOpenHelper {
int
seconds2
=
Calendar
.
getInstance
().
get
(
Calendar
.
SECOND
);
Log
.
i
(
LOG_TAG
,
" Local student vocabulary updated, id:"
+
id_stu
+
", cats: "
+
vocabulary
.
size
()
+
" time:"
+
(
seconds2
-
seconds1
)
+
" secs. Size: "
+
newsize
+
" read only?"
+
db
.
isReadOnly
());
db
.
setTransactionSuccessful
();
db
.
endTransaction
();
db
.
close
();
}
...
...
android/Pictogram/commonlibrary/src/main/java/com/yottacode/pictogram/grammar/Vocabulary.java
View file @
70bb2d89
...
...
@@ -92,7 +92,6 @@ public class Vocabulary implements Iterable<Picto> {
JSONObject
attrs_picto
=
args
.
getJSONObject
(
"attributes"
);
attrs_picto
.
put
(
Picto
.
JSON_ATTTRS
.
STUPICTO_ID
,
args
.
getInt
(
"id"
));
String
text
=
attrs_picto
.
getString
(
"expression"
);
addPicto
(
new
Picto
(
picto_id
,
uri
,
text
,
attrs_picto
),
ImgDownloader
.
tsource
.
remote
);
}
catch
(
JSONException
e
)
{
...
...
android/Pictogram/commonlibrary/src/main/java/com/yottacode/pictogram/net/NetService.java
View file @
70bb2d89
...
...
@@ -189,15 +189,16 @@ public class NetService implements Runnable, RestapiWrapper.iSilentLogin {
Log
.
i
(
LOG_TAG
,
"PCB reconnect"
);
PCBcontext
.
getRoom
().
connect
();
PCBcontext
.
getVocabulary
().
synchronize
();
synchronizeStudentAttributes
();
PCBcontext
.
getActionLog
().
batch
();
}
}
else
{
//cada restfullSynchroTimming aprox. se fuerza sincronización de vocabulario y configuración de usuario
long
now
=
new
Date
().
getTime
();
Log
.
i
(
LOG_TAG
,
"Vocabulary request?"
+
PCBcontext
.
is_user_logged
()+
" ("
+
restfullSynchroTimming
+
" milisecs)"
);
if
(
PCBcontext
.
is_user_logged
())
{
if
(
restfullSynchroTimming
>
0
&&
(
now
-
lastRestfullSynchro
>
restfullSynchroTimming
))
{
Log
.
i
(
LOG_TAG
,
"Vocabulary request"
);
PCBcontext
.
getVocabulary
().
synchronize
();
synchronizeStudentAttributes
();
lastRestfullSynchro
=
now
;
...
...
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