Commit 5a6acdc0 by Arturo Montejo Ráez

Merge branch 'develop' of http://scm.ujaen.es/softuno/pictogram into develop

parents b09c68a3 409b1325
Showing with 608 additions and 310 deletions
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<project version="4"> <project version="4">
<component name="ChangeListManager"> <component name="ChangeListManager">
<list default="true" id="10daeba4-0692-476d-a3da-642b4123cfdd" name="Default" comment="" /> <list default="true" id="10daeba4-0692-476d-a3da-642b4123cfdd" name="Default" comment="">
<change type="MODIFICATION" beforePath="$PROJECT_DIR$/.idea/workspace.xml" afterPath="$PROJECT_DIR$/.idea/workspace.xml" />
</list>
<ignored path="android.iws" /> <ignored path="android.iws" />
<ignored path=".idea/workspace.xml" /> <ignored path=".idea/workspace.xml" />
<option name="EXCLUDED_CONVERTED_TO_IGNORED" value="true" /> <option name="EXCLUDED_CONVERTED_TO_IGNORED" value="true" />
...@@ -20,7 +22,18 @@ ...@@ -20,7 +22,18 @@
<favorites_list name="android" /> <favorites_list name="android" />
</component> </component>
<component name="FileEditorManager"> <component name="FileEditorManager">
<leaf /> <leaf SIDE_TABS_SIZE_LIMIT_KEY="300">
<file leaf-file-name="workspace.xml" pinned="false" current-in-tab="true">
<entry file="file://$PROJECT_DIR$/.idea/workspace.xml">
<provider selected="true" editor-type-id="text-editor">
<state vertical-scroll-proportion="0.0">
<caret line="0" column="0" selection-start-line="0" selection-start-column="0" selection-end-line="0" selection-end-column="0" />
<folding />
</state>
</provider>
</entry>
</file>
</leaf>
</component> </component>
<component name="FindManager"> <component name="FindManager">
<FindUsagesManager> <FindUsagesManager>
...@@ -35,11 +48,18 @@ ...@@ -35,11 +48,18 @@
<projects_view /> <projects_view />
</option> </option>
</component> </component>
<component name="IdeDocumentHistory">
<option name="CHANGED_PATHS">
<list>
<option value="$PROJECT_DIR$/.idea/workspace.xml" />
</list>
</option>
</component>
<component name="ProjectFrameBounds"> <component name="ProjectFrameBounds">
<option name="x" value="65" /> <option name="x" value="-8" />
<option name="y" value="24" /> <option name="y" value="-8" />
<option name="width" value="1615" /> <option name="width" value="1936" />
<option name="height" value="1026" /> <option name="height" value="1176" />
</component> </component>
<component name="ProjectLevelVcsManager" settingsEditedManually="true"> <component name="ProjectLevelVcsManager" settingsEditedManually="true">
<OptionsSetting value="true" id="Add" /> <OptionsSetting value="true" id="Add" />
...@@ -69,6 +89,13 @@ ...@@ -69,6 +89,13 @@
<foldersAlwaysOnTop value="true" /> <foldersAlwaysOnTop value="true" />
</navigator> </navigator>
<panes> <panes>
<pane id="AndroidView">
<subPane />
</pane>
<pane id="Scratches" />
<pane id="Scope">
<subPane subId="Project Files" />
</pane>
<pane id="ProjectPane"> <pane id="ProjectPane">
<subPane> <subPane>
<PATH> <PATH>
...@@ -82,13 +109,6 @@ ...@@ -82,13 +109,6 @@
<pane id="PackagesPane"> <pane id="PackagesPane">
<subPane /> <subPane />
</pane> </pane>
<pane id="Scope">
<subPane subId="Project Files" />
</pane>
<pane id="AndroidView">
<subPane />
</pane>
<pane id="Scratches" />
</panes> </panes>
</component> </component>
<component name="PropertiesComponent"> <component name="PropertiesComponent">
...@@ -100,6 +120,12 @@ ...@@ -100,6 +120,12 @@
<property name="MemberChooser.copyJavadoc" value="false" /> <property name="MemberChooser.copyJavadoc" value="false" />
<property name="last_opened_file_path" value="$PROJECT_DIR$" /> <property name="last_opened_file_path" value="$PROJECT_DIR$" />
<property name="recentsLimit" value="5" /> <property name="recentsLimit" value="5" />
<property name="settings.editor.selected.configurable" value="preferences.lookFeel" />
<property name="settings.editor.splitter.proportion" value="0.2" />
<property name="project.structure.last.edited" value="Project" />
<property name="project.structure.proportion" value="0.0" />
<property name="project.structure.side.proportion" value="0.0" />
<property name="editor.config.accepted" value="true" />
</component> </component>
<component name="RunManager"> <component name="RunManager">
<configuration default="true" type="AndroidRunConfigurationType" factoryName="Android Application"> <configuration default="true" type="AndroidRunConfigurationType" factoryName="Android Application">
...@@ -293,7 +319,7 @@ ...@@ -293,7 +319,7 @@
<servers /> <servers />
</component> </component>
<component name="ToolWindowManager"> <component name="ToolWindowManager">
<frame x="65" y="24" width="1615" height="1026" extended-state="6" /> <frame x="-8" y="-8" width="1936" height="1176" extended-state="6" />
<editor active="false" /> <editor active="false" />
<layout> <layout>
<window_info id="Palette&#9;" active="false" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="2" side_tool="false" content_ui="tabs" /> <window_info id="Palette&#9;" active="false" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="2" side_tool="false" content_ui="tabs" />
...@@ -301,25 +327,25 @@ ...@@ -301,25 +327,25 @@
<window_info id="Terminal" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="7" side_tool="false" content_ui="tabs" /> <window_info id="Terminal" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="7" side_tool="false" content_ui="tabs" />
<window_info id="TODO" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="6" side_tool="false" content_ui="tabs" /> <window_info id="TODO" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="6" side_tool="false" content_ui="tabs" />
<window_info id="Capture Analysis" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="4" side_tool="false" content_ui="tabs" /> <window_info id="Capture Analysis" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="4" side_tool="false" content_ui="tabs" />
<window_info id="Structure" active="false" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.24905898" sideWeight="0.5" order="1" side_tool="false" content_ui="tabs" /> <window_info id="Structure" active="false" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.24868283" sideWeight="0.5" order="1" side_tool="false" content_ui="tabs" />
<window_info id="Project" active="true" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="true" show_stripe_button="true" weight="0.17440401" sideWeight="0.5" order="0" side_tool="false" content_ui="combo" /> <window_info id="Project" active="false" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="true" show_stripe_button="true" weight="0.1743941" sideWeight="0.5" order="0" side_tool="false" content_ui="combo" />
<window_info id="Debug" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.4" sideWeight="0.5" order="3" side_tool="false" content_ui="tabs" /> <window_info id="Debug" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.4" sideWeight="0.5" order="3" side_tool="false" content_ui="tabs" />
<window_info id="Run" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="2" side_tool="false" content_ui="tabs" /> <window_info id="Run" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="2" side_tool="false" content_ui="tabs" />
<window_info id="Favorites" active="false" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="2" side_tool="true" content_ui="tabs" /> <window_info id="Favorites" active="false" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="2" side_tool="true" content_ui="tabs" />
<window_info id="Event Log" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="7" side_tool="true" content_ui="tabs" /> <window_info id="Event Log" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="7" side_tool="true" content_ui="tabs" />
<window_info id="Capture Tool" active="false" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="3" side_tool="false" content_ui="tabs" /> <window_info id="Capture Tool" active="false" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="3" side_tool="false" content_ui="tabs" />
<window_info id="Version Control" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="7" side_tool="false" content_ui="tabs" /> <window_info id="Version Control" active="true" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="true" show_stripe_button="true" weight="0.32907662" sideWeight="0.5" order="7" side_tool="false" content_ui="tabs" />
<window_info id="Changes" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="7" side_tool="false" content_ui="tabs" /> <window_info id="Changes" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="7" side_tool="false" content_ui="tabs" />
<window_info id="Ant Build" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.25" sideWeight="0.5" order="1" side_tool="false" content_ui="tabs" /> <window_info id="Ant Build" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.25" sideWeight="0.5" order="1" side_tool="false" content_ui="tabs" />
<window_info id="Android Monitor" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="7" side_tool="false" content_ui="tabs" /> <window_info id="Android Monitor" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="7" side_tool="false" content_ui="tabs" />
<window_info id="Gradle Console" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="7" side_tool="true" content_ui="tabs" />
<window_info id="Build Variants" active="false" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="3" side_tool="true" content_ui="tabs" /> <window_info id="Build Variants" active="false" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="3" side_tool="true" content_ui="tabs" />
<window_info id="Gradle Console" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="7" side_tool="true" content_ui="tabs" />
<window_info id="Application Servers" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="7" side_tool="false" content_ui="tabs" /> <window_info id="Application Servers" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="7" side_tool="false" content_ui="tabs" />
<window_info id="Hierarchy" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.25" sideWeight="0.5" order="2" side_tool="false" content_ui="combo" /> <window_info id="Hierarchy" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.25" sideWeight="0.5" order="2" side_tool="false" content_ui="combo" />
<window_info id="Memory Monitor" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="7" side_tool="true" content_ui="tabs" /> <window_info id="Memory Monitor" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="7" side_tool="true" content_ui="tabs" />
<window_info id="Cvs" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.25" sideWeight="0.5" order="4" side_tool="false" content_ui="tabs" /> <window_info id="Cvs" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.25" sideWeight="0.5" order="4" side_tool="false" content_ui="tabs" />
<window_info id="Palette" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="3" side_tool="false" content_ui="tabs" />
<window_info id="Android Model" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="4" side_tool="true" content_ui="tabs" /> <window_info id="Android Model" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="4" side_tool="true" content_ui="tabs" />
<window_info id="Palette" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="3" side_tool="false" content_ui="tabs" />
<window_info id="Message" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="0" side_tool="false" content_ui="tabs" /> <window_info id="Message" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="0" side_tool="false" content_ui="tabs" />
<window_info id="Find" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="1" side_tool="false" content_ui="tabs" /> <window_info id="Find" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="1" side_tool="false" content_ui="tabs" />
<window_info id="Captures" active="false" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="3" side_tool="false" content_ui="tabs" /> <window_info id="Captures" active="false" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="3" side_tool="false" content_ui="tabs" />
...@@ -352,4 +378,95 @@ ...@@ -352,4 +378,95 @@
</breakpoint-manager> </breakpoint-manager>
<watches-manager /> <watches-manager />
</component> </component>
<component name="editorHistoryManager">
<entry file="file://$PROJECT_DIR$/.idea/workspace.xml">
<provider selected="true" editor-type-id="text-editor">
<state vertical-scroll-proportion="0.0">
<caret line="0" column="0" selection-start-line="0" selection-start-column="0" selection-end-line="0" selection-end-column="0" />
<folding />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/.idea/workspace.xml">
<provider selected="true" editor-type-id="text-editor">
<state vertical-scroll-proportion="0.0">
<caret line="0" column="0" selection-start-line="0" selection-start-column="0" selection-end-line="0" selection-end-column="0" />
<folding />
</state>
</provider>
</entry>
</component>
<component name="masterDetails">
<states>
<state key="ArtifactsStructureConfigurable.UI">
<settings>
<artifact-editor />
<splitter-proportions>
<option name="proportions">
<list>
<option value="0.2" />
</list>
</option>
</splitter-proportions>
</settings>
</state>
<state key="FacetStructureConfigurable.UI">
<settings>
<last-edited>No facets are configured</last-edited>
<splitter-proportions>
<option name="proportions">
<list>
<option value="0.2" />
</list>
</option>
</splitter-proportions>
</settings>
</state>
<state key="GlobalLibrariesConfigurable.UI">
<settings>
<splitter-proportions>
<option name="proportions">
<list>
<option value="0.2" />
</list>
</option>
</splitter-proportions>
</settings>
</state>
<state key="JdkListConfigurable.UI">
<settings>
<last-edited>1.7</last-edited>
<splitter-proportions>
<option name="proportions">
<list>
<option value="0.2" />
</list>
</option>
</splitter-proportions>
</settings>
</state>
<state key="ModuleStructureConfigurable.UI">
<settings>
<splitter-proportions>
<option name="proportions">
<list>
<option value="0.2" />
</list>
</option>
</splitter-proportions>
</settings>
</state>
<state key="ProjectLibrariesConfigurable.UI">
<settings>
<splitter-proportions>
<option name="proportions">
<list>
<option value="0.2" />
</list>
</option>
</splitter-proportions>
</settings>
</state>
</states>
</component>
</project> </project>
\ No newline at end of file
...@@ -13,7 +13,7 @@ ...@@ -13,7 +13,7 @@
<content url="file://$MODULE_DIR$"> <content url="file://$MODULE_DIR$">
<excludeFolder url="file://$MODULE_DIR$/.gradle" /> <excludeFolder url="file://$MODULE_DIR$/.gradle" />
</content> </content>
<orderEntry type="inheritedJdk" /> <orderEntry type="jdk" jdkName="1.7" jdkType="JavaSDK" />
<orderEntry type="sourceFolder" forTests="false" /> <orderEntry type="sourceFolder" forTests="false" />
</component> </component>
</module> </module>
\ No newline at end of file
...@@ -14,29 +14,28 @@ android { ...@@ -14,29 +14,28 @@ android {
versionCode 1 versionCode 1
versionName "1.0" versionName "1.0"
signingConfig signingConfigs.release_config signingConfig signingConfigs.release_config
resValue "string", "db_name", "PCB.db"
resValue "string", "core_vocabulary", "core_vocabulary"
resValue "integer", "rows", "5"
resValue "integer", "columns", "10"
} }
buildTypes { buildTypes {
release { release {
minifyEnabled false minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
resValue "string", "server", "https://pre.yottacode.com" resValue "string", "server", "https://pre.yottacode.com"
resValue "string", "db_name", "PCB.db"
resValue "bool", "force_db_create", "false" resValue "bool", "force_db_create", "false"
resValue "bool", "ssl_connect", "false" resValue "bool", "ssl_connect", "false"
resValue "bool", "force_img_download", "false" resValue "bool", "force_img_download", "false"
resValue "integer", "netservice_timing", "20" resValue "integer", "netservice_timing", "20"
resValue "integer", "rows", "5"
resValue "integer", "columns", "10"
} }
debug { debug {
resValue "string", "server", "https://dev.yottacode.com"
resValue "string", "db_name", "PCB.db"
resValue "bool", "force_db_create", "false" resValue "bool", "force_db_create", "false"
resValue "bool", "ssl_connect", "false" resValue "bool", "ssl_connect", "false"
resValue "bool", "force_img_download", "false" resValue "bool", "force_img_download", "false"
resValue "integer", "netservice_timing", "20" resValue "integer", "netservice_timing", "20"
resValue "integer", "rows", "5"
resValue "integer", "columns", "10"
} }
} }
productFlavors { productFlavors {
......
package com.yottacode.pictogram.grammar;
import android.util.Log;
import com.yottacode.pictogram.dao.Picto;
import com.yottacode.pictogram.tools.PCBcontext;
import org.grammaticalframework.pgf.Concr;
import org.grammaticalframework.pgf.PGF;
import org.grammaticalframework.pgf.ParseError;
import org.grammaticalframework.pgf.TokenProb;
import java.io.IOException;
import java.io.InputStream;
import java.util.Hashtable;
import java.util.LinkedList;
import java.util.Vector;
/**
* Created by Fernando on 01/06/2016.
*/
public class SemanticGrammar {
private PGF pgf;
Concr language;
String current_msg;
Hashtable<String,Integer> exp_cat; //for a given expression, which is the category. It's required for predictive grammar
public SemanticGrammar(String grammar, String language) {
System.loadLibrary("jpgf");
this.exp_cat = new Hashtable<>(Vocabulary.DEFAULT_VOCABULARY_SIZE);
try {
InputStream in = null;
in = PCBcontext.getContext().getAssets().open(grammar);
Log.i(this.getClass().getCanonicalName(), "Trying to open " + grammar);
this.language = this.pgf.getLanguages().get(language);
this.pgf = PGF.readPGF(in);
this.current_msg="";
} catch (IOException e) {
e.printStackTrace();
}
}
/**
* It adds a new expresion with a given cat
*/
public void add_translation(String translation, int cat) {
this.exp_cat.put(translation,cat);
}
/**
* It returns the category for a given expression. It is required to implement the semantic grammar
* @param translation
* @return
*/
public int get_expr_cat(String translation) {
return this.exp_cat.get(translation);
}
public LinkedList<Picto> startSentence() {
this.current_msg="";
return PCBcontext.getVocabulary().pictos.get(Picto.NO_CATEGORY);
}
public LinkedList<Picto> next_categories(String expression) {
LinkedList<Picto> next_cats;
this.current_msg += expression + " ";
try {
Iterable<TokenProb> next_tokens = language.complete(pgf.getStartCat(), this.current_msg, "");
if (!next_tokens.iterator().hasNext())
next_cats = startSentence();
else {
next_cats = new LinkedList<>();
java.util.LinkedList<Picto> categories = PCBcontext.getVocabulary().pictos.get(Picto.NO_CATEGORY);
for (TokenProb tk : next_tokens) {
String translation = tk.getToken();
int cat = get_expr_cat(tk.getToken());
Log.i(this.getClass().getSimpleName(), "Next: " + translation + ". Cat: " + cat);
if (!next_cats.contains(cat)) {
next_cats.add(categories.get(cat));
}
}
}
} catch (ParseError parseError) {
Log.e(this.getClass().getCanonicalName(), "Error parsing " + this.current_msg + ". Error:" + parseError.getMessage() + " (token " + parseError.getToken() + ")");
next_cats = startSentence();
}
return next_cats;
}
}
package com.yottacode.pictogrammar;
import java.io.Serializable;
public class Language implements Serializable {
private static final long serialVersionUID = 1L;
private final String mLangCode;
private final String mLangName;
private final String mConcrete;
public Language(String langCode, String langName, String concrete) {
mLangCode = langCode;
mLangName = langName;
mConcrete = concrete;
}
public String getLangCode() {
return mLangCode;
}
public String getLangName() {
return mLangName;
}
String getConcrete() {
return mConcrete;
}
@Override
public String toString() {
return getLangName();
}
@Override
public boolean equals(Object o) {
Language other = (Language) o;
return mLangCode.equals(other.mLangCode);
}
}
\ No newline at end of file
...@@ -12,141 +12,64 @@ package com.yottacode.pictogrammar; ...@@ -12,141 +12,64 @@ package com.yottacode.pictogrammar;
import android.app.ProgressDialog; import android.app.ProgressDialog;
import android.os.AsyncTask; import android.os.AsyncTask;
import android.widget.Toast;
import java.io.FileNotFoundException;
import java.io.IOException; import java.io.IOException;
import java.io.InputStream; import java.io.InputStream;
import java.util.LinkedList; import java.util.Map;
import java.util.Vector; import java.util.Vector;
import org.grammaticalframework.PGF;
import org.json.JSONException; import org.grammaticalframework.sg.SG;
import org.json.JSONObject;
import org.grammaticalframework.pgf.*;
import com.yottacode.pictogram.action.PictoAction;
import com.yottacode.pictogram.action.PictosAction; import com.yottacode.pictogram.dao.PCBDBHelper;
import com.yottacode.pictogram.dao.Picto;
import com.yottacode.pictogram.dao.User;
import com.yottacode.pictogram.grammar.Vocabulary;
import com.yottacode.pictogram.grammar.iVocabularyListener;
import com.yottacode.pictogram.net.iImgDownloaderListener;
import com.yottacode.pictogram.tools.Img;
import com.yottacode.pictogram.tools.PCBcontext; import com.yottacode.pictogram.tools.PCBcontext;
import com.yottacode.pictogram.tts.TTSHelper; import com.yottacode.pictogram.tts.TTSHelper;
import com.yottacode.pictogram.R; import com.yottacode.pictogram.R;
import com.yottacode.net.SSLDummyContext;
public class Translate extends Activity implements iVocabularyListener, iImgDownloaderListener
public class Translate extends Activity
{ {
private ArrayAdapter mArrayAdapter; private ArrayAdapter mArrayAdapter;
private PGF mPGF; private PGF mPGF;
private TTSHelper tts; private TTSHelper tts;
LinkedList<Picto> pictos; private GrammarLoader mGrammarLoader;
private ConcrLoader mSourceLoader;
private ConcrLoader mTargetLoader;
private ConcrLoader mOtherLoader;
private String mGrammar = "SUpO.pgf" ;
// String constant for logs // String constant for logs
private final String LOG_TAG = this.getClass().getSimpleName(); // Or .getCanonicalName() private final String TAG = this.getClass().getSimpleName(); // Or .getCanonicalName()
// String constan for token // String constan for token
private final String TOKEN = "eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJvZmZpY2UiOnsiaWQiOjM4MywibmFtZSI6IkNvbXVuaWNhY2nDs24gQXVtZW50YXRpdmEgSkHDqW4gKENBSkEpIiwiYWRkcmVzcyI6IlBhcmFqZSBMYXMgTGFndW5pbGxhcywgRWQgQTMsIHByaW1lcmEgcGxhdGEsIDIzMDcxLiBKYcOpbiIsImVtYWlsIjoiZG9mZXJAdWphZW4uZXMiLCJwaG9uZTEiOiIrMzQgOTUzIDIxIDI4IDg4IiwicGhvbmUyIjpudWxsLCJsYW5nIjoiZXMtZXMiLCJjb3VudHJ5IjoiRVMiLCJhZG1pbiI6MjMsImNvbnRhY3RQZXJzb24iOiJGZXJuYW5kbyBNYXJ0w61uZXogU2FudGlhZ28iLCJtYXhTdHVkZW50cyI6MiwiY3VycmVudFN0dWRlbnRzIjowfSwiaWQiOjIzLCJuYW1lIjoiRmVybmFuZG8iLCJzdXJuYW1lIjoiTWFydMOtbmV6IFNhbnRpYWdvIiwiZ2VuZGVyIjoiTSIsInBpYyI6Imh0dHA6Ly93d3dkaS51amFlbi5lcy9zaXRlcy9kZWZhdWx0L2ZpbGVzL3lvLmpwZz8xNDQ4MDE5MzU2IiwiYWRkcmVzcyI6bnVsbCwiY291bnRyeSI6bnVsbCwiZW1haWwiOiJkb2ZlckB1amFlbi5lcyIsInBob25lIjoiKzM0OTUzMjEyODg4IiwibGFuZyI6ImVzLWVzIiwiYWN0aXZlIjp0cnVlLCJ0dHNFbmdpbmUiOm51bGwsImlzU3VwQWRtaW4iOnRydWUsImlhdCI6MTQ1Mjg4NjE1NSwiZXhwIjoxNDUyODkzMzU1fQ.dmxKE4qH1DqBM7BYakgwD0L6y1437_2Ba3T7rHnOIcE";
private login() {
if (RestapiWrapper.ping(context.getResources().getString(R.string.server),"server/ping",null)) {
// Tengo conexión a internet. Compruebo ONLINE
RestapiWrapper wrapper = PCBcontext.getRestapiWrapper();
if (username.contains("@")){
// Es un supervisor
String operation = "sup/login";
Hashtable<String, String> postDataParams = new Hashtable<String, String>();
postDataParams.put("email", username);
postDataParams.put("password", password);
wrapper.ask(operation, postDataParams, "post", (iRestapiListener) context);
} else{
// Es un estudiante
String operation = "stu/login";
Hashtable<String, String> postDataParams = new Hashtable<String, String>();
postDataParams.put("username", username);
postDataParams.put("password", password);
wrapper.ask(operation, postDataParams, "post", (iRestapiListener) context);
}
} else{
// NO Tengo conexión a internet. Compruebo OFFLINE
if (username.contains("@")) {
// Es un supervisor
// Necesito una función local que dado el username y pass me devuelva el listado de usuarios o el usuario, si es correcto
// ....
} else {
// Es un estudiante
}
// ....
}
}
/** Called when the activity is first created. */ /** Called when the activity is first created. */
@Override @Override
public void onCreate(Bundle savedInstanceState) public void onCreate(Bundle savedInstanceState)
{ {
super.onCreate(savedInstanceState); super.onCreate(savedInstanceState);
pictos=new LinkedList<Picto>();
setContentView(R.layout.activity_main); setContentView(R.layout.activity_main);
mGrammarLoader = new GrammarLoader();
mGrammarLoader.start();
/*Abrimos la base de datos*/ Language prefSourceLang = new Language("es-ES", "Spanish", "SUpO-ES");
Log.i(LOG_TAG, "1) opening pcb"); Language prefTargetLang = new Language("en-US", "English", "SUpO-EN");
SSLDummyContext.init(getResources().getBoolean(R.bool.ssl_connect));
// TODO token for device or for user?
Vector<User> users = new Vector<User>(3);
try {
User adela_user= new User(37,"Adela", "Carmona","upload/supervisors/1064159640.jpg", "F", "es-es", "{\"stu-att\" : [{ \"categories\" : \"on\", \"input feedback\" : [ \"vibration\", \"tts\" ], \"input selection\" : \"click\", \"pictogram size\" : \"medium\", \"tts engine\" : \"IVONA Text-to-Speech HQ\", \"tts voice\": \"es\" }]}",
32, "Belen", "Lopez", "http://www4.ujaen.es/~dofer/pictures/supervisor/belen.jpg", "F", "es-es", "");
users.add(adela_user);
users.add(new User(2, "Carlos", "Carmona", "http://www4.ujaen.es/~dofer/pictures/student/carlos.jpg", "M", "es-es", "{\"stu-att\" : [{ \"categories\" : \"on\", \"input feedback\" : \"light_up\" , \"input selection\" : \"drag\", \"pictogram size\" : \"large\" }]}",
1, "Belen", "Lopez", "http://www4.ujaen.es/~dofer/pictures/supervisor/belen.jpg","M", "es-es", ""));
users.add(new User(2, "Carlos", "Carmona", "http://www4.ujaen.es/~dofer/pictures/student/carlos.jpg", "M", "es-es", "{\"stu-att\" : [{ \"categories\" : \"on\", \"input feedback\" : \"light_up\" , \"input selection\" : \"drag\", \"pictogram size\" : \"large\" }]}",
2, "Antonio", "Roldan", "http://www4.ujaen.es/~dofer/pictures/supervisor/antonio.jpg", "M", "es-es", ""));
users.add(new User(3, "Juan", "Tartán", "http://www4.ujaen.es/~dofer/pictures/student/juan.jpg", "M", "es-es", "",
2, "Antonio", "Roldan", "http://www4.ujaen.es/~dofer/pictures/supervisor/antonio.jpg", "M", "es-es", ""));
users.add(new User(4, "Rosa", "Mateos", "http://www4.ujaen.es/~dofer/pictures/student/rosa.jpg", "M", "es-es", "",
2, "Antonio", "Roldan", "http://www4.ujaen.es/~dofer/pictures/supervisor/antonio.jpg", "M", "es-es", ""));
User alumno_picto = new User(23, "Arturito", "Alumno" +
" Arturo", "http://www4.ujaen.es/~dofer/pictures/student/rosa.jpg", "M", "es-es", "");
users.add(alumno_picto);
PCBcontext.init(this);
PCBcontext.getDevice().setSerial("serial1");
PCBcontext.getDevice().setDeviceID("deviceID");
PCBcontext.set_user(alumno_picto, TOKEN, this); mSourceLoader = new ConcrLoader(prefSourceLang);
Log.i(LOG_TAG, "2) OnCreate - Serial:" + PCBcontext.getDevice().getSerial() + " dev. id:" + mSourceLoader.start();
PCBcontext.getDevice().getDeviceID() + " token:" + TOKEN);
if (prefSourceLang == prefTargetLang) {
mTargetLoader = mSourceLoader;
} else {
// ITERAR SOBRE EL VOCABULARIO mTargetLoader = new ConcrLoader(prefTargetLang);
//for(Picto p : vocabulary) mTargetLoader.start();
// Log.d(LOG_TAG, "4)" + p.toString());
PCBcontext.getVocabulary().listen(PCBcontext.getRoom(), this);
// room2=new Room2(getResources().getString(R.string.url_server), 443);
} catch (JSONException e) {
e.printStackTrace();
Log.e(LOG_TAG,"5) USER JSON ERROR: "+e.getMessage());
} catch (IOException e) {
e.printStackTrace();
Log.e(LOG_TAG,"5) IO EXCEPTION: "+e.getMessage());
} }
tts = new TTSHelper(this,"IVONA Text-to-Speech HQ");
tts = new TTSHelper(this);
//new LoadPGFTask().execute();
mArrayAdapter = new ArrayAdapter(this, R.layout.listitem); mArrayAdapter = new ArrayAdapter(this, R.layout.listitem);
...@@ -174,43 +97,7 @@ public class Translate extends Activity implements iVocabularyListener, iImgDown ...@@ -174,43 +97,7 @@ public class Translate extends Activity implements iVocabularyListener, iImgDown
mArrayAdapter.add(input); mArrayAdapter.add(input);
} }
public void changeit(View v) { public void changeit(View v) {
try {
Vector<User> users = PCBcontext.getDevice().getUsers();
TextView tv = (TextView)findViewById(R.id.edittext_student);
String input = tv.getText().toString();
ImageView image = (ImageView) findViewById(R.id.image);
//this.vocabularyTalk.addPicto(input);
//room2.setup();
mArrayAdapter.clear();
mArrayAdapter.add("*Students*");
boolean found=false;
for (User user : users) {
if (user.get_name_stu().equalsIgnoreCase(input)) {
found=true;
mArrayAdapter.add(user.get_name_stu() + "..." + user.get_img_stu().exists_bitmap(this) + "...." + user.get_img_stu().get_bitmap(this));
((ImageView) findViewById(R.id.image)).setImageBitmap(user.get_img_stu().get_bitmap(this));
} else mArrayAdapter.add(user.get_name_stu());
}
if (!found) {
for (Picto picto: PCBcontext.getVocabulary())
if (picto.get_translation().equalsIgnoreCase(input)) {
((ImageView) findViewById(R.id.image)).setImageBitmap(picto.get_bitmap(this));
PCBcontext.getActionLog().log(new PictoAction(PictoAction.ADD, picto));
pictos.add(picto);
}
}
if (input.equals("entrega")) {
PCBcontext.getActionLog().log(new PictosAction(pictos));
pictos.clear();
}
} catch (IOException e) {
Log.e(this.getClass().getCanonicalName(), "IO ERROR: " + e.getMessage());
} catch (JSONException e) {
Log.e(this.getClass().getCanonicalName(), "JSON ERROR: " + e.getMessage());
}
} }
public void showTTS(View v) { public void showTTS(View v) {
...@@ -230,104 +117,165 @@ public class Translate extends Activity implements iVocabularyListener, iImgDown ...@@ -230,104 +117,165 @@ public class Translate extends Activity implements iVocabularyListener, iImgDown
} }
/* JSONObject --> Hashtable<arg, Object> */
@Override
public void change(action action, int picto_cat, int picto_id, JSONObject args) {
Log.e(this.getClass().getName(),"Vocabulary action listened: "+action);
}
@Override
public void loadComplete() {
Log.i(this.getClass().getName(),"Vocabulary load images completed");
}
@Override
public void loadImg(Img image) {
Log.i(this.getClass().getName(),"Vocabulary image modified");
}
/** /**
* This class is used to load the PGF file asychronously. * This class is used to parse a sentence asychronously.
* It display a blocking progress dialog while doing so. * It display a blocking progress dialog while doing so.
*/ */
private class LoadPGFTask extends AsyncTask<Void, Void, PGF> { private class TranslateTask extends AsyncTask<String, Void, String[]> {
private ProgressDialog progress; private ProgressDialog progress;
protected void onPreExecute() { protected void onPreExecute() {
// Display loading popup // Display loading popup
this.progress = this.progress =
ProgressDialog.show(Translate.this,"Translate","Loading grammar, please wait",true); ProgressDialog.show(Translate.this,"Translate","Parsing, please wait",true);
} }
protected PGF doInBackground(Void... a) { protected String[] doInBackground(String... s) {
int pgf_res = R.raw.supo; return null;
InputStream is = getResources().openRawResource(pgf_res);
try {
PGF pgf = (PGF)null; //PGFBuilder.fromInputStream(is, new String[] {"SUpO_EN","SUpO_ES"});
return pgf;
} catch (Exception e) {
throw new RuntimeException(e);
}
} }
protected void onPostExecute(PGF result) { protected void onPostExecute(String[] result) {
mPGF = result; mArrayAdapter.clear();
for (String sentence : result)
mArrayAdapter.add(sentence);
if (this.progress != null) if (this.progress != null)
this.progress.dismiss(); // Remove loading popup this.progress.dismiss(); // Remove loading popup
} }
} }
/** private class GrammarLoader extends Thread {
* This class is used to parse a sentence asychronously. private PGF mPGF;
* It display a blocking progress dialog while doing so.
*/
private class TranslateTask extends AsyncTask<String, Void, String[]> {
private ProgressDialog progress; public GrammarLoader() {
mPGF = null;
}
protected void onPreExecute() { public PGF getGrammar() {
// Display loading popup return mPGF;
this.progress =
ProgressDialog.show(Translate.this,"Translate","Parsing, please wait",true);
} }
protected String[] doInBackground(String... s) { public void run() {
InputStream in = null;
try { try {
// Creating a Parser object for the FoodEng concrete grammar
tts.speakText(s[0]); System.loadLibrary("jpgf");
Parser mParser = new Parser(mPGF, "SUpO_ES"); for (String lo: getAssets().list("."))
// Spliting the input (basic tokenization) Log.i(this.getClass().getSimpleName(),"LOCALES:"+lo);
String[] tokens = s[0].split(" "); in = getAssets().open(mGrammar);
//parsing the tokens Log.i(TAG, "Trying to open " + mGrammar);
ParseState mParseState = mParser.parse(tokens); long t1 = System.currentTimeMillis();
Tree[] trees = (Tree[])mParseState.getTrees(); mPGF = PGF.readPGF(in);
tokens=mParseState.predict();
/* String[] translations = new String[trees.length]; long t2 = System.currentTimeMillis();
// Creating a Linearizer object for the FoodCat concrete grammar Log.i(TAG, mGrammar + " loaded (" + (t2 - t1) + " ms)");
Linearizer mLinearizer = new Linearizer(mPGF, "SUpO_EN");
// Linearizing all the trees // Type typ = mPGF.getFunctionType("Bulgarian");
for (int i = 0 ; i < trees.length ; i++) { // System.out.println(typ.getCategory());
System.out.println(mPGF .getAbstractName());
for (Map.Entry<String,Concr> entry : mPGF .getLanguages().entrySet()) {
Log.i(this.getClass().getSimpleName(), entry.getKey() + " Language: " + entry.getValue().getName());
}
Concr eng = mPGF.getLanguages().get("SUpO_EN");
InputStream is_es= in = getAssets().open("SUpO_ES.gfo");
eng.unload();
eng.load(is_es);
try {
int i=0;
for (ExprProb ep : eng.parse(mPGF.getStartCat(), "I want salty chips")) {
if (i++>5) break;
Log.e(this.getClass().getSimpleName(), "Next: [" + ep.getProb() + "] " + ep.getExpr());
}
i=0;
java.util.Vector<Integer> categories=new Vector<>();
for (TokenProb tk : eng.complete(mPGF.getStartCat(),"I want salty","")) {
String translation=tk.getToken();
Log.i(this.getClass().getSimpleName(), "Next: " + translation );
}
} catch (ParseError e) {
Log.e(this.getClass().getSimpleName(),"Parsing failed at token \""+e.getToken()+"\"");
}
} catch (FileNotFoundException e) {
Log.e(TAG, "File not found", e);
} catch (IOException e) {
Log.e(TAG, "Error loading grammar", e);
} finally {
if (in != null) {
try { try {
String t = mLinearizer.linearizeString(trees[i]); in.close();
translations[i] = t; } catch (IOException e) {
} catch (java.lang.Exception e) { Log.e(TAG, "Error closing the stream", e);
translations[i] = "/!\\ Linearization error";
} }
} }
return translations;*/ return s;
} catch (Exception e) {
throw new RuntimeException(e);
} }
} }
}
protected void onPostExecute(String[] result) { private class ConcrLoader extends Thread {
mArrayAdapter.clear(); private Language mLanguage;
for (String sentence : result) private Concr mConcr;
mArrayAdapter.add(sentence);
if (this.progress != null) public ConcrLoader(Language lang) {
this.progress.dismiss(); // Remove loading popup this.mLanguage = lang;
this.mConcr = null;
}
public Language getLanguage() {
return mLanguage;
}
public Concr getConcr() {
return mConcr;
}
public void run() {
try {
mGrammarLoader.join();
} catch (InterruptedException e) {
Log.d(TAG, "interrupted", e);
}
InputStream in = null;
try {
String name = mLanguage.getConcrete();
in = getAssets().open(name);
Log.d(TAG, "Trying to load " + name);
long t1 = System.currentTimeMillis();
mConcr = mGrammarLoader.getGrammar().getLanguages().get(mLanguage.getConcrete());
mConcr.load(in);
long t2 = System.currentTimeMillis();
Log.d(TAG, name + " loaded ("+(t2-t1)+" ms)");
} catch (FileNotFoundException e) {
Log.e(TAG, "File not found", e);
} catch (IOException e) {
Log.e(TAG, "Error loading concrete", e);
} finally {
if (in != null) {
try {
in.close();
} catch (IOException e) {
Log.e(TAG, "Error closing the stream", e);
}
}
}
} }
} }
} }
\ No newline at end of file
...@@ -3,6 +3,7 @@ package com.yottacode.pictogram.dao; ...@@ -3,6 +3,7 @@ package com.yottacode.pictogram.dao;
import android.content.ContentValues; import android.content.ContentValues;
import android.content.Context; import android.content.Context;
import android.content.res.AssetManager;
import android.database.Cursor; import android.database.Cursor;
import android.database.sqlite.SQLiteDatabase; import android.database.sqlite.SQLiteDatabase;
import android.database.sqlite.SQLiteDatabase.CursorFactory; import android.database.sqlite.SQLiteDatabase.CursorFactory;
...@@ -11,16 +12,21 @@ import android.os.AsyncTask; ...@@ -11,16 +12,21 @@ import android.os.AsyncTask;
import android.util.Log; import android.util.Log;
import java.io.BufferedReader; import java.io.BufferedReader;
import java.io.File;
import java.io.FileOutputStream;
import java.io.InputStreamReader; import java.io.InputStreamReader;
import java.io.IOException; import java.io.IOException;
import java.io.InputStream; import java.io.InputStream;
import java.io.OutputStream;
import java.util.Vector; import java.util.Vector;
import com.yottacode.pictogram.R;
import com.yottacode.pictogram.gui.LoginActivity; import com.yottacode.pictogram.gui.LoginActivity;
import com.yottacode.pictogram.tools.Img; import com.yottacode.pictogram.tools.Img;
import com.yottacode.pictogram.net.ImgDownloader; import com.yottacode.pictogram.net.ImgDownloader;
import com.yottacode.pictogram.net.iImgDownloaderListener; import com.yottacode.pictogram.net.iImgDownloaderListener;
import com.yottacode.pictogram.tools.PCBcontext;
import org.json.JSONException; import org.json.JSONException;
...@@ -407,13 +413,67 @@ public class Device extends SQLiteOpenHelper { ...@@ -407,13 +413,67 @@ public class Device extends SQLiteOpenHelper {
try { try {
executeSQLScript(db, DeviceHelper.getDBScriptStream(this.context)); executeSQLScript(db, DeviceHelper.getDBScriptStream(this.context));
Img.mkDirs(this.context); Img.mkDirs(this.context);
copyCoreVocabulary();
} catch (java.io.IOException io) { } catch (java.io.IOException io) {
throw new RuntimeException("Update database error", io); throw new RuntimeException("Update database ir cached Images error", io);
} }
} }
@Override private void copyCoreVocabulary() {
AssetManager assetManager = this.context.getAssets();
String[] files = null;
int size=0;
int filesok=0;
try {
files = assetManager.list(context.getResources().getString(R.string.core_vocabulary));
} catch (IOException e) {
Log.e(this.getClass().getCanonicalName(), "Failed to get asset file list.", e);
}
if (files != null) for (String filename : files) {
InputStream in = null;
OutputStream out = null;
try {
in = assetManager.open(context.getResources().getString(R.string.core_vocabulary)+File.separatorChar+filename);
File outFile = new File(Img.path(this.context, Img.VOCABULARY)+filename);
out = new FileOutputStream(outFile);
size+=copyFile(in, out);
} catch(IOException e) {
Log.e(this.getClass().getCanonicalName(), "Failed to copy asset Image: " + context.getResources().getString(R.string.core_vocabulary)+File.separatorChar+filename, e);
}
finally {
if (in != null) {
try {
in.close();
} catch (IOException e) {
Log.e(this.getClass().getCanonicalName(), "Failed to copy asset Image: " + filename, e);
}
}
if (out != null) {
try {
out.close();
filesok++;
} catch (IOException e) {
Log.e(this.getClass().getCanonicalName(), "Failed to copy asset Image: " + filename, e);
}
}
}
}
Log.i(Device.class.getName(), "Core vocabulary Images installed ("+filesok+" pictos,"+(size/1024)+" KB)");
}
private int copyFile(InputStream in, OutputStream out) throws IOException {
byte[] buffer = new byte[8192];
int read;
int size=0;
while((read = in.read(buffer)) != -1){
out.write(buffer, 0, read);
size+=read;
}
return size;
}
@Override
public void onUpgrade(SQLiteDatabase db, int oldVersion, int newVersion) { public void onUpgrade(SQLiteDatabase db, int oldVersion, int newVersion) {
} }
} }
\ No newline at end of file
...@@ -18,4 +18,8 @@ public class LoginException extends Exception{ ...@@ -18,4 +18,8 @@ public class LoginException extends Exception{
public boolean no_username_found() {return this.code==LoginException.UNKNOWN_USERNAME;} public boolean no_username_found() {return this.code==LoginException.UNKNOWN_USERNAME;}
public boolean no_pwd_found() {return this.code==LoginException.BAD_PASSWORD;} public boolean no_pwd_found() {return this.code==LoginException.BAD_PASSWORD;}
public boolean no_supervisor_students() {return this.code==LoginException.NO_STUDENTS;} public boolean no_supervisor_students() {return this.code==LoginException.NO_STUDENTS;}
public String getLocalizedMessage() {
return super.getLocalizedMessage()+" Username found:"+!no_username_found()+" Password found"+!no_pwd_found()+"Supervisor without students:"+no_supervisor_students();
}
} }
...@@ -69,4 +69,4 @@ public class PictoGridAdapter extends ArrayAdapter { ...@@ -69,4 +69,4 @@ public class PictoGridAdapter extends ArrayAdapter {
tts.speak(input, TextToSpeech.QUEUE_FLUSH, params, null); tts.speak(input, TextToSpeech.QUEUE_FLUSH, params, null);
} }
} }
} }
\ No newline at end of file
package com.yottacode.pictogram.gui; package com.yottacode.pictogram.gui;
import android.util.Log;
import android.view.LayoutInflater; import android.view.LayoutInflater;
import android.view.View; import android.view.View;
import android.view.ViewGroup; import android.view.ViewGroup;
...@@ -21,26 +22,32 @@ public class PictoItemViewGenerator { ...@@ -21,26 +22,32 @@ public class PictoItemViewGenerator {
public static final int LAYOUT = R.layout.picto_grid_item; public static final int LAYOUT = R.layout.picto_grid_item;
public static View getPictoView(Picto picto, View convertView, ViewGroup parent) { public static View getPictoView(Picto picto, View convertView, ViewGroup parent) {
if (convertView == null) { if (convertView == null) {
convertView = LayoutInflater.from(parent.getContext()).inflate(LAYOUT, parent, false); convertView = LayoutInflater.from(parent.getContext()).inflate(LAYOUT, parent, false);
} }
RelativeLayout layoutWrapper = (RelativeLayout) convertView.findViewById(R.id.picto_grid_item_layout_wrapper); RelativeLayout layoutWrapper = (RelativeLayout) convertView.findViewById(R.id.picto_grid_item_layout_wrapper);
FrameLayout layout = (FrameLayout) convertView.findViewById(R.id.picto_grid_item_layout); FrameLayout layout = (FrameLayout) convertView.findViewById(R.id.picto_grid_item_layout);
ImageView pictoImage = (ImageView) convertView.findViewById(R.id.picto_grid_item_image); ImageView pictoImage = (ImageView) convertView.findViewById(R.id.picto_grid_item_image);
ImageView redCrossImage = (ImageView) convertView.findViewById(R.id.picto_grid_item_redcross); ImageView redCrossImage = (ImageView) convertView.findViewById(R.id.picto_grid_item_redcross);
layoutWrapper.setVisibility(View.GONE); layoutWrapper.setVisibility(View.GONE);
layoutWrapper.setBackground(null); layoutWrapper.setBackground(null);
layoutWrapper.setAlpha(0.25f); layoutWrapper.setAlpha(0.25f);
layout.setBackgroundColor(convertView.getResources() layout.setBackgroundColor(convertView.getResources()
.getColor(R.color.picto_default_background)); .getColor(R.color.picto_default_background));
redCrossImage.setVisibility(View.GONE); redCrossImage.setVisibility(View.GONE);
pictoImage.setScaleX(1.0f); pictoImage.setScaleX(1.0f);
pictoImage.setScaleY(1.0f); pictoImage.setScaleY(1.0f);
pictoImage.setVisibility(View.GONE); pictoImage.setVisibility(View.GONE);
if (picto != null) { if (picto == null) {
if (PCBcontext.getPcbdb().getCurrentUser().is_supervisor()) {
layoutWrapper.setVisibility(View.VISIBLE);
layoutWrapper.setBackground(convertView.getResources()
.getDrawable(R.drawable.picto_grid_item_border));
}
} else {
if (!picto.is_invisible() && !picto.is_disabled()) { if (!picto.is_invisible() && !picto.is_disabled()) {
layoutWrapper.setAlpha(1.00f); layoutWrapper.setAlpha(1.00f);
} }
......
...@@ -92,14 +92,13 @@ public class PictogramActivity extends Activity implements iVocabularyListener, ...@@ -92,14 +92,13 @@ public class PictogramActivity extends Activity implements iVocabularyListener,
// Button used for showing the picto category view // Button used for showing the picto category view
ImageButton showPictoCategoriesViewButton; ImageButton showPictoCategoriesViewButton;
@Override @Override
protected void onCreate(Bundle savedInstanceState) { protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState); super.onCreate(savedInstanceState);
requestWindowFeature(Window.FEATURE_NO_TITLE); requestWindowFeature(Window.FEATURE_NO_TITLE);
setContentView(R.layout.activity_pictogram); setContentView(R.layout.activity_pictogram);
Intent intent = getIntent();
this.mainLayout = (RelativeLayout) findViewById(R.id.pictogramLayout); this.mainLayout = (RelativeLayout) findViewById(R.id.pictogramLayout);
this.currentCategory = null; this.currentCategory = null;
this.count_deletelong = 0; this.count_deletelong = 0;
...@@ -176,6 +175,7 @@ public class PictogramActivity extends Activity implements iVocabularyListener, ...@@ -176,6 +175,7 @@ public class PictogramActivity extends Activity implements iVocabularyListener,
if (tts != null){ if (tts != null){
tts.shutdown(); tts.shutdown();
} }
PCBcontext.getNetService().closeNotifyStatus();
} }
/** /**
...@@ -608,8 +608,8 @@ public class PictogramActivity extends Activity implements iVocabularyListener, ...@@ -608,8 +608,8 @@ public class PictogramActivity extends Activity implements iVocabularyListener,
} else { } else {
p.alter_status(); p.alter_status();
showPictoMainGridView(); getCurrentPictoGridAdapter().notifyDataSetChanged();
} }
} else { } else {
ClipData.Item item = new ClipData.Item("" + position); ClipData.Item item = new ClipData.Item("" + position);
String[] mimeTypes = {ClipDescription.MIMETYPE_TEXT_PLAIN}; String[] mimeTypes = {ClipDescription.MIMETYPE_TEXT_PLAIN};
......
...@@ -152,7 +152,7 @@ public class SerialActivity extends Activity { ...@@ -152,7 +152,7 @@ public class SerialActivity extends Activity {
if (e.no_pwd_found()) if (e.no_pwd_found())
GUITools.show_alert(this, R.string.passErrorMsg); GUITools.show_alert(this, R.string.passErrorMsg);
else if (e.no_username_found()) else if (e.no_username_found())
GUITools.show_alert(this, R.string.userErrorMsg,getString(R.string.noInternetConnection)); GUITools.show_alert(this, R.string.userInetErrorMsg);
else if (e.no_supervisor_students()) else if (e.no_supervisor_students())
GUITools.show_alert(this, R.string.noStudentsError); GUITools.show_alert(this, R.string.noStudentsError);
} }
...@@ -203,6 +203,7 @@ public class SerialActivity extends Activity { ...@@ -203,6 +203,7 @@ public class SerialActivity extends Activity {
, pictogramActivity); , pictogramActivity);
} catch (JSONException e) { } catch (JSONException e) {
GUITools.show_alert(SerialActivity.this, R.string.serverError, e.getMessage()); GUITools.show_alert(SerialActivity.this, R.string.serverError, e.getMessage());
Log.e(this.getClass().getCanonicalName(), "JSON:"+ e.getLocalizedMessage());
progressDialog.dismiss(); progressDialog.dismiss();
} }
...@@ -217,6 +218,7 @@ public class SerialActivity extends Activity { ...@@ -217,6 +218,7 @@ public class SerialActivity extends Activity {
GUITools.show_alert(SerialActivity.this, R.string.userErrorMsg); GUITools.show_alert(SerialActivity.this, R.string.userErrorMsg);
else else
GUITools.show_alert(SerialActivity.this, R.string.serverError, e.getMessage()); GUITools.show_alert(SerialActivity.this, R.string.serverError, e.getMessage());
Log.e(this.getClass().getCanonicalName(), "Server error:"+ e.getLocalizedMessage());
}}); }});
} }
...@@ -231,7 +233,7 @@ public class SerialActivity extends Activity { ...@@ -231,7 +233,7 @@ public class SerialActivity extends Activity {
e.printStackTrace(); e.printStackTrace();
} catch (LoginException e) { } catch (LoginException e) {
GUITools.show_alert(this, e.no_username_found() GUITools.show_alert(this, e.no_username_found()
? R.string.userErrorMsg ? R.string.userInetErrorMsg
: R.string.passErrorMsg); : R.string.passErrorMsg);
} }
} //offline student login } //offline student login
......
...@@ -131,6 +131,7 @@ public class StudentFragmentGrid extends Fragment{ ...@@ -131,6 +131,7 @@ public class StudentFragmentGrid extends Fragment{
} }
}); });
} catch (JSONException e) { } catch (JSONException e) {
e.printStackTrace(); e.printStackTrace();
Log.e(StudentFragmentGrid.this.getClass().getCanonicalName(), e.getMessage()); Log.e(StudentFragmentGrid.this.getClass().getCanonicalName(), e.getMessage());
...@@ -290,4 +291,4 @@ public class StudentFragmentGrid extends Fragment{ ...@@ -290,4 +291,4 @@ public class StudentFragmentGrid extends Fragment{
if (offline || onlineStudentsOK) showStudentsGrid(); if (offline || onlineStudentsOK) showStudentsGrid();
return view; return view;
} }
} }
\ No newline at end of file
...@@ -66,7 +66,6 @@ public class ImgDownloader extends AsyncTask<Vector<Img>, Void, Img> { ...@@ -66,7 +66,6 @@ public class ImgDownloader extends AsyncTask<Vector<Img>, Void, Img> {
try { try {
for (Img img: imgs) { for (Img img: imgs) {
if (!img.exists_bitmap(this.context) || this.force_download) try { if (!img.exists_bitmap(this.context) || this.force_download) try {
this.activityManager.getMemoryInfo(mi); this.activityManager.getMemoryInfo(mi);
if (this.source==source.remote) { if (this.source==source.remote) {
......
...@@ -37,11 +37,22 @@ import java.util.concurrent.TimeUnit; ...@@ -37,11 +37,22 @@ import java.util.concurrent.TimeUnit;
public class NetService implements Runnable { public class NetService implements Runnable {
public static final String PREFS_NAME = "MyPrefsFile"; public static final String PREFS_NAME = "MyPrefsFile";
private static NotificationCompat.Builder builder;
static final String ping_session="server/ping"; static final String ping_session="server/ping";
private boolean updated; private boolean updated;
public NetService(int delay) { public NetService(int delay) {
this.updated=RestapiWrapper.ping(PCBcontext.getContext().getResources().getString(R.string.server), ping_session); this.updated=RestapiWrapper.ping(PCBcontext.getContext().getResources().getString(R.string.server), ping_session);
this.builder = new NotificationCompat.Builder(PCBcontext.getContext());
Intent resultIntent = new Intent(PCBcontext.getContext(), PictogramActivity.class);
TaskStackBuilder stackBuilder = TaskStackBuilder.create(PCBcontext.getContext());
stackBuilder.addParentStack(PictogramActivity.class);
stackBuilder.addNextIntent(resultIntent);
PendingIntent resultPendingIntent =
stackBuilder.getPendingIntent(0, PendingIntent.FLAG_UPDATE_CURRENT);
builder.setContentIntent(resultPendingIntent);
Log.i(this.getClass().getName(), "Checking Pictogram server access..."); Log.i(this.getClass().getName(), "Checking Pictogram server access...");
Log.i(this.getClass().getName(), this.updated ? "Pictogram server access ok" : "Pictogram server access failed, Internet connection available?"); Log.i(this.getClass().getName(), this.updated ? "Pictogram server access ok" : "Pictogram server access failed, Internet connection available?");
ScheduledThreadPoolExecutor exec = new ScheduledThreadPoolExecutor(1); ScheduledThreadPoolExecutor exec = new ScheduledThreadPoolExecutor(1);
...@@ -144,28 +155,32 @@ public class NetService implements Runnable { ...@@ -144,28 +155,32 @@ public class NetService implements Runnable {
}); });
} }
private void notifyStatus() { private void notifyStatus() {
NotificationCompat.Builder builder; int notifyID = 1;
int notifyID = 1; String user="";
builder = new NotificationCompat.Builder(PCBcontext.getContext()); if (PCBcontext.getPcbdb()!=null) {
Intent resultIntent = new Intent(PCBcontext.getContext(), PictogramActivity.class); user=PCBcontext.getPcbdb().getCurrentUser().get_name_stu();
TaskStackBuilder stackBuilder = TaskStackBuilder.create(PCBcontext.getContext()); if (PCBcontext.getPcbdb().getCurrentUser().is_supervisor())
stackBuilder.addParentStack(PictogramActivity.class); user += " (" + PCBcontext.getPcbdb().getCurrentUser().get_name_sup() + ")";
stackBuilder.addNextIntent(resultIntent); }
PendingIntent resultPendingIntent =
stackBuilder.getPendingIntent(0, PendingIntent.FLAG_UPDATE_CURRENT);
builder.setContentIntent(resultPendingIntent);
if (updated) if (updated)
builder.setSmallIcon(R.drawable.application_online) builder.setSmallIcon(R.drawable.application_online)
.setContentTitle("Pictogram online") .setContentTitle(PCBcontext.getContext().getResources().getString(R.string.pictogram_online))
.setContentText(PCBcontext.getContext().getResources().getString(R.string.pictogram_online)); .setContentText(user);
else else
builder.setSmallIcon(R.drawable.application_offline) builder.setSmallIcon(R.drawable.application_offline)
.setContentTitle("Pictogram offline") .setContentTitle(PCBcontext.getContext().getResources().getString(R.string.pictogram_offline))
.setContentText(PCBcontext.getContext().getResources().getString(R.string.pictogram_offline)); .setContentText(user);
NotificationManager mNotificationManager = NotificationManager mNotificationManager =
(NotificationManager) PCBcontext.getContext().getSystemService(PCBcontext.getContext().NOTIFICATION_SERVICE); (NotificationManager) PCBcontext.getContext().getSystemService(PCBcontext.getContext().NOTIFICATION_SERVICE);
// mId allows you to update the notification later on.
mNotificationManager.notify(notifyID, builder.build()); mNotificationManager.notify(notifyID, builder.build());
} }
} public void closeNotifyStatus(){
\ No newline at end of file int notifyID = 1;
NotificationManager mNotificationManager =
(NotificationManager) PCBcontext.getContext().getSystemService(PCBcontext.getContext().NOTIFICATION_SERVICE);
mNotificationManager.cancel(notifyID);
}
}
package com.yottacode.pictogram.net; package com.yottacode.pictogram.net;
import android.graphics.Bitmap;
import android.graphics.BitmapFactory;
import android.util.Log; import android.util.Log;
import com.google.gson.JsonObject; import com.google.gson.JsonObject;
...@@ -11,6 +13,7 @@ import com.yottacode.pictogram.action.VocabularyAction; ...@@ -11,6 +13,7 @@ import com.yottacode.pictogram.action.VocabularyAction;
import com.yottacode.pictogram.dao.Picto; import com.yottacode.pictogram.dao.Picto;
import com.yottacode.pictogram.tools.Img; import com.yottacode.pictogram.tools.Img;
import com.yottacode.pictogram.tools.PCBcontext; import com.yottacode.pictogram.tools.PCBcontext;
import com.yottacode.tools.BitmapTools;
import org.json.JSONArray; import org.json.JSONArray;
import org.json.JSONException; import org.json.JSONException;
...@@ -33,15 +36,21 @@ public class PictoUploader { ...@@ -33,15 +36,21 @@ public class PictoUploader {
private int uploadImg( Img img) throws UnsupportedEncodingException { private int uploadImg( Img img) throws UnsupportedEncodingException {
int img_id; int img_id;
Bitmap bmp=null;
if (!img.get_filetype().equalsIgnoreCase("png")) if (!img.get_filetype().equalsIgnoreCase("png"))
throw new UnsupportedEncodingException("Extension "+img.get_filetype()+" is not supported. Only png files"); throw new UnsupportedEncodingException("Extension "+img.get_filetype()+" is not supported. Only png files");
Ion ion = Ion.getDefault(PCBcontext.getContext()); Ion ion = Ion.getDefault(PCBcontext.getContext());
try {
Log.i(this.getClass().getCanonicalName(), "Uploading Picto img" + img.file_name() + " from " + img.get_type() + "size:" + img.get_bitmap(PCBcontext.getContext()).getWidth() + " " + img.get_bitmap(PCBcontext.getContext()).getHeight()); try {
} catch (IOException e) { bmp=img.get_bitmap(PCBcontext.getContext());
Log.i(this.getClass().getCanonicalName(), "Uploading Picto img" + img.file_name() + " from " + img.get_type()); } catch (IOException e) {
} Log.e(Img.class.getCanonicalName(), "Error when decoding "+img.file_name());
}
Log.i(this.getClass().getCanonicalName(), "Uploading Picto img" + img.file_name() + " from " + img.get_type() + "size:" + bmp.getWidth() + " " + bmp.getHeight());
File file = img.file(PCBcontext.getContext()); File file = img.file(PCBcontext.getContext());
Response<JsonObject> response=null; Response<JsonObject> response=null;
...@@ -160,7 +169,6 @@ public class PictoUploader { ...@@ -160,7 +169,6 @@ public class PictoUploader {
* *
**/ **/
public void upload() throws IOException { public void upload() throws IOException {
int old_picto=this.picto.get_id();
int img_id = uploadImg(this.picto); int img_id = uploadImg(this.picto);
if (img_id > 0) { if (img_id > 0) {
uploadAttributes(img_id); uploadAttributes(img_id);
......
...@@ -17,7 +17,7 @@ public class ServerLogin { ...@@ -17,7 +17,7 @@ public class ServerLogin {
private static void checkLogin(JSONObject result) throws LoginException { private static void checkLogin(JSONObject result) throws LoginException {
String error; String error;
try { try {
error=result.has("error") error=result.has("error")
? result.getString("error") ? result.getString("error")
: null; : null;
...@@ -26,9 +26,9 @@ public class ServerLogin { ...@@ -26,9 +26,9 @@ public class ServerLogin {
error=null; error=null;
} }
if (error!=null){ if (error!=null){
if (error.contains("Invalid password") || error.contains("No credentials sent")) if (error.toLowerCase().contains("password") || error.contains("No credentials sent"))
throw new LoginException(error, LoginException.BAD_PASSWORD); throw new LoginException(error, LoginException.BAD_PASSWORD);
else if (error.contains("User not found")) else if (error.toLowerCase().contains("user"))
throw new LoginException(error, LoginException.UNKNOWN_USERNAME); throw new LoginException(error, LoginException.UNKNOWN_USERNAME);
} }
} }
...@@ -58,6 +58,7 @@ public class ServerLogin { ...@@ -58,6 +58,7 @@ public class ServerLogin {
@Override @Override
public void result(JSONObject result) { public void result(JSONObject result) {
try { try {
checkLogin(result); checkLogin(result);
if (PCBcontext.is_user_offline()) { if (PCBcontext.is_user_offline()) {
......
...@@ -27,7 +27,7 @@ public class Img { ...@@ -27,7 +27,7 @@ public class Img {
static public String VOCABULARY="vocabulary"; static public String VOCABULARY="vocabulary";
static public String STUDENT="student"; static public String STUDENT="student";
static public String SUPERVISOR="supervisor"; static public String SUPERVISOR="supervisor";
static public float MAX_WIDTH=100;
public static final void mkDirs(Context context) { public static final void mkDirs(Context context) {
File file; File file;
file = new File(path(context, Img.VOCABULARY)); file = new File(path(context, Img.VOCABULARY));
...@@ -126,7 +126,6 @@ public class Img { ...@@ -126,7 +126,6 @@ public class Img {
* @throws IOException * @throws IOException
*/ */
public int save_bitmap(Context context, InputStream is) throws IOException { public int save_bitmap(Context context, InputStream is) throws IOException {
final float MAX_WIDTH=100;
File file = file(context); File file = file(context);
FileOutputStream os = new FileOutputStream(file); FileOutputStream os = new FileOutputStream(file);
try { try {
......
...@@ -21,6 +21,7 @@ ...@@ -21,6 +21,7 @@
<string name="passErrorMsg">This password is not correct. Try again.</string> <string name="passErrorMsg">This password is not correct. Try again.</string>
<string name="userErrorTxt">User not found</string> <string name="userErrorTxt">User not found</string>
<string name="userErrorMsg">Unknown user name</string> <string name="userErrorMsg">Unknown user name</string>
<string name="userInetErrorMsg">Unknown new user name because Internet conection is not available</string>
<string name="userLoadingTxt">Loading</string> <string name="userLoadingTxt">Loading</string>
<string name="userLoadingMsg">Loading students. Please wait.</string> <string name="userLoadingMsg">Loading students. Please wait.</string>
<string name="imguserLoadingMsg">Loading images students. Please wait.</string> <string name="imguserLoadingMsg">Loading images students. Please wait.</string>
...@@ -45,7 +46,7 @@ ...@@ -45,7 +46,7 @@
<string name="serverError">There is a server error. Try again later</string> <string name="serverError">There is a server error. Try again later</string>
<!--Semantic grammar --> <!--Semantic grammar -->
<string name="loadingGrammar">Please wait, loading semmantic grammar</string> <string name="loadingGrammar">Please wait, loading vocabulary</string>
<string name="naturalgrammar">SUpO_EN</string> <string name="naturalgrammar">SUpO_EN</string>
<string name="pictogrammar">SUpO_PICTOEN</string> <string name="pictogrammar">SUpO_PICTOEN</string>
<string name="nogrammar">Warning: unknown language</string> <string name="nogrammar">Warning: unknown language</string>
...@@ -54,6 +55,6 @@ ...@@ -54,6 +55,6 @@
<string name="enterImgLabel">Enter img label</string> <string name="enterImgLabel">Enter img label</string>
<string name="notNewCats">Including new categories is not allowed</string> <string name="notNewCats">Including new categories is not allowed</string>
<!--online/offline status--> <!--online/offline status-->
<string name="pictogram_offline">Please check your internet connection. </string> <string name="pictogram_offline">Pictogram offline</string>
<string name="pictogram_online">Server connection established. </string> <string name="pictogram_online">Pictogram online</string>
</resources> </resources>
...@@ -47,7 +47,7 @@ ...@@ -47,7 +47,7 @@
<string name="serverError">Error en el servidor de datos. Inténtelo más tarde</string> <string name="serverError">Error en el servidor de datos. Inténtelo más tarde</string>
<!--Semantic grammar --> <!--Semantic grammar -->
<string name="loadingGrammar">Por favor espere, cargando gramática semántica</string> <string name="loadingGrammar">Por favor espere, cargando vocabulario</string>
<string name="naturalgrammar">SUpO_ES</string> <string name="naturalgrammar">SUpO_ES</string>
<string name="grammar">SUpO_ES</string> <string name="grammar">SUpO_ES</string>
<string name="nogrammar">Advertencia: Lenguaje no soportado</string> <string name="nogrammar">Advertencia: Lenguaje no soportado</string>
...@@ -59,7 +59,7 @@ ...@@ -59,7 +59,7 @@
<string name="enterImgLabel">Introduzca etiqueta de la imagen</string> <string name="enterImgLabel">Introduzca etiqueta de la imagen</string>
<string name="notNewCats">No puede añadir nuevas categorias</string> <string name="notNewCats">No puede añadir nuevas categorias</string>
<!--online/offline status--> <!--online/offline status-->
<string name="pictogram_offline">Compruebe si tiene conexión a Internet. </string> <string name="pictogram_offline">Pictogram offline</string>
<string name="pictogram_online">Conexón con el servidor establecida. </string> <string name="pictogram_online">Pictogram online</string>
</resources> </resources>
...@@ -7,7 +7,7 @@ ...@@ -7,7 +7,7 @@
<dimen name="picto_grid_spacing">4dp</dimen> <dimen name="picto_grid_spacing">4dp</dimen>
<dimen name="picto_border_width">1dp</dimen> <dimen name="picto_border_width">1dp</dimen>
<dimen name="picto_padding">4dp</dimen> <dimen name="picto_padding">4dp</dimen>
<dimen name="picto_normal_height">80dp</dimen> <dimen name="picto_normal_height">75dp</dimen>
<dimen name="picto_normal_width">80dp</dimen> <dimen name="picto_normal_width">75dp</dimen>
<dimen name="tape_normal_height">100dp</dimen> <dimen name="tape_normal_height">90dp</dimen>
</resources> </resources>
...@@ -22,6 +22,7 @@ ...@@ -22,6 +22,7 @@
<string name="passErrorMsg">La contraseña indicada no es correcta. Inténtelo de nuevo.</string> <string name="passErrorMsg">La contraseña indicada no es correcta. Inténtelo de nuevo.</string>
<string name="userErrorTxt">Usuario no encontrado</string> <string name="userErrorTxt">Usuario no encontrado</string>
<string name="userErrorMsg">Nombre de usuario desconocido</string> <string name="userErrorMsg">Nombre de usuario desconocido</string>
<string name="userInetErrorMsg">Nombre de usuario nuevo no se pudo comprobar porque no hay conexión a internet</string>
<string name="userLoadingTxt">Cargando</string> <string name="userLoadingTxt">Cargando</string>
<string name="userLoadingMsg">Cargando alumnos. Por favor espere.</string> <string name="userLoadingMsg">Cargando alumnos. Por favor espere.</string>
<string name="imguserLoadingMsg">Cargando imágenes de los alumnos. Por favor espere.</string> <string name="imguserLoadingMsg">Cargando imágenes de los alumnos. Por favor espere.</string>
...@@ -47,7 +48,7 @@ ...@@ -47,7 +48,7 @@
<string name="serverError">Error en el servidor de datos. Inténtelo más tarde</string> <string name="serverError">Error en el servidor de datos. Inténtelo más tarde</string>
<!--Semantic grammar --> <!--Semantic grammar -->
<string name="loadingGrammar">Please wait, loading semmantic grammar</string> <string name="loadingGrammar">Please wait, loading vocabulary</string>
<string name="naturalgrammar">SUpO_EN</string> <string name="naturalgrammar">SUpO_EN</string>
<string name="grammar">SUpO_EN</string> <string name="grammar">SUpO_EN</string>
<string name="nogrammar">Warning: unknown language</string> <string name="nogrammar">Warning: unknown language</string>
...@@ -75,4 +76,4 @@ ...@@ -75,4 +76,4 @@
<string name="pictogram_offline">Compruebe si tiene conexión a Internet. </string> <string name="pictogram_offline">Compruebe si tiene conexión a Internet. </string>
<string name="pictogram_online">Conexón con el servidor establecida. </string> <string name="pictogram_online">Conexón con el servidor establecida. </string>
</string> </string>
</resources> </resources>
\ No newline at end of file
...@@ -5,7 +5,7 @@ buildscript { ...@@ -5,7 +5,7 @@ buildscript {
jcenter() jcenter()
} }
dependencies { dependencies {
classpath 'com.android.tools.build:gradle:2.1.0' classpath 'com.android.tools.build:gradle:2.1.2'
// NOTE: Do not place your application dependencies here; they belong // NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files // in the individual module build.gradle files
......
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