Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
citizen-science
symbai
Commits
4c891cb6
Commit
4c891cb6
authored
May 16, 2014
by
Dave Griffiths
Browse files
social split into friendship
parent
f98cd416
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
146 additions
and
34 deletions
+146
-34
android/AndroidManifest.xml
android/AndroidManifest.xml
+1
-0
android/assets/dbsync.scm
android/assets/dbsync.scm
+10
-4
android/assets/starwisp.scm
android/assets/starwisp.scm
+127
-25
android/assets/translations.scm
android/assets/translations.scm
+4
-4
android/src/foam/symbai/starwisp.java
android/src/foam/symbai/starwisp.java
+1
-0
translations.csv
translations.csv
+3
-1
No files found.
android/AndroidManifest.xml
View file @
4c891cb6
...
...
@@ -27,6 +27,7 @@
<activity
android:name=
"foam.symbai.IncomeActivity"
android:configChanges=
"orientation"
></activity>
<activity
android:name=
"foam.symbai.GeneaologyActivity"
android:configChanges=
"orientation"
></activity>
<activity
android:name=
"foam.symbai.SocialActivity"
android:configChanges=
"orientation"
></activity>
<activity
android:name=
"foam.symbai.FriendshipActivity"
android:configChanges=
"orientation"
></activity>
<activity
android:name=
"foam.symbai.AgreementActivity"
android:configChanges=
"orientation"
></activity>
<activity
android:name=
"foam.symbai.IndividualChooserActivity"
android:configChanges=
"orientation"
></activity>
<activity
android:name=
"foam.symbai.SyncActivity"
android:configChanges=
"orientation"
></activity>
...
...
android/assets/dbsync.scm
View file @
4c891cb6
...
...
@@ -217,8 +217,8 @@
(
define
(
sync-files
server-list
)
(
let
((
local-list
(
dir-list
"/sdcard/symbai/files/"
)))
;; search for all local files in server list
(
dbg
(
crop
(
append
(
crop
(
append
(
foldl
(
lambda
(
file
r
)
;; send files not present
...
...
@@ -245,7 +245,7 @@
'
()
server-list
))
;; restrict the number of uploads each time round
2
)))
)
2
)))
(
define
(
start-sync-files
)
(
list
...
...
@@ -253,7 +253,12 @@
(
string-append
"file-list"
)
(
string-append
url
"fn=file-list"
)
(
lambda
(
file-list
)
(
dbg
(
sync-files
file-list
))))))
(
let
((
r
(
sync-files
file-list
)))
(
when
(
not
(
null?
r
))
(
set-current!
'upload
0
)
(
debug!
"Found a mismatch with files on raspberry pi - fixing..."
))
r
)))))
;; spit all dirty entities to server
(
define
(
spit
db
table
entities
)
...
...
@@ -370,6 +375,7 @@
(
lambda
(
id
)
(
when
(
not
(
in-list?
id
server-ids
))
(
msg
"can't find "
id
" in server data, marking dirty"
)
(
debug!
"Have an entity here not on raspberry pi - marking for upload..."
)
;; mark those not present as dirty for next spit cycle
(
update-entity-dirtify
db
table
id
)))
ids
)))
...
...
android/assets/starwisp.scm
View file @
4c891cb6
...
...
@@ -70,7 +70,7 @@
(
define
gender-list
'
(
male
female
))
(
define
house-type-list
'
(
concrete
tin
thatched
other
))
(
define
social-types-list
'
(
friendship
knowledge
prestige
))
(
define
social-types-list
'
(
knowledge
prestige
))
(
define
social-relationship-list
'
(
mother
father
sister
brother
spouse
children
co-wife
spouse-mother
spouse-father
spouse-brother-wife
spouse-sister-husband
friend
neighbour
other
))
(
define
social-residence-list
'
(
same
other
))
(
define
social-strength-list
'
(
daily
weekly
monthly
less
))
...
...
@@ -139,6 +139,56 @@
(
ktv
"mobile"
"int"
0
)
(
ktv
"visit-market"
"int"
0
)
(
ktv
"town-sell"
"int"
0
)
(
ktv
"social-one"
"varchar"
""
)
(
ktv
"social-one-nickname"
"varchar"
""
)
(
ktv
"social-one-relationship"
"varchar"
""
)
(
ktv
"social-one-residence"
"varchar"
""
)
(
ktv
"social-one-strength"
"varchar"
""
)
(
ktv
"social-two"
"varchar"
""
)
(
ktv
"social-two-nickname"
"varchar"
""
)
(
ktv
"social-two-relationship"
"varchar"
""
)
(
ktv
"social-two-residence"
"varchar"
""
)
(
ktv
"social-two-strength"
"varchar"
""
)
(
ktv
"social-three"
"varchar"
""
)
(
ktv
"social-three-nickname"
"varchar"
""
)
(
ktv
"social-three-relationship"
"varchar"
""
)
(
ktv
"social-three-residence"
"varchar"
""
)
(
ktv
"social-three-strength"
"varchar"
""
)
(
ktv
"social-four"
"varchar"
""
)
(
ktv
"social-four-nickname"
"varchar"
""
)
(
ktv
"social-four-relationship"
"varchar"
""
)
(
ktv
"social-four-residence"
"varchar"
""
)
(
ktv
"social-four-strength"
"varchar"
""
)
(
ktv
"social-five"
"varchar"
""
)
(
ktv
"social-five-nickname"
"varchar"
""
)
(
ktv
"social-five-relationship"
"varchar"
""
)
(
ktv
"social-five-residence"
"varchar"
""
)
(
ktv
"social-five-strength"
"varchar"
""
)
(
ktv
"friendship-one"
"varchar"
""
)
(
ktv
"friendship-one-nickname"
"varchar"
""
)
(
ktv
"friendship-one-relationship"
"varchar"
""
)
(
ktv
"friendship-one-residence"
"varchar"
""
)
(
ktv
"friendship-one-strength"
"varchar"
""
)
(
ktv
"friendship-two"
"varchar"
""
)
(
ktv
"friendship-two-nickname"
"varchar"
""
)
(
ktv
"friendship-two-relationship"
"varchar"
""
)
(
ktv
"friendship-two-residence"
"varchar"
""
)
(
ktv
"friendship-two-strength"
"varchar"
""
)
(
ktv
"friendship-three"
"varchar"
""
)
(
ktv
"friendship-three-nickname"
"varchar"
""
)
(
ktv
"friendship-three-relationship"
"varchar"
""
)
(
ktv
"friendship-three-residence"
"varchar"
""
)
(
ktv
"friendship-three-strength"
"varchar"
""
)
(
ktv
"friendship-four"
"varchar"
""
)
(
ktv
"friendship-four-nickname"
"varchar"
""
)
(
ktv
"friendship-four-relationship"
"varchar"
""
)
(
ktv
"friendship-four-residence"
"varchar"
""
)
(
ktv
"friendship-four-strength"
"varchar"
""
)
(
ktv
"friendship-five"
"varchar"
""
)
(
ktv
"friendship-five-nickname"
"varchar"
""
)
(
ktv
"friendship-five-relationship"
"varchar"
""
)
(
ktv
"friendship-five-residence"
"varchar"
""
)
(
ktv
"friendship-five-strength"
"varchar"
""
)
))
(
define
crop-ktvlist
...
...
@@ -486,6 +536,17 @@
(
build-small-person-selector
id
key
(
list
)
request-code
)
(
vert
(
horiz
(
linear-layout
0
'vertical
(
layout
'fill-parent
'wrap-content
1
'centre
20
)
(
list
0
0
0
0
)
(
list
(
text-view
0
(
mtext-lookup
'social-nickname
)
30
(
layout
'wrap-content
'wrap-content
1
'centre
0
))
(
edit-text
(
make-id
(
string-append
id-text
"-nickname"
))
""
30
"normal"
(
layout
'fill-parent
'wrap-content
1
'centre
0
)
(
lambda
(
v
)
(
entity-set-value!
(
string-append
key
"-nickname"
)
"varchar"
v
)
'
()))))
(
mspinner-other-vert
(
string->symbol
(
string-append
id-text
"-relationship"
))
'social-relationship
...
...
@@ -493,24 +554,26 @@
(
lambda
(
v
)
(
entity-set-value!
(
string-append
key
"-relationship"
)
"varchar"
(
spinner-choice
social-relationship-list
v
))
'
()))
'
())))
(
horiz
(
mspinner-other-vert
(
string->symbol
(
string-append
id-text
"-residence"
))
'social-residence
social-residence-list
(
lambda
(
v
)
(
entity-set-value!
(
string-append
key
"-residence"
)
"varchar"
(
spinner-choice
social-residence-list
v
))
'
()))
)
(
vert
(
text-view
0
(
mtext-lookup
'social-strength
)
30
(
layout
'wrap-content
'wrap-content
1
'centre
10
))
(
spinner
(
make-id
(
string-append
id-text
"-strength-spinner"
))
(
map
mtext-lookup
social-strength-list
)
(
layout
'wrap-content
'wrap-content
1
'centre
0
)
(
lambda
(
v
)
(
entity-set-value!
(
string-append
key
"-strength"
)
"varchar"
(
spinner-choice
social-strength-list
v
))
'
()))))))))
(
spinner-choice
social-residence-list
v
))
'
()))
(
vert
(
text-view
0
(
mtext-lookup
'social-strength
)
30
(
layout
'wrap-content
'wrap-content
1
'centre
10
))
(
spinner
(
make-id
(
string-append
id-text
"-strength-spinner"
))
(
map
mtext-lookup
social-strength-list
)
(
layout
'wrap-content
'wrap-content
1
'centre
0
)
(
lambda
(
v
)
(
entity-set-value!
(
string-append
key
"-strength"
)
"varchar"
(
spinner-choice
social-strength-list
v
))
'
()))))))))
)
(
define
(
social-connection-return
request-code
key
choose-code
)
(
when
(
eqv?
request-code
choose-code
)
...
...
@@ -529,6 +592,10 @@
(
string-append
key
"-residence"
)
social-residence-list
)
(
list
(
mupdate
'edit-text
(
string->symbol
(
string-append
id-text
"-nickname"
))
(
string-append
key
"-nickname"
))
(
mupdate-spinner
(
string->symbol
(
string-append
id-text
"-strength"
))
(
string-append
key
"-strength"
)
...
...
@@ -791,7 +858,7 @@
(
lambda
(
activity
arg
)
(
activity-layout
activity
))
(
lambda
(
activity
arg
)
(
set-current!
'activity-title
"Household
List
"
)
(
set-current!
'activity-title
"Household
s
"
)
(
append
(
update-top-bar
)
(
list
(
update-list-widget
...
...
@@ -888,8 +955,10 @@
(
mbutton-scale
'income-button
(
lambda
()
(
list
(
start-activity
"income"
0
""
)))))
(
horiz
(
mbutton-scale
'geneaology-button
(
lambda
()
(
list
(
start-activity
"geneaology"
0
""
))))
(
mbutton-scale
'social-button
(
lambda
()
(
list
(
start-activity
"social"
0
""
)))))
(
mbutton-scale
'move-button
(
lambda
()
(
list
(
start-activity
"move"
0
""
))))
(
mbutton-scale
'friendship-button
(
lambda
()
(
list
(
start-activity
"friendship"
0
""
)))))
(
horiz
(
mbutton-scale
'social-button
(
lambda
()
(
list
(
start-activity
"social"
0
""
))))
(
mbutton-scale
'move-button
(
lambda
()
(
list
(
start-activity
"move"
0
""
)))))
(
spacer
20
)
(
delete-button
))
...
...
@@ -944,7 +1013,7 @@
(
lambda
(
activity
arg
)
(
activity-layout
activity
))
(
lambda
(
activity
arg
)
(
set-current!
'activity-title
"
Individual d
etails"
)
(
set-current!
'activity-title
"
D
etails"
)
(
append
(
update-top-bar
)
(
mupdate-spinner-other
'tribe
"tribe"
tribes-list
)
...
...
@@ -1012,7 +1081,7 @@
(
lambda
(
activity
arg
)
(
activity-layout
activity
))
(
lambda
(
activity
arg
)
(
set-current!
'activity-title
"
Individual f
amily"
)
(
set-current!
'activity-title
"
F
amily"
)
(
append
(
update-top-bar
)
(
update-person-selector
db
"sync"
'spouse
"id-spouse"
)
...
...
@@ -1062,7 +1131,7 @@
(
lambda
(
activity
arg
)
(
activity-layout
activity
))
(
lambda
(
activity
arg
)
(
set-current!
'activity-title
"Move
individual
"
)
(
set-current!
'activity-title
"Move"
)
(
set-current!
'move-household-list
(
build-array-from-names
db
"sync"
"household"
))
(
append
(
update-top-bar
)
...
...
@@ -1089,7 +1158,7 @@
(
lambda
(
activity
arg
)
(
activity-layout
activity
))
(
lambda
(
activity
arg
)
(
set-current!
'activity-title
"
Individual m
igration"
)
(
set-current!
'activity-title
"
M
igration"
)
(
append
(
update-top-bar
)
(
list
...
...
@@ -1145,7 +1214,7 @@
(
lambda
(
activity
arg
)
(
activity-layout
activity
))
(
lambda
(
activity
arg
)
(
set-current!
'activity-title
"In
dividual in
come"
)
(
set-current!
'activity-title
"Income"
)
;; reset after crop entity
(
entity-init!
db
"sync"
"individual"
(
get-entity-by-unique
db
"sync"
(
get-current
'individual
#f
)))
(
append
...
...
@@ -1256,7 +1325,7 @@
(
activity-layout
activity
))
(
lambda
(
activity
arg
)
;; reset after child entity
(
set-current!
'activity-title
"
Individual g
eneaology"
)
(
set-current!
'activity-title
"
G
eneaology"
)
(
entity-init!
db
"sync"
"individual"
(
get-entity-by-unique
db
"sync"
(
get-current
'individual
#f
)))
(
append
(
update-top-bar
)
...
...
@@ -1288,7 +1357,7 @@
(
lambda
(
activity
arg
)
(
activity-layout
activity
))
(
lambda
(
activity
arg
)
(
set-current!
'activity-title
"
Individual s
ocial network"
)
(
set-current!
'activity-title
"
S
ocial network"
)
(
append
(
update-top-bar
)
(
list
...
...
@@ -1310,12 +1379,45 @@
(
social-connection-return
requestcode
"social-five"
social-request-code-five
)
'
()))
(
activity
"friendship"
(
build-activity
(
build-social-connection
'social-one
"friendship-one"
"friend"
social-request-code-one
#t
)
(
build-social-connection
'social-two
"friendship-two"
"friend"
social-request-code-two
#f
)
(
build-social-connection
'social-three
"friendship-three"
"friend"
social-request-code-three
#t
)
(
build-social-connection
'social-four
"friendship-four"
"friend"
social-request-code-four
#f
)
(
build-social-connection
'social-five
"friendship-five"
"friend"
social-request-code-five
#t
)
)
(
lambda
(
activity
arg
)
(
activity-layout
activity
))
(
lambda
(
activity
arg
)
(
set-current!
'activity-title
"Frienships"
)
(
append
(
update-top-bar
)
(
update-social-connection
db
"sync"
'social-one
"friendship-one"
"friend"
social-request-code-one
)
(
update-social-connection
db
"sync"
'social-two
"friendship-two"
"friend"
social-request-code-two
)
(
update-social-connection
db
"sync"
'social-three
"friendship-three"
"friend"
social-request-code-three
)
(
update-social-connection
db
"sync"
'social-four
"friendship-four"
"friend"
social-request-code-four
)
(
update-social-connection
db
"sync"
'social-five
"friendship-five"
"friend"
social-request-code-five
)))
(
lambda
(
activity
)
'
())
(
lambda
(
activity
)
'
())
(
lambda
(
activity
)
'
())
(
lambda
(
activity
)
'
())
(
lambda
(
activity
requestcode
resultcode
)
(
social-connection-return
requestcode
"friendship-one"
social-request-code-one
)
(
social-connection-return
requestcode
"friendship-two"
social-request-code-two
)
(
social-connection-return
requestcode
"friendship-three"
social-request-code-three
)
(
social-connection-return
requestcode
"friendship-four"
social-request-code-four
)
(
social-connection-return
requestcode
"friendship-five"
social-request-code-five
)
'
()))
(
activity
"agreement"
(
build-activity
)
(
lambda
(
activity
arg
)
(
set-current!
'activity-title
"
Individual a
greement"
)
(
set-current!
'activity-title
"
A
greement"
)
(
activity-layout
activity
))
(
lambda
(
activity
arg
)
'
())
(
lambda
(
activity
)
'
())
...
...
@@ -1382,7 +1484,7 @@
(
list
)))))))))
))
(
lambda
(
activity
arg
)
(
set-current!
'activity-title
"
Individual c
hooser"
)
(
set-current!
'activity-title
"
C
hooser"
)
(
activity-layout
activity
))
(
lambda
(
activity
arg
)
(
list
(
update-individual-filter
(
list
))))
...
...
android/assets/translations.scm
View file @
4c891cb6
(
define
i18n-text
(
list
(
list
'test-num
(
list
"1"
"1"
"1"
""
))
(
list
'test-text
(
list
"I am test text"
"I am test text"
"I am test text"
""
))
(
list
'one
(
list
"one"
""
))
...
...
@@ -111,6 +109,7 @@
(
list
'details-button
(
list
"Details"
""
))
(
list
'family-button
(
list
"Family"
"Family/Clan"
))
(
list
'migration-button
(
list
"Migration"
""
))
(
list
'friendship-button
(
list
"Friendship"
))
(
list
'income-button
(
list
"Income"
""
))
(
list
'geneaology-button
(
list
"Geneaology"
""
))
(
list
'social-button
(
list
"Social"
""
))
...
...
@@ -161,7 +160,7 @@
(
list
'place-of-birth
(
list
"Place of birth"
""
))
(
list
'num-residence-changes
(
list
"Number of time place of residence changed since birth"
""
))
(
list
'village-visits-month
(
list
"Number of times you have visited another village in the last month"
""
))
(
list
'village-visits-year
(
list
"Number of times you have visited another village in the last year (i.e. betwen last summer and this summer)"
""
))
(
list
'village-visits-year
(
list
"Number of times you have visited another village in the last year (i.e. betwe
e
n last summer and this summer)"
""
))
(
list
'occupation
(
list
"Occupation"
""
))
(
list
'occupation
(
list
"Occupation"
""
))
(
list
'num-people-in-house
(
list
"People living in house"
""
))
...
...
@@ -209,7 +208,8 @@
(
list
'social-three
(
list
"Three"
""
))
(
list
'social-four
(
list
"Four"
""
))
(
list
'social-five
(
list
"Five"
""
))
(
list
'social-relationship
(
list
"Relationship"
""
))
(
list
'social-nickname
(
list
"Name"
))
(
list
'social-relationship
(
list
"Relation"
""
))
(
list
'social-residence
(
list
"Residence"
""
))
(
list
'social-strength
(
list
"Strength"
""
))
(
list
'mother
(
list
"Mother"
""
))
...
...
android/src/foam/symbai/starwisp.java
View file @
4c891cb6
...
...
@@ -72,6 +72,7 @@ public class starwisp extends StarwispActivity
ActivityManager
.
RegisterActivity
(
"income"
,
IncomeActivity
.
class
);
ActivityManager
.
RegisterActivity
(
"geneaology"
,
GeneaologyActivity
.
class
);
ActivityManager
.
RegisterActivity
(
"social"
,
SocialActivity
.
class
);
ActivityManager
.
RegisterActivity
(
"friendship"
,
FriendshipActivity
.
class
);
ActivityManager
.
RegisterActivity
(
"individual-chooser"
,
IndividualChooserActivity
.
class
);
ActivityManager
.
RegisterActivity
(
"sync"
,
SyncActivity
.
class
);
ActivityManager
.
RegisterActivity
(
"crop"
,
CropActivity
.
class
);
...
...
translations.csv
View file @
4c891cb6
...
...
@@ -107,6 +107,7 @@
"details-button"," Details"," ",,
"family-button"," Family","Family/Clan",,
"migration-button"," Migration"," ",,
"friendship-button","Friendship",,,
"income-button"," Income"," ",,
"geneaology-button"," Geneaology"," ",,
"social-button"," Social"," ",,
...
...
@@ -205,7 +206,8 @@
"social-three"," Three"," ",,
"social-four"," Four"," ",,
"social-five"," Five"," ",,
"social-relationship"," Relationship"," ",,
"social-nickname","Name",,,
"social-relationship"," Relation"," ",,
"social-residence"," Residence"," ",,
"social-strength"," Strength"," ",,
"mother"," Mother"," ",,
...
...
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