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
4748b817
authored
May 05, 2017
by
Fernando Martínez Santiago
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
issue
#199
closed
parent
a593f9e0
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
2 additions
and
10 deletions
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/PictoUploader.java
android/Pictogram/commonlibrary/src/main/java/com/yottacode/pictogram/dao/PCBDBHelper.java
View file @
4748b817
...
...
@@ -15,7 +15,6 @@ import com.yottacode.pictogram.tools.PCBcontext;
import
org.json.JSONException
;
import
org.json.JSONObject
;
import
java.util.Calendar
;
import
java.util.Vector
;
/**
...
...
@@ -222,17 +221,12 @@ public class PCBDBHelper extends SQLiteOpenHelper {
public
void
setStudentVocabulary
(
Vocabulary
vocabulary
)
{
SQLiteDatabase
db
=
this
.
getWritableDatabase
();
int
id_stu
=
this
.
getCurrentUser
().
get_id_stu
();
int
seconds1
=
Calendar
.
getInstance
().
get
(
Calendar
.
SECOND
);
Log
.
i
(
"TAG_PRUEBAS"
,
"tamVoc to insert: "
+
vocabulary
.
size
());
db
.
delete
(
"collection"
,
"id_stu="
+
id_stu
,
null
);
int
newsize
=
0
;
ContentValues
values
=
new
ContentValues
(
6
);
values
.
put
(
"id_stu"
,
id_stu
);
db
.
beginTransaction
();
for
(
Picto
picto
:
vocabulary
)
{
Log
.
e
(
"TAG_PRUEBAS"
,
"inserting "
+
picto
.
get_id
()+
":"
+
picto
.
get_translation
()+
":"
+
picto
.
get_json_attrs
());
newsize
++;
values
.
put
(
"id_picto"
,
picto
.
get_id
());
values
.
put
(
"id_scene"
,
135
/*getActiveSceneForStudent(id_stu)*/
);
values
.
put
(
"url"
,
picto
.
get_url
());
...
...
@@ -241,8 +235,6 @@ public class PCBDBHelper extends SQLiteOpenHelper {
db
.
insert
(
"collection_detail"
,
null
,
values
);
}
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(); <--no es necesario cerrar la bbdd https://groups.google.com/forum/#!msg/android-developers/NwDRpHUXt0U/jIam4Q8-cqQJ
...
...
android/Pictogram/commonlibrary/src/main/java/com/yottacode/pictogram/grammar/Vocabulary.java
View file @
4748b817
...
...
@@ -207,7 +207,7 @@ public class Vocabulary implements Iterable<Picto> {
picto
=
stupicto
.
getJSONObject
(
"picto"
);
attributes
=
stupicto
.
getJSONObject
(
"attributes"
);
attributes
.
put
(
Picto
.
JSON_ATTTRS
.
STUPICTO_ID
,
stupicto
.
getInt
(
"id"
));
pictos
[
i
]
=
new
Picto
(
stu
picto
.
getInt
(
"id"
),
pictos
[
i
]
=
new
Picto
(
picto
.
getInt
(
"id"
),
picto
.
getString
(
"uri"
),
attributes
);
}
...
...
android/Pictogram/commonlibrary/src/main/java/com/yottacode/pictogram/net/PictoUploader.java
View file @
4748b817
...
...
@@ -325,7 +325,7 @@ public class PictoUploader {
params
.
put
(
"id_stu"
,
Integer
.
toString
(
PCBcontext
.
getPcbdb
().
getCurrentUser
().
get_id_stu
()));
params
.
put
(
"id_pic"
,
Integer
.
toString
(
this
.
picto
.
get_id
()));
Log
.
i
(
LOG_TAG
,
"Picto Uploading "
+
params
.
toString
());
Log
.
i
(
LOG_TAG
,
"Picto
"
+
this
.
picto
.
get_id
()+
" stupicto id:"
+
this
.
picto
.
get_stupicto_id
()+
"
Uploading "
+
params
.
toString
());
PCBcontext
.
getRestapiWrapper
().
ask
(
PCBcontext
.
getPcbdb
().
getCurrentUser
().
get_restapi_operation_stu
()
+
"/picto"
,
params
,
"put"
,
new
RestapiWrapper
.
iRestapiListener
()
{
...
...
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