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
45074fce
Commit
45074fce
authored
Nov 25, 2015
by
Josejulio Martínez Magaña
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Prevents the user from taking the ear photograph IF not logged in CommCare.
parent
8d565e45
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
19 additions
and
0 deletions
+19
-0
EarCaptureActivity.java
...aluxoft/earrecognition/activities/EarCaptureActivity.java
+14
-0
EarDataLoaderCommcare.java
.../aluxoft/earrecognition/loader/EarDataLoaderCommcare.java
+5
-0
No files found.
app/src/main/java/com/aluxoft/earrecognition/activities/EarCaptureActivity.java
View file @
45074fce
...
...
@@ -12,6 +12,7 @@ import android.widget.Toast;
import
com.aluxoft.earrecognition.EarIdentifier
;
import
com.aluxoft.earrecognition.R
;
import
com.aluxoft.earrecognition.loader.EarDataLoaderCommcare
;
import
com.aluxoft.earrecognition.utils.ImageUtils
;
import
java.io.File
;
...
...
@@ -76,7 +77,20 @@ public class EarCaptureActivity extends Activity {
getImage
=
(
Button
)
this
.
findViewById
(
R
.
id
.
extra_image_value
);
getImage
.
setOnClickListener
(
new
OnClickListener
()
{
private
Toast
loginInCommCareToast
=
null
;
public
void
onClick
(
View
v
)
{
if
(!
EarDataLoaderCommcare
.
checkConnection
(
EarCaptureActivity
.
this
))
{
if
(
loginInCommCareToast
==
null
||
loginInCommCareToast
.
getView
().
getWindowVisibility
()
!=
View
.
VISIBLE
)
{
loginInCommCareToast
=
Toast
.
makeText
(
EarCaptureActivity
.
this
,
"Please login in CommCare application to proceed."
,
Toast
.
LENGTH_LONG
);
loginInCommCareToast
.
show
();
}
return
;
}
Intent
i
=
new
Intent
(
android
.
provider
.
MediaStore
.
ACTION_IMAGE_CAPTURE
);
try
{
location
=
ImageUtils
.
createTempImageFile
();
...
...
app/src/main/java/com/aluxoft/earrecognition/loader/EarDataLoaderCommcare.java
View file @
45074fce
...
...
@@ -13,6 +13,11 @@ import com.aluxoft.earrecognition.common.Person;
*/
public
class
EarDataLoaderCommcare
extends
EarDataLoader
{
public
static
boolean
checkConnection
(
Activity
current
)
{
Cursor
c
=
current
.
managedQuery
(
Uri
.
parse
(
"content://org.commcare.dalvik.case/casedb/case"
),
null
,
null
,
null
,
null
);
return
c
!=
null
;
}
@Override
public
EarData
load
(
Activity
current
)
{
...
...
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