Solucionados algunos bugs

parent 0273c0ab
......@@ -3,10 +3,12 @@ apply plugin: 'com.android.application'
android {
signingConfigs {
release_config {
/*
storeFile file('F:/Users/Fernando/GoogleDrive/tmp/keystore.jks')
keyAlias 'default_key'
keyPassword 'danoia'
storePassword 'danoia'
*/
}
}
compileSdkVersion 21
......@@ -23,7 +25,7 @@ android {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
resValue "string", "server", "https://pre.yottacode.com:1337"
resValue "string", "server", "https://pre.yottacode.com"
resValue "string", "db_name", "PCB.db"
resValue "bool", "force_db_create", "false"
resValue "bool", "ssl_connect", "false"
......@@ -52,7 +54,7 @@ android {
resValue "string", "server", "https://192.168.1.37:1337"
}
DefaultFlavor {
resValue "string", "server", "https://pre.yottacode.com:1337"
resValue "string", "server", "https://pre.yottacode.com"
signingConfig signingConfigs.release_config
}
ArturoFlavorNoSSL {
......
......@@ -177,15 +177,14 @@ public class RestapiWrapper {
os.close();
int responseCode=urlConnection.getResponseCode();
if (responseCode == HttpsURLConnection.HTTP_OK) {
String line;
BufferedReader br=new BufferedReader(new InputStreamReader(urlConnection.getInputStream()));
while ((line=br.readLine()) != null) {
response+=line;
}
}
else {
response="";
Log.d(LOG_TAG, "RESPONSECODE: " + responseCode);
String line;
BufferedReader br = new BufferedReader(new InputStreamReader(responseCode == HttpsURLConnection.HTTP_OK
? urlConnection.getInputStream()
: urlConnection.getErrorStream()));
while ((line=br.readLine()) != null) {
response+=line;
}
} catch (IOException e) {
Log.e(com.yottacode.net.RestapiWrapper.class.getName(), "Error:" + e.getLocalizedMessage() + " when asking for " + surl);
......@@ -228,6 +227,7 @@ public class RestapiWrapper {
@Override
protected void onPostExecute(HttpAsyncTaskParams params) {
try {
//if (params.e)
if(params.result!=null) {
Log.d(LOG_TAG, "JSON: " + params.result);
......
......@@ -183,17 +183,19 @@ public class SerialActivity extends Activity implements iRestapiListener {
String password = mSerialViewPass.getText().toString();
// DE PRUEBA
// Alumno
//username = "faf0001";
//password = "faf0001";
username = "faf0001";
password = "faf000";
// Supervisor
//username = "dofer@ujaen.es";
//password = "dofer";
/*
SharedPreferences settings = getSharedPreferences(PREFS_NAME, 0);
SharedPreferences.Editor editor = settings.edit();
editor.putString("username", username);
editor.putString("password", password);
editor.commit();
*/
RestapiWrapper wrapper = PCBcontext.getRestapiWrapper();
if (username.contains("@")){
......@@ -279,18 +281,18 @@ public class SerialActivity extends Activity implements iRestapiListener {
//User student = PCBcontext.getDevice().findUser(st_id_int, -1);
//Log.d(LOG_TAG, "student id:" + student.get_id_stu());
PCBcontext.set_user(student, jsonToken, new iImgDownloaderListener() {
@Override
public void loadComplete() {
progressDialog.dismiss();
Intent pictogramActivity = new Intent(SerialActivity.this, PictogramActivity.class);
startActivity(pictogramActivity);
}
@Override
public void loadComplete() {
progressDialog.dismiss();
Intent pictogramActivity = new Intent(SerialActivity.this, PictogramActivity.class);
startActivity(pictogramActivity);
}
@Override
public void loadImg(Img image) {
@Override
public void loadImg(Img image) {
}
});
}
});
PCBcontext.getDevice().synchronizeUsers(users, new iImgDownloaderListener() {
@Override
......@@ -326,9 +328,11 @@ public class SerialActivity extends Activity implements iRestapiListener {
startActivity(loginActivity);
}
} catch (JSONException ex){
//Log.d(LOG_TAG, "ERROR 1");
ex.printStackTrace();
}
} catch (JSONException e) {
//Log.d(LOG_TAG, "ERROR 2");
e.printStackTrace();
} catch (IOException e) {
e.printStackTrace();
......@@ -350,7 +354,4 @@ public class SerialActivity extends Activity implements iRestapiListener {
AlertDialog alert = builder.create();
alert.show();
}
}
}
\ No newline at end of file
......@@ -13,41 +13,50 @@
<!-- android:keepScreenOn - To keep the screen bright as long as the app is visible (also forever) -->
<GridView
android:id="@+id/tape_grid_view"
android:layout_width="850dp"
android:layout_height="85dp"
android:gravity="center"
android:numColumns="@integer/columns"
android:accessibilityLiveRegion="none"
android:background="@android:color/holo_red_light"
android:clickable="false"
android:layout_alignParentTop="true">
</GridView>
<GridView
android:id="@+id/tape_grid_view"
android:layout_width="850dp"
android:layout_height="85dp"
android:gravity="center"
android:numColumns="@integer/columns"
android:accessibilityLiveRegion="none"
android:background="@android:color/holo_red_light"
android:clickable="false"
android:layout_alignParentTop="true">
</GridView>
<ImageButton
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:paddingLeft="850dp"
android:paddingTop="20dp"
android:src="@drawable/back64"
android:background="@null"
android:id="@+id/button_delete"
android:layout_alignParentTop="true"/>
<ImageButton
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:paddingLeft="20dp"
android:paddingTop="20dp"
android:src="@drawable/play64"
android:background="@null"
android:id="@+id/button_tts"
android:layout_toRightOf="@+id/tape_grid_view"
android:layout_alignParentTop="true"
android:adjustViewBounds="true"/>
<ImageButton
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:paddingLeft="20dp"
android:paddingTop="20dp"
android:src="@drawable/play64"
android:background="@null"
android:id="@+id/button_tts"
android:layout_toRightOf="@+id/tape_grid_view"
android:layout_alignParentTop="true"
android:adjustViewBounds="true"/>
<GridView
android:id="@+id/panel_grid_view"
android:layout_height="match_parent"
android:layout_width="match_parent"
android:paddingTop="20dp"
android:columnWidth="100dp"
android:verticalSpacing="15dp"
android:horizontalSpacing="5dp"
android:stretchMode="columnWidth"
android:layout_below="@+id/tape_grid_view">
</GridView>
<GridView
android:id="@+id/panel_grid_view"
android:layout_height="match_parent"
android:layout_width="match_parent"
android:paddingTop="20dp"
android:columnWidth="100dp"
android:verticalSpacing="15dp"
android:horizontalSpacing="5dp"
android:stretchMode="columnWidth"
android:layout_below="@+id/tape_grid_view">
</GridView>
</RelativeLayout>
\ No newline at end of file
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