Skip to content

Commit

Permalink
Issues Ana06#11 &Ana06#14 with sonar Analysis
Browse files Browse the repository at this point in the history
  • Loading branch information
joaquinolivera committed May 9, 2017
1 parent 34a0e0e commit 1571576
Show file tree
Hide file tree
Showing 17 changed files with 62 additions and 33 deletions.
1 change: 0 additions & 1 deletion .idea/.name

This file was deleted.

7 changes: 1 addition & 6 deletions .idea/gradle.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 0 additions & 1 deletion .idea/misc.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions .idea/modules.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Empty file added .sonar/.sonar_lock
Empty file.
5 changes: 5 additions & 0 deletions .sonar/report-task.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
projectKey=bip4cast
serverUrl=http://localhost:9000
dashboardUrl=http://localhost:9000/dashboard/index/bip4cast
ceTaskId=AVvt1qSuMi7_G9x4RzoD
ceTaskUrl=http://localhost:9000/api/ce/task?id=AVvt1qSuMi7_G9x4RzoD
2 changes: 1 addition & 1 deletion app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ apply plugin: 'com.android.application'

android {
compileSdkVersion 23
buildToolsVersion "23.0.1"
buildToolsVersion '25.0.0'

defaultConfig {
applicationId "com.example.ana.exampleapp"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
import com.mongodb.client.MongoCollection;
import com.mongodb.client.MongoDatabase;

import static android.R.attr.y;
import static com.mongodb.client.model.Filters.eq;


Expand All @@ -44,7 +45,7 @@ public class RegisterActivity extends AppCompatActivity {
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.register_activity);

setInitialDateBirth();
// Allow a part of the terms and conditions text to be clickable.
TextView tv = (TextView) findViewById(R.id.terms_text);
String terms1 = getString(R.string.terms1);
Expand All @@ -68,6 +69,13 @@ protected void onCreate(Bundle savedInstanceState) {
* @see TextView#setError(CharSequence)
* @see EditText#setError(CharSequence)
*/

public void setInitialDateBirth(){
DatePicker date_picker = (DatePicker) findViewById(R.id.age_answer);
//Values pretended by @author...
date_picker.init(1985, 3, 10, null);
}

public void btnFinish(View view) {
String email_text;
String name_text;
Expand Down
16 changes: 10 additions & 6 deletions app/src/main/java/com/example/ana/exampleapp/Variables.java
Original file line number Diff line number Diff line change
Expand Up @@ -17,15 +17,14 @@
*/
public final class Variables {
// The server IP
private static final String IP = "IP";
private static final String IP = "192.168.0.21"; // MongoDB server...
private String ip = System.getProperty("myapplication.ip"); //solution proposal of sonar-runner...
private static final String PORT = "27017";
// MongoDB uri with the IP, authentication (user, password and mechanism), database, etc.
public static final String mongo_uri = "mongodb://androidUser:password@" + IP + ":" + PORT +
"/bipolarDatabase?authMechanism=MONGODB-CR";

//public static final String mongo_uri = "mongodb://androidUser:password@" + IP + ":" + PORT +
//"/bipolarDatabase?authMechanism=MONGODB-CR";
//used for test purpose!
//public static final String mongo_uri = "mongodb://" + IP + ":" + PORT + "/test";

public static final String mongo_uri = "mongodb://" + IP + ":" + PORT + "/test";
// Name of shared preferences file;
public static final String PREFS_NAME = "MyPrefsFile";
// Regular expression to check email correction
Expand All @@ -35,6 +34,11 @@ public final class Variables {
* Final class: to prevent someone from accidentally instantiating the class, we give it an
* empty constructor.
*/
public void ipfromsystem(){
String ip = System.getProperty("myapplication.ip");
Log.i("Ip found", ip);
}

public Variables() {
}

Expand Down
29 changes: 19 additions & 10 deletions app/src/main/res/layout/finish_activity.xml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@

<RelativeLayout
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_height="508dp"
android:paddingBottom="50dp"
android:paddingLeft="30dp"
android:paddingRight="30dp"
Expand All @@ -34,13 +34,23 @@
android:id="@+id/thanks"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textAppearance="?android:attr/textAppearanceLarge"
android:text="@string/thanks"
android:layout_marginLeft="@dimen/activity_horizontal_margin"
android:layout_marginRight="@dimen/activity_horizontal_margin"
android:layout_marginStart="@dimen/activity_horizontal_margin"
android:paddingBottom="@dimen/activity_vertical_margin"
android:paddingTop="@dimen/activity_vertical_margin"
android:layout_marginStart="@dimen/activity_horizontal_margin"
android:layout_marginLeft="@dimen/activity_horizontal_margin"
android:layout_marginRight="@dimen/activity_horizontal_margin"/>
android:text="@string/thanks"
android:textAppearance="?android:attr/textAppearanceLarge" />

<TextView
android:id="@+id/textView"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentTop="true"
android:layout_centerHorizontal="true"
android:layout_marginTop="134dp"
android:text="@string/youmaychange"
android:textSize="18sp" />

</RelativeLayout>

Expand All @@ -49,10 +59,9 @@
android:layout_height="wrap_content"
android:text="@string/change"
android:id="@+id/button_finish"
android:layout_below="@+id/thanks_box"
android:layout_centerHorizontal="true"
android:layout_marginTop="80dp"
android:onClick="btnChange"/>
android:onClick="btnChange"
android:layout_alignParentBottom="true"
android:layout_centerHorizontal="true" />


</RelativeLayout>
Expand Down
4 changes: 2 additions & 2 deletions app/src/main/res/layout/profile_activity.xml
Original file line number Diff line number Diff line change
Expand Up @@ -78,8 +78,8 @@
android:layout_height="wrap_content"
android:layout_below="@+id/age"
android:layout_centerHorizontal="true"
android:datePickerMode = "spinner"
android:calendarViewShown="false"/>
android:calendarViewShown="false"
android:datePickerMode="spinner" />

<!-- gender -->
<TextView
Expand Down
4 changes: 2 additions & 2 deletions app/src/main/res/layout/register_activity.xml
Original file line number Diff line number Diff line change
Expand Up @@ -80,8 +80,8 @@
android:layout_height="wrap_content"
android:layout_below="@+id/age"
android:layout_centerHorizontal="true"
android:datePickerMode = "spinner"
android:calendarViewShown="false"/>
android:calendarViewShown="false"
android:datePickerMode="spinner" />

<!-- gender -->
<TextView
Expand Down
1 change: 1 addition & 0 deletions app/src/main/res/values-es/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,7 @@

<!-- finish_activity -->
<string name="thanks">¡Gracias! Los datos se han enviado correctamente</string>
<string name="youmaychange">Puedes cambiar las respuestas más adelante !!</string>
<string name="change">ACEPTAR</string>

<!-- profile_activity -->
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 @@ -95,6 +95,7 @@

<!-- finish_activity -->
<string name="thanks">Thanks! Your answers have been correctly sent</string>
<string name="youmaychange">You may change the answers later !!</string>
<string name="change">ACCEPT</string>

<!-- profile_activity -->
Expand Down
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ buildscript {
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:1.5.0'
classpath 'com.android.tools.build:gradle:2.3.1'

// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
Expand Down
4 changes: 2 additions & 2 deletions gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#Wed Oct 21 11:34:03 PDT 2015
#Tue May 09 11:23:12 PYT 2017
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-2.8-all.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-3.3-all.zip
7 changes: 7 additions & 0 deletions sonar-project.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
sonar.projectKey=bip4cast
sonar.projectName=Bip4Cast
sonar.projectVersion=1.0

sonar.sources=app/src/main/java/com/example/ana/exampleapp
sonar.language=java
sonar.sourceEncoding=UTF-8

0 comments on commit 1571576

Please sign in to comment.