Skip to content

Commit

Permalink
Exceção login inexistente corrigido
Browse files Browse the repository at this point in the history
  • Loading branch information
tibetteixeira committed Jun 12, 2019
1 parent a895ae5 commit 2643ca1
Show file tree
Hide file tree
Showing 4 changed files with 36 additions and 13 deletions.
4 changes: 4 additions & 0 deletions APIMysql/DbOperation.php
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,10 @@ function login($cpf, $senha) {
}
$paciente['ecg'] = $todayEcg;

if (!array_key_exists( "cpf" , $paciente )) {
return false;
}

} catch(PDOException $e) {
print "Erro: " . $e->getMessage();
}
Expand Down
Binary file modified App/.idea/caches/gradle_models.ser
Binary file not shown.
40 changes: 27 additions & 13 deletions App/app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -1,15 +1,14 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest
xmlns:android="https://schemas.android.com/apk/res/android"
<manifest xmlns:android="https://schemas.android.com/apk/res/android"
package="br.com.cadim.cadim">

<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<uses-permission android:name="android.permission.BLUETOOTH" />
<uses-permission android:name="android.permission.BLUETOOTH_ADMIN" />
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION"/>
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE"/>
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />

<application
android:allowBackup="true"
Expand All @@ -29,16 +28,31 @@
<activity
android:name=".View.LoginActivity"
android:parentActivityName=".View.MainActivity"></activity>

<activity android:name=".View.DiagnosticListActivity"></activity>
<activity android:name=".View.LoadDiagnosticActivity"></activity>
<activity android:name=".View.AquisitionEcgActivity"></activity>
<activity
android:name=".View.DiagnosticListActivity"
android:parentActivityName=".View.HomeActivity"></activity>
<activity
android:name=".View.LoadDiagnosticActivity"
android:parentActivityName=".View.HomeActivity"></activity>
<activity
android:name=".View.AquisitionEcgActivity"
android:parentActivityName=".View.HomeActivity"></activity>
<activity android:name=".View.HomeActivity"></activity>
<activity android:name=".View.DiagnosticActivity"></activity>
<activity android:name=".Controller.FoundDevices"></activity>
<activity android:name=".View.ReadEcgActivity"></activity>
<activity android:name=".View.HistoricListActivity"></activity>
<activity android:name=".View.LoadHistoricActivity"></activity>
<activity
android:name=".View.DiagnosticActivity"
android:parentActivityName=".View.DiagnosticListActivity"></activity>
<activity
android:name=".Controller.FoundDevices"
android:parentActivityName=".View.HomeActivity"></activity>
<activity
android:name=".View.ReadEcgActivity"
android:parentActivityName=".View.HomeActivity"></activity>
<activity
android:name=".View.HistoricListActivity"
android:parentActivityName=".View.HomeActivity"></activity>
<activity
android:name=".View.LoadHistoricActivity"
android:parentActivityName=".View.HomeActivity"></activity>

</application>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,7 @@ protected void onPostExecute(String s) {
System.out.println(s);

this.object = new JSONObject(s);

if (!object.getBoolean("error")) {
Toast.makeText(getApplicationContext(), "Login realizado com sucesso",
Toast.LENGTH_SHORT).show();
Expand Down Expand Up @@ -145,6 +146,10 @@ protected void onPostExecute(String s) {

} catch (JSONException e) {
e.printStackTrace();

} catch (ClassCastException e) {
Toast.makeText(getApplicationContext(), "Usuário ou senha inválido",
Toast.LENGTH_SHORT).show();
}
}

Expand Down

0 comments on commit 2643ca1

Please sign in to comment.