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
70aee8d2
authored
Mar 07, 2016
by
Fernando Martínez Santiago
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
working on sockets on/off bug (ii)
parent
84dbe6ed
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
6 additions
and
3 deletions
android/Pictogram/app/src/main/java/com/yottacode/pictogram/action/Room.java
android/Pictogram/app/src/main/java/com/yottacode/pictogram/dao/PCBDBHelper.java
android/Pictogram/app/src/main/java/com/yottacode/pictogram/action/Room.java
View file @
70aee8d2
...
@@ -105,11 +105,14 @@ public class Room {
...
@@ -105,11 +105,14 @@ public class Room {
}
}
public
boolean
inRoom
()
{
return
this
.
inRoom
;}
public
boolean
inRoom
()
{
return
this
.
inRoom
;}
public
void
listen
(
String
msg
,
Emitter
.
Listener
listener
)
{
public
void
listen
(
String
msg
,
Emitter
.
Listener
listener
)
{
this
.
socket
.
registerMessage
(
msg
,
listener
);
this
.
listeners
.
put
(
msg
,
listener
);
this
.
listeners
.
put
(
msg
,
listener
);
}
}
private
void
listen_again
()
{
private
void
listen_again
()
{
for
(
String
msg:
this
.
listeners
.
keySet
())
for
(
String
msg:
this
.
listeners
.
keySet
())
{
Log
.
i
(
this
.
getClass
().
getName
(),
"Listening to "
+
msg
);
this
.
socket
.
registerMessage
(
msg
,
this
.
listeners
.
get
(
msg
));
this
.
socket
.
registerMessage
(
msg
,
this
.
listeners
.
get
(
msg
));
}
}
}
void
subscribe
()
{
void
subscribe
()
{
...
...
android/Pictogram/app/src/main/java/com/yottacode/pictogram/dao/PCBDBHelper.java
View file @
70aee8d2
...
@@ -201,7 +201,7 @@ public class PCBDBHelper extends SQLiteOpenHelper {
...
@@ -201,7 +201,7 @@ public class PCBDBHelper extends SQLiteOpenHelper {
public
void
setStudentVocabulary
(
Vocabulary
vocabulary
)
{
public
void
setStudentVocabulary
(
Vocabulary
vocabulary
)
{
SQLiteDatabase
db
=
this
.
getWritableDatabase
();
SQLiteDatabase
db
=
this
.
getWritableDatabase
();
int
id_stu
=
this
.
getCurrentUser
().
get_id_stu
();
int
id_stu
=
this
.
getCurrentUser
().
get_id_stu
();
int
seconds1
=
Calendar
.
getInstance
().
get
(
Calendar
.
SECOND
)
,
inserts
=
0
;
int
seconds1
=
Calendar
.
getInstance
().
get
(
Calendar
.
SECOND
);
db
.
delete
(
"collection"
,
"id_stu=?"
,
new
String
[]
{
String
.
valueOf
(
id_stu
)});
db
.
delete
(
"collection"
,
"id_stu=?"
,
new
String
[]
{
String
.
valueOf
(
id_stu
)});
ContentValues
values
=
new
ContentValues
(
5
);
ContentValues
values
=
new
ContentValues
(
5
);
values
.
put
(
"id_stu"
,
id_stu
);
values
.
put
(
"id_stu"
,
id_stu
);
...
@@ -266,7 +266,7 @@ public class PCBDBHelper extends SQLiteOpenHelper {
...
@@ -266,7 +266,7 @@ public class PCBDBHelper extends SQLiteOpenHelper {
ContentValues
values
=
new
ContentValues
(
1
);
ContentValues
values
=
new
ContentValues
(
1
);
values
.
put
(
"attributes"
,
attrs
);
values
.
put
(
"attributes"
,
attrs
);
int
updates
=
db
.
update
(
"collection"
,
values
,
"id_stu=? AND id_picto=?"
,
new
String
[]
{
Integer
.
toString
(
id_stu
),
Integer
.
toString
(
picto_id
)});
int
updates
=
db
.
update
(
"collection"
,
values
,
"id_stu=? AND id_picto=?"
,
new
String
[]
{
Integer
.
toString
(
id_stu
),
Integer
.
toString
(
picto_id
)});
Log
.
i
(
this
.
getClass
().
getCanonicalName
(),
"Modify "
+
updates
+
"
read only db? "
+
db
.
isReadOnly
()+
"
Picto attributes: "
+
picto_id
+
" attributes="
+
attrs
);
Log
.
i
(
this
.
getClass
().
getCanonicalName
(),
"Modify "
+
updates
+
" Picto attributes: "
+
picto_id
+
" attributes="
+
attrs
);
db
.
close
();
db
.
close
();
}
}
...
...
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