Skip to content

Commit 9140b6a

Browse files
authored
Merge pull request #80 from cientopolis/issue15bis
Issue15bis
2 parents dd3a868 + 5939072 commit 9140b6a

74 files changed

Lines changed: 1447 additions & 22 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

SamplersConfig.json

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,13 @@
109109
"sampleText" : "your comments",
110110
"inputType" : "text",
111111
"maxLength" : 50,
112-
"optional" : true
112+
"optional" : true,
113+
"nextStepId": 9
114+
},
115+
{
116+
"id" : 9,
117+
"type" : "Sound",
118+
"text" : "Please, record the sound"
113119
}
114120
]
115121
}

build.gradle

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,10 @@
33
buildscript {
44
repositories {
55
jcenter()
6+
google()
67
}
78
dependencies {
8-
classpath 'com.android.tools.build:gradle:3.0.0'
9+
classpath 'com.android.tools.build:gradle:3.0.1'
910

1011
// NOTE: Do not place your application dependencies here; they belong
1112
// in the individual module build.gradle files
@@ -15,6 +16,7 @@ buildscript {
1516
allprojects {
1617
repositories {
1718
jcenter()
19+
google()
1820
}
1921
}
2022

sampleApplication/src/main/java/org/cientopolis/sampleapplication/MyMainSamplersActivity.java

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
import org.cientopolis.samplers.framework.multipleSelect.MultipleSelectOption;
1414
import org.cientopolis.samplers.framework.Step;
1515
import org.cientopolis.samplers.framework.Workflow;
16+
import org.cientopolis.samplers.framework.soundRecord.SoundRecordStep;
1617
import org.cientopolis.samplers.network.NetworkConfiguration;
1718
import org.cientopolis.samplers.ui.SamplersMainActivity;
1819

@@ -29,7 +30,7 @@ protected void onCreate(Bundle savedInstanceState) {
2930
super.onCreate(savedInstanceState);
3031

3132
// Set the network configuration
32-
NetworkConfiguration.setURL("http://192.168.1.10/samplers/upload.php");
33+
NetworkConfiguration.setURL("http://192.168.0.100/samplers/upload.php");
3334
NetworkConfiguration.setPARAM_NAME("sample");
3435

3536
lb_main_welcome_message.setText("Bienvenido a la Aplicacion de Prueba!");
@@ -40,15 +41,18 @@ protected void onCreate(Bundle savedInstanceState) {
4041
protected Workflow getWorkflow() {
4142
Workflow workflow = new Workflow();
4243
Step step;
43-
44+
/*
4445
// InformationStep
45-
workflow.addStep(new InformationStep(1, "Informacion de prueba para ver que se muestra bien",4));
46+
workflow.addStep(new InformationStep(1, "Informacion de prueba para ver que se muestra bien",103));
4647
4748
// Insert Time
4849
workflow.addStep(new InsertTimeStep(101, "Seleccione la Hora de la muestra",102));
4950
5051
// Insert Date
5152
workflow.addStep(new InsertDateStep(102, "Seleccione la Fecha de la muestra",2));
53+
*/
54+
// Sound
55+
workflow.addStep(new SoundRecordStep(103, "Grabe algo",5));
5256

5357
// SelectOneStep
5458
ArrayList<SelectOneOption> optionsToSelect2 = new ArrayList<SelectOneOption>();
@@ -63,7 +67,7 @@ protected Workflow getWorkflow() {
6367
workflow.addStep(new LocationStep(4, "Seleccione la posicion de la muestra",7));
6468

6569
// PhotoStep
66-
PhotoStep photoStep = new PhotoStep(5, "Saque una foto de su gato","",6);
70+
PhotoStep photoStep = new PhotoStep(5, "Saque una foto de su gato","",7);
6771
// set help resource
6872
photoStep.setHelpResourseId(R.raw.photohelp);
6973
workflow.addStep(photoStep);

samplers.gradle

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -115,9 +115,13 @@ task samplers_config {
115115
stepClassGenerator = new org.cientopolis.samplers.InsertTimeStepClassGenerator(step.id, step.nextStepId, step.text)
116116
break
117117

118+
case "Sound":
119+
stepClassGenerator = new org.cientopolis.samplers.SoundRecordStepClassGenerator(step.id, step.nextStepId, step.text)
120+
break
121+
118122
default:
119123
stepClassGenerator = null;
120-
break;
124+
break
121125
}
122126

123127
if (stepClassGenerator != null) {

samplersFramework/build.gradle

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,9 @@ dependencies {
3838
testCompile 'junit:junit:4.12'
3939

4040
// Libraries dependencies
41+
// Location
4142
compile ('com.google.android.gms:play-services-location:10.2.1')
43+
// Maps
4244
compile ('com.google.android.gms:play-services-maps:10.2.1')
4345

4446
// Added manually as libraries (.jar in libs folder)

samplersFramework/src/main/AndroidManifest.xml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
<uses-permission android:name="android.permission.INTERNET" />
66
<uses-permission android:name="android.permission.CAMERA" />
77
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
8+
<uses-permission android:name="android.permission.RECORD_AUDIO" />
89

910
<!-- <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" /> -->
1011
<application
@@ -33,6 +34,7 @@
3334
<activity android:name=".ui.HelpActivity"
3435
android:label="@string/title_activity_help"
3536
android:theme="@style/SamplersFrameworkAppTheme"></activity>
37+
<service android:name=".framework.soundRecord.service.RecordingService" />
3638
</application>
3739

3840
</manifest>

samplersFramework/src/main/java/org/cientopolis/samplers/framework/StepResult.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
* Abstract class, there is a diferent StepResult subclass for the diferents {@link Step}.
99
* See the diferent subclasses for details.
1010
*/
11-
public abstract class StepResult implements Serializable {
11+
public class StepResult implements Serializable {
1212
/**
1313
* The id of the {@link Step} that generated the StepResult.
1414
*/

samplersFramework/src/main/java/org/cientopolis/samplers/framework/base/StepFragment.java

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -73,9 +73,7 @@ private void myOnAttach(Context context) {
7373

7474
if (context instanceof StepFragmentInteractionListener) {
7575
mListener = (StepFragmentInteractionListener) context;
76-
Log.e("MultipleSelectFragment", "mListener asignado");
7776
} else {
78-
Log.e("MultipleSelectFragment", "mListener NO asignado");
7977
throw new RuntimeException(context.toString()
8078
+ " must implement StepFragmentInteractionListener");
8179
}

samplersFramework/src/main/java/org/cientopolis/samplers/framework/information/InformationFragment.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ protected InformationStep getStep() {
4949
@Override
5050
protected StepResult getStepResult() {
5151
// TODO: 01/03/2017 see stepResult of InformationStep
52-
return null;
52+
return new InformationStepResult(getStep().getId());
5353
}
5454

5555

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
package org.cientopolis.samplers.framework.information;
2+
3+
import org.cientopolis.samplers.framework.StepResult;
4+
5+
/**
6+
* Created by Xavier on 01/12/2017.
7+
*/
8+
9+
public class InformationStepResult extends StepResult {
10+
/**
11+
* Constructor.
12+
*
13+
* @param stepId The id of the {@link Step} that generated the StepResult.
14+
*/
15+
public InformationStepResult(int stepId) {
16+
super(stepId);
17+
}
18+
}

0 commit comments

Comments
 (0)