Skip to content

Commit

Permalink
Merge pull request #1 from nessv/master
Browse files Browse the repository at this point in the history
Solved Issue Ana06#28
  • Loading branch information
joaquinolivera authored Jun 14, 2017
2 parents 81d0a82 + 9317fff commit e3e4950
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 7 deletions.
8 changes: 4 additions & 4 deletions app/build.gradle
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
apply plugin: 'com.android.application'

android {
compileSdkVersion 23
buildToolsVersion '25.0.0'
compileSdkVersion 25
buildToolsVersion '25.0.3'

defaultConfig {
applicationId "com.example.ana.exampleapp"
minSdkVersion 16
targetSdkVersion 23
targetSdkVersion 25
versionCode 1
versionName "1.0"
}
Expand All @@ -22,7 +22,7 @@ android {
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
testCompile 'junit:junit:4.12'
compile 'com.android.support:appcompat-v7:23.0.1'
compile 'com.android.support:appcompat-v7:25.3.1'
compile 'org.mongodb:mongodb-driver:3.2.2'
compile 'org.mongodb:bson:3.2.2'
}
Original file line number Diff line number Diff line change
Expand Up @@ -241,7 +241,7 @@ public void btnSignIn(View view) {
} else if (option == 1) {
Toast.makeText(this, R.string.wrong_data, Toast.LENGTH_LONG).show();
} else {
Toast.makeText(this, R.string.register_error, Toast.LENGTH_LONG).show();
Toast.makeText(getApplicationContext(), R.string.mongodb_error, Toast.LENGTH_LONG).show();
}
} catch (Exception e) {
Log.e("Error en registro",String.format("The register couldn't be completed. Check that you have internet connexion and try it again later%s", e.getMessage()),e);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,6 @@ protected void onCreate(Bundle savedInstanceState) {
* first one with error. It also checks that there is internet connection before trying to
* connect with the database.
*
* @param view the clicked {@link View}.
* @see #finish()
* @see TextView#setError(CharSequence)
* @see EditText#setError(CharSequence)
Expand Down Expand Up @@ -175,7 +174,7 @@ public void btnFinish(View view) {
} else if (option == 1) {
Toast.makeText(this, R.string.repeated_email, Toast.LENGTH_LONG).show();
} else {
Toast.makeText(this, R.string.register_error, Toast.LENGTH_LONG).show();
Toast.makeText(getApplicationContext(), R.string.mongodb_error, Toast.LENGTH_LONG).show();
}
} catch (Exception e) {
Log.e("Registrer not complited",String.format("The register couldn't be completed. Check that you have internet connexion and try it again later.%s",e.getMessage()),e);
Expand Down Expand Up @@ -257,6 +256,7 @@ public void updateDrawState(TextPaint ds) {
private class SendRegistration extends AsyncTask<User, Void, Integer> {
@Override
protected Integer doInBackground(User... params) {

try {
MongoClientURI mongoClientURI = new MongoClientURI(Variables.MONGO_URI);
MongoClient mongoClient = new MongoClient(mongoClientURI);
Expand Down
1 change: 1 addition & 0 deletions app/src/main/res/values/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@
<string name="repeated_email2">There is already a user with the email you introduced. </string>
<string name="wrong_data">The email or the pin is not correct.</string>
<string name="update_error">The changes couldn\'t be saved. Check that you have internet connexion and try it again later.</string>
<string name="mongodb_error">The server can\'t be reach</string>

<!-- finish_register_activity -->
<string name="thanks_register">Thanks! The register has been correctly completed</string>
Expand Down

0 comments on commit e3e4950

Please sign in to comment.