trabajando en Actions,almacenamiento local de pwd y vocab. desce pcb

parent 85ae456d
android
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="CompilerConfiguration">
<option name="DEFAULT_COMPILER" value="Javac" />
<resourceExtensions />
<wildcardResourcePatterns>
<entry name="!?*.java" />
<entry name="!?*.form" />
<entry name="!?*.class" />
<entry name="!?*.groovy" />
<entry name="!?*.scala" />
<entry name="!?*.flex" />
<entry name="!?*.kt" />
<entry name="!?*.clj" />
</wildcardResourcePatterns>
<annotationProcessing>
<profile default="true" name="Default" enabled="false">
<processorPath useClasspath="true" />
</profile>
</annotationProcessing>
</component>
</project>
<component name="CopyrightManager">
<settings default="" />
</component>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="Encoding" useUTFGuessing="true" native2AsciiForPropertiesFiles="false" />
</project>
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="ProjectRootManager" version="2" languageLevel="JDK_1_6" assert-keyword="true" jdk-15="true" project-jdk-name="Android API 21 Platform" project-jdk-type="Android SDK" />
</project>
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="ProjectModuleManager">
<modules>
<module fileurl="file://$PROJECT_DIR$/.idea/android.iml" filepath="$PROJECT_DIR$/.idea/android.iml" />
</modules>
</component>
</project>
<component name="DependencyValidationManager">
<state>
<option name="SKIP_IMPORT_STATEMENTS" value="false" />
</state>
</component>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="VcsDirectoryMappings">
<mapping directory="$PROJECT_DIR$/.." vcs="Git" />
</component>
</project>
\ No newline at end of file
......@@ -37,22 +37,21 @@ public class Action {
public String get_type() { return this.type;}
protected JSONObject get_json() {
final String param_id_stu="student";
final String param_id_sup="supervisor";
final String param_id_stu="id_stu";
final String param_id_sup="id_sup";
final String param_id_dev="device";
final String param_timestamp="timestamp";
final Date currentTime = new Date();
SimpleDateFormat datetime = new SimpleDateFormat("yyyy-MM-dd hh:mm:ss");
try {
JSONObject jsonObject = new JSONObject()
// .put(param_id_stu, PCBcontext.getPcbdb().getCurrentUser().get_id_stu())
.put("id_stu", PCBcontext.getPcbdb().getCurrentUser().get_id_stu()) //ELIMINAR CUANDO SE UNIFIQUE CRITERIO
.put(param_timestamp, datetime.format(currentTime))
.put("id_dev", PCBcontext.getDevice().getDeviceID()); //ELIMINAR CUANDO SE UNIFIQUE CRITERIO
//.put(param_id_dev, PCBcontext.getDevice().getDeviceID());
.put(param_id_stu, PCBcontext.getPcbdb().getCurrentUser().get_id_stu())
.put(param_timestamp, datetime.format(currentTime));
if (PCBcontext.getPcbdb().getCurrentUser().has_supervisor())
jsonObject.put(param_id_sup,PCBcontext.getPcbdb().getCurrentUser().get_id_sup());
//TODO Decidir qué almacenar con DEVICE
//if (PCBcontext.getDevice().getDeviceID()!=null)
// jsonObject.put(param_id_dev, PCBcontext.getDevice().getDeviceID());
return jsonObject;
}catch(JSONException e) {
......
......@@ -50,7 +50,7 @@ public class ActionLog implements iRestapiListener {
actions= "{ actions:[" + actions.substring(1) + "] }";
params.put("actions",actions);
Log.i(this.getClass().getCanonicalName()," Sending batch actions: "+actions);
PCBcontext.getRestapiWrapper().ask("/stu/" + PCBcontext.getPcbdb().getCurrentUser().get_id_sup() + "/actions_batch", params, "post", this);
PCBcontext.getRestapiWrapper().ask("/stu/" + PCBcontext.getPcbdb().getCurrentUser().get_id_stu() + "/actions_batch", params, "post", this);
params.clear();
}
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment