Solucionados algunos bugs

parent 0273c0ab
...@@ -3,10 +3,12 @@ apply plugin: 'com.android.application' ...@@ -3,10 +3,12 @@ apply plugin: 'com.android.application'
android { android {
signingConfigs { signingConfigs {
release_config { release_config {
/*
storeFile file('F:/Users/Fernando/GoogleDrive/tmp/keystore.jks') storeFile file('F:/Users/Fernando/GoogleDrive/tmp/keystore.jks')
keyAlias 'default_key' keyAlias 'default_key'
keyPassword 'danoia' keyPassword 'danoia'
storePassword 'danoia' storePassword 'danoia'
*/
} }
} }
compileSdkVersion 21 compileSdkVersion 21
...@@ -23,7 +25,7 @@ android { ...@@ -23,7 +25,7 @@ android {
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:1337" resValue "string", "server", "https://pre.yottacode.com"
resValue "string", "db_name", "PCB.db" 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"
...@@ -52,7 +54,7 @@ android { ...@@ -52,7 +54,7 @@ android {
resValue "string", "server", "https://192.168.1.37:1337" resValue "string", "server", "https://192.168.1.37:1337"
} }
DefaultFlavor { DefaultFlavor {
resValue "string", "server", "https://pre.yottacode.com:1337" resValue "string", "server", "https://pre.yottacode.com"
signingConfig signingConfigs.release_config signingConfig signingConfigs.release_config
} }
ArturoFlavorNoSSL { ArturoFlavorNoSSL {
......
...@@ -177,16 +177,15 @@ public class RestapiWrapper { ...@@ -177,16 +177,15 @@ public class RestapiWrapper {
os.close(); os.close();
int responseCode=urlConnection.getResponseCode(); int responseCode=urlConnection.getResponseCode();
if (responseCode == HttpsURLConnection.HTTP_OK) { Log.d(LOG_TAG, "RESPONSECODE: " + responseCode);
String line; String line;
BufferedReader br=new BufferedReader(new InputStreamReader(urlConnection.getInputStream())); BufferedReader br = new BufferedReader(new InputStreamReader(responseCode == HttpsURLConnection.HTTP_OK
? urlConnection.getInputStream()
: urlConnection.getErrorStream()));
while ((line=br.readLine()) != null) { while ((line=br.readLine()) != null) {
response+=line; response+=line;
} }
}
else {
response="";
}
} catch (IOException e) { } catch (IOException e) {
Log.e(com.yottacode.net.RestapiWrapper.class.getName(), "Error:" + e.getLocalizedMessage() + " when asking for " + surl); Log.e(com.yottacode.net.RestapiWrapper.class.getName(), "Error:" + e.getLocalizedMessage() + " when asking for " + surl);
response=e.getMessage(); response=e.getMessage();
...@@ -228,6 +227,7 @@ public class RestapiWrapper { ...@@ -228,6 +227,7 @@ public class RestapiWrapper {
@Override @Override
protected void onPostExecute(HttpAsyncTaskParams params) { protected void onPostExecute(HttpAsyncTaskParams params) {
try { try {
//if (params.e)
if(params.result!=null) { if(params.result!=null) {
Log.d(LOG_TAG, "JSON: " + params.result); Log.d(LOG_TAG, "JSON: " + params.result);
......
...@@ -183,17 +183,19 @@ public class SerialActivity extends Activity implements iRestapiListener { ...@@ -183,17 +183,19 @@ public class SerialActivity extends Activity implements iRestapiListener {
String password = mSerialViewPass.getText().toString(); String password = mSerialViewPass.getText().toString();
// DE PRUEBA // DE PRUEBA
// Alumno // Alumno
//username = "faf0001"; username = "faf0001";
//password = "faf0001"; password = "faf000";
// Supervisor // Supervisor
//username = "dofer@ujaen.es"; //username = "dofer@ujaen.es";
//password = "dofer"; //password = "dofer";
/*
SharedPreferences settings = getSharedPreferences(PREFS_NAME, 0); SharedPreferences settings = getSharedPreferences(PREFS_NAME, 0);
SharedPreferences.Editor editor = settings.edit(); SharedPreferences.Editor editor = settings.edit();
editor.putString("username", username); editor.putString("username", username);
editor.putString("password", password); editor.putString("password", password);
editor.commit(); editor.commit();
*/
RestapiWrapper wrapper = PCBcontext.getRestapiWrapper(); RestapiWrapper wrapper = PCBcontext.getRestapiWrapper();
if (username.contains("@")){ if (username.contains("@")){
...@@ -326,9 +328,11 @@ public class SerialActivity extends Activity implements iRestapiListener { ...@@ -326,9 +328,11 @@ public class SerialActivity extends Activity implements iRestapiListener {
startActivity(loginActivity); startActivity(loginActivity);
} }
} catch (JSONException ex){ } catch (JSONException ex){
//Log.d(LOG_TAG, "ERROR 1");
ex.printStackTrace(); ex.printStackTrace();
} }
} catch (JSONException e) { } catch (JSONException e) {
//Log.d(LOG_TAG, "ERROR 2");
e.printStackTrace(); e.printStackTrace();
} catch (IOException e) { } catch (IOException e) {
e.printStackTrace(); e.printStackTrace();
...@@ -351,6 +355,3 @@ public class SerialActivity extends Activity implements iRestapiListener { ...@@ -351,6 +355,3 @@ public class SerialActivity extends Activity implements iRestapiListener {
alert.show(); alert.show();
} }
} }
\ No newline at end of file
...@@ -25,6 +25,15 @@ ...@@ -25,6 +25,15 @@
android:layout_alignParentTop="true"> android:layout_alignParentTop="true">
</GridView> </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 <ImageButton
android:layout_width="wrap_content" android:layout_width="wrap_content"
......
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