Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
E
Ear recognition
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
3
Issues
3
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
Boston University
Ear recognition
Commits
cc9972b1
Commit
cc9972b1
authored
Oct 13, 2015
by
Josejulio Martínez Magaña
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Created the class EarDataLoaderCommcare to load the data from CommCare.
parent
c9c9bdae
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
41 additions
and
0 deletions
+41
-0
EarDataLoaderCommcare.java
.../aluxoft/earrecognition/loader/EarDataLoaderCommcare.java
+41
-0
No files found.
app/src/main/java/com/aluxoft/earrecognition/loader/EarDataLoaderCommcare.java
0 → 100644
View file @
cc9972b1
package
com
.
aluxoft
.
earrecognition
.
loader
;
import
android.app.Activity
;
import
android.database.Cursor
;
import
android.net.Uri
;
import
com.aluxoft.earrecognition.common.EarData
;
/**
* Created by josejuliomartinez on 13/10/15.
*/
public
class
EarDataLoaderCommcare
extends
EarDataLoader
{
@Override
public
EarData
load
(
Activity
current
)
{
EarData
data
=
new
EarData
();
Cursor
c
=
current
.
managedQuery
(
Uri
.
parse
(
"content://org.commcare.dalvik.case/casedb/case"
),
null
,
null
,
null
,
null
);
if
(
c
==
null
)
{
return
data
;
}
while
(
c
.
moveToNext
())
{
String
caseId
=
c
.
getString
(
c
.
getColumnIndex
(
"case_id"
));
Uri
uri
=
Uri
.
parse
(
"content://org.commcare.dalvik.case/casedb/data/"
+
caseId
);
Cursor
caseCursor
=
current
.
managedQuery
(
uri
,
null
,
null
,
null
,
null
);
if
(
caseCursor
==
null
)
{
continue
;
}
while
(
caseCursor
.
moveToNext
())
{
String
gender
=
caseCursor
.
getString
(
caseCursor
.
getColumnIndex
(
"gender"
));
String
features
=
caseCursor
.
getString
(
caseCursor
.
getColumnIndex
(
"features"
));
// Agregar el gender, caseid y features a data
}
}
return
data
;
}
}
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