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,16 +177,15 @@ public class RestapiWrapper {
os.close();
int responseCode=urlConnection.getResponseCode();
if (responseCode == HttpsURLConnection.HTTP_OK) {
Log.d(LOG_TAG, "RESPONSECODE: " + responseCode);
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) {
response+=line;
}
}
else {
response="";
}
} catch (IOException e) {
Log.e(com.yottacode.net.RestapiWrapper.class.getName(), "Error:" + e.getLocalizedMessage() + " when asking for " + surl);
response=e.getMessage();
......@@ -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("@")){
......@@ -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();
......@@ -351,6 +355,3 @@ public class SerialActivity extends Activity implements iRestapiListener {
alert.show();
}
}
\ No newline at end of file
......@@ -25,6 +25,15 @@
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"
......
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