0% found this document useful (0 votes)
16 views22 pages

Android Code

Uploaded by

Ate Ganda
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOC, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
16 views22 pages

Android Code

Uploaded by

Ate Ganda
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOC, PDF, TXT or read online on Scribd
You are on page 1/ 22

DeveloperActivity.

java

package thefourbit.drriceapp;

import android.content.Intent;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.view.View;

public class DeveloperActivity extends AppCompatActivity {

@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_developer);
}

public void getstarted(View view) { // go to SamplingActivity by button


click
Intent intent = new Intent(this,SamplingActivity.class);
startActivity(intent);
}

MAinActivity.java

package thefourbit.drriceapp;

import android.content.Intent;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.view.View;

public class MainActivity extends AppCompatActivity {

@Override
protected void onCreate(Bundle savedInstanceState) { // create activity
interface
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
}

public void start(View view) { // go to SamplingActivity


Intent intent = new Intent(this,SamplingActivity.class);
startActivity(intent);
}

public void developers(View view) { //go to Developer Activity


Intent intent = new Intent(this,DeveloperActivity.class);
startActivity(intent);
}

public void tips(View view) { // go to tipsActivity


Intent intent = new Intent(this,tipsActivity.class);
startActivity(intent);
}

public void close(View view) { // close app


android.os.Process.killProcess(android.os.Process.myPid());
System.exit(1);
}

}
PhosphorusActivity.java

package thefourbit.drriceapp;

import android.content.Intent;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.view.View;
import android.widget.CheckBox;

public class PhosphorusActivity extends AppCompatActivity {

private boolean ck4 = false; // checkbox number 4 value


private boolean ck5 = false; // checkbox number 5 value
private boolean[] values; // checkbox values for all conditions
private int shade; // leaf color shade
private boolean below = false; // if leaf color is below 3 or 4
private boolean method = false;

@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_phosphorus);

Intent retrieve = getIntent(); // recover data from previous intent

values =
retrieve.getBooleanArrayExtra(PotassiumActivity.EXTRA_NAME); // retrieve
boolean array
shade = retrieve.getIntExtra(PotassiumActivity.EXTRA_AVERAGE,0); //
retrieve leaf color shade
below =
retrieve.getBooleanExtra(PotassiumActivity.EXTRA_BELOW,false); // retrieve
boolean condition if below 4 or 3
method =
retrieve.getBooleanExtra(PotassiumActivity.EXTRA_METHOD,false);

public void select(View view) { // if checkbox is clicked


boolean checked = ((CheckBox) view).isChecked(); // get checked
checkbox

switch(view.getId()) { // test what checkbox it is using switch

case R.id.ck4: // R.id.ck4 is the id of checkbox #4


if(checked) { // if R.id.ck4 is checked update ck4 to true
ck4 = true;
}
break;

case R.id.ck5:
if(checked) {
ck5 = true;
}
break;

// this static variables ared used as id for intent extras


public final static String EXTRA_NAME = "extra_name";
public final static String EXTRA_AVERAGE = "extra_average";
public final static String EXTRA_BELOW = "extra_below";
public final static String EXTRA_METHOD = "extra_method";

public void nextWeather(View view) { // execute if next button is


clicked
boolean[] pass = {values[0],values[1],values[2],values[3],ck4,ck5}; //
pass all the values of checkboxes
Intent intent = new Intent(this,WeatherActivity.class); // start new
intent
intent.putExtra(EXTRA_NAME,pass); // add data to the intent
intent.putExtra(EXTRA_AVERAGE,shade);
intent.putExtra(EXTRA_BELOW,below);
intent.putExtra(EXTRA_METHOD,method);
startActivity(intent); // start next activity
}

PotassiumActivity.java

package thefourbit.drriceapp;

import android.content.Intent;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.view.View;
import android.widget.CheckBox;

public class PotassiumActivity extends AppCompatActivity {

private boolean ck0 = false; // checkbox #0


private boolean ck1 = false; // checkbox #1
private boolean ck2 = false; // checkbox #2
private boolean ck3 = false; // checkbox #3

private int ave; // average color


private boolean below = false; // if color is below 3 or 4
private boolean method = false;

@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_potassium);

Intent aver = getIntent(); // get data from preview activity

ave = aver.getIntExtra(TypeActivity.EXTRA_NAME,0);
below = aver.getBooleanExtra(TypeActivity.EXTRA_BELOW,false);
method = aver.getBooleanExtra(TypeActivity.EXTRA_METHOD,false);
}

public void select(View view) { // if checkbox is clicked


boolean checked = ((CheckBox) view).isChecked(); // check if clicked
checkbox is checked

switch(view.getId()) { // switch for finding what is the id of the


clicked checkbox

case R.id.ck0:
if(checked) {
ck0 = true;
}
break;

case R.id.ck1:
if(checked) {
ck1 = true;
}
break;

case R.id.ck2:
if(checked) {
ck2 = true;
}
break;

case R.id.ck3:
if(checked) {
ck3 = true;
}
break;

// intent extra id

public static final String EXTRA_NAME = "extra_name";


public static final String EXTRA_AVERAGE = "extra_average";
public static final String EXTRA_BELOW = "extra_below";
public static final String EXTRA_METHOD = "extra_method";

public void nextWeather(View view) { // go to the next intent the same


in other activity
boolean[] values = {ck0,ck1,ck2,ck3};
Intent intent = new Intent(this,PhosphorusActivity.class);
intent.putExtra(EXTRA_NAME,values);
intent.putExtra(EXTRA_AVERAGE,ave);
intent.putExtra(EXTRA_BELOW,below);
intent.putExtra(EXTRA_METHOD,method);
startActivity(intent);
}

resultActivity.java

package thefourbit.drriceapp;

import android.content.Intent;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.view.View;
import android.widget.TextView;
import android.widget.Toast;

public class resultActivity extends AppCompatActivity {

private boolean[] conditions; // container array for the values of


checkboxes
private int average; // average color
private boolean weather; // weather condition
private boolean below; // if below 3 or 4

private boolean phosphorus; // if phosphorus is needed


private boolean potassium; // if potassium is needed
private boolean method;

@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_result);

Intent data = getIntent(); // get data from previous intent

conditions =
data.getBooleanArrayExtra(WeatherActivity.EXTRA_BOOLEAN);
average = data.getIntExtra(WeatherActivity.EXTRA_AVERAGE,0);
weather = data.getBooleanExtra(WeatherActivity.EXTRA_WEATHER,false);
below = data.getBooleanExtra(WeatherActivity.EXTRA_BELOW,false);
method = data.getBooleanExtra(WeatherActivity.EXTRA_METHOD,false);

potassium = (conditions[0]) ? true : false; // check if potassium is


needed
phosphorus = (conditions[1] || conditions[2] || conditions[3] ||
conditions[4] || conditions[5]) ? true : false; // check if phosphorus is
needed

TextView nitrogen = (TextView)findViewById(R.id.nitrogen); // get


the textview for nitrogen output
TextView phosphorus = (TextView)findViewById(R.id.phosphorus); //
get text textview for phosphorus output
TextView potassium = (TextView)findViewById(R.id.potassium); // get
the textview for potassium output

/*

#5 - 4 - Dark Green
#4 - 3 - Green
#3 - 2 - Light Green
#2 - 1 - Yellow Green

*/

if(this.average != 4) { // if average is not equals dark green


if (this.weather) { // dry season
if(this.below) { // if below 4
nitrogen.setText("Nitrogen(N): 23kg/ha");
}
else { // if not below 4
nitrogen.setText("Nitrogen(N): no deficiency...");
}
} else { // wet season
if(this.below) { // if below 3
nitrogen.setText("Nitrogen(N): 35kg/ha");
}
else { // if not below 3
nitrogen.setText("Nitrogen(N): no deficiency...");
}
}
}
else { // if leaf color is dark green or green
nitrogen.setText("Nitrogen(N): no deficiency...");
}

if(this.potassium) { // if potassium is needed


potassium.setText("Potassium(K): 30kg / ha");
}
else { // if potassium is not needed
potassium.setText("Potassium(K): no deficiency...");
}

if(this.phosphorus) { // if phosphorus is needed


phosphorus.setText("Phosphorus(P): 28kg / ha");
}
else { // if phosphorus is not needed
phosphorus.setText("Phosphorus(P): no deficiency...");
}

String toast = "Fertilizer Computed!"; // text for the toast

Toast.makeText(getApplication(),toast, Toast.LENGTH_SHORT).show();
// show toast

public void reset(View view) { // reset app by going to the MainActivity


Intent intent = new Intent(this,MainActivity.class);
startActivity(intent);
}

SamplingActivity.java

package thefourbit.drriceapp;

import android.content.Intent;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.view.View;
import android.widget.TextView;

public class SamplingResult extends AppCompatActivity {

private int average; // variable for average color


private int shade; // variable for shade
private boolean below = false; // if color level below 3 or 4

@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_sampling_result);

Intent intent = getIntent(); // get data from previous intent

int[] colors = intent.getIntArrayExtra(SamplingActivity.EXTRA_NAME);


// get 10 int from previous intent

if(colors.length == 10) { // if length array equals to 10

int level1 = 0; // yellow green


int level2 = 0; // light green
int level3 = 0; // green
int level4 = 0; // dark green
int ave; // average color from 10 samples

for(int i = 0; i <= (colors.length - 1); i++) { // loop 10 times

if(colors[i] == 1) { // if level is equals to 1


level1++; // increement level 1
if(level1 >= 6) { // if level1 is more than 6 times
appeared
this.below = true;
break; // stop loop
}
}
else if(colors[i] == 2) { // equals to level 2
level2++;
}
else if(colors[i] == 3) { // equals to level 3
level3++;
}
else if(colors[i] == 4) { // equals to level 4
level4++;
}

ave = Math.max(level1,Math.max(level2,Math.max(level3,level4)));
// get the largest number

if(ave != 0) { // ave is not equal to 0


this.average = ave;

String color = "Average Color: ";


TextView avecolor = (TextView)findViewById(R.id.avecolor);
// get textview for output text

if(ave == level1) { // if yellow green


color += "Yellow Green";
shade = 1;
this.below = true;
}
else if(ave == level2) { // if light green
color += "Light Green";
shade = 2;
}
else if(ave == level3) { // if green
color += "Green";
shade = 3;
}
else if(ave == level4) { // if dark green
color += "Dark Green";
shade = 4;
}

avecolor.setText(color); // set average color

/* intent extra id for next intent */

public final static String EXTRA_NAME = "average_extra";


public final static String EXTRA_BELOW = "extra_below";

public void next(View view) { // when button is pressed go to next


intent
Intent intent = new Intent(this,TypeActivity.class);
intent.putExtra(this.EXTRA_NAME,shade);
intent.putExtra(this.EXTRA_BELOW,this.below);
startActivity(intent);
}

}
SamplingresultActivity.java

package thefourbit.drriceapp;

import android.content.Intent;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.view.View;
import android.widget.TextView;

public class SamplingResult extends AppCompatActivity {

private int average; // variable for average color


private int shade; // variable for shade
private boolean below = false; // if color level below 3 or 4

@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_sampling_result);

Intent intent = getIntent(); // get data from previous intent

int[] colors = intent.getIntArrayExtra(SamplingActivity.EXTRA_NAME);


// get 10 int from previous intent

if(colors.length == 10) { // if length array equals to 10

int level1 = 0; // yellow green


int level2 = 0; // light green
int level3 = 0; // green
int level4 = 0; // dark green
int ave; // average color from 10 samples

for(int i = 0; i <= (colors.length - 1); i++) { // loop 10 times

if(colors[i] == 1) { // if level is equals to 1


level1++; // increement level 1
if(level1 >= 6) { // if level1 is more than 6 times
appeared
this.below = true;
break; // stop loop
}
}
else if(colors[i] == 2) { // equals to level 2
level2++;
}
else if(colors[i] == 3) { // equals to level 3
level3++;
}
else if(colors[i] == 4) { // equals to level 4
level4++;
}

ave = Math.max(level1,Math.max(level2,Math.max(level3,level4)));
// get the largest number

if(ave != 0) { // ave is not equal to 0


this.average = ave;
String color = "Average Color: ";
TextView avecolor = (TextView)findViewById(R.id.avecolor);
// get textview for output text

if(ave == level1) { // if yellow green


color += "Yellow Green";
shade = 1;
this.below = true;
}
else if(ave == level2) { // if light green
color += "Light Green";
shade = 2;
}
else if(ave == level3) { // if green
color += "Green";
shade = 3;
}
else if(ave == level4) { // if dark green
color += "Dark Green";
shade = 4;
}

avecolor.setText(color); // set average color

public final static String EXTRA_NAME = "average_extra";


public final static String EXTRA_BELOW = "extra_below";

public void next(View view) { // when button is pressed go to next


intent
Intent intent = new Intent(this,TypeActivity.class);
intent.putExtra(this.EXTRA_NAME,shade);
intent.putExtra(this.EXTRA_BELOW,this.below);
startActivity(intent);
}

tipsActivity.java

package thefourbit.drriceapp;

import android.content.Intent;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.view.View;

public class tipsActivity extends AppCompatActivity {

@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_tips);
}

public void started(View view) { // start using app button


Intent intent = new Intent(this,SamplingActivity.class);
startActivity(intent);
}

TypeActivity.java

package thefourbit.drriceapp;

import android.content.Intent;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.view.View;

import android.widget.RadioGroup;
import android.widget.Toast;

public class TypeActivity extends AppCompatActivity {

private int ave; // average color


private boolean below = false; // if below 3 or 4

@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_type);

Intent data = getIntent(); // get data from previous intent

ave = data.getIntExtra(SamplingResult.EXTRA_NAME,0);
below = data.getBooleanExtra(SamplingResult.EXTRA_BELOW,false);

public final static String EXTRA_NAME = "average_extra";


public final static String EXTRA_BELOW = "extra_below";
public final static String EXTRA_METHOD = "extra_method";

public void nextMethod(View view) { // check if next button is clicked

boolean method;

RadioGroup rg = (RadioGroup)findViewById(R.id.methods); // get the


radio group

if(rg.getCheckedRadioButtonId() != -1) { // if radio is checked

if(rg.getCheckedRadioButtonId() == R.id.seed) { // direct


seeding
method = true;
if(ave < 3) { // if average is less than 3
this.below = true;
}
}
else { // transplanting
method = false;
if(ave < 4) { // if average is less than 4
this.below = true;
}
}

Intent intent = new Intent(this, PotassiumActivity.class); // go


to the next activity
intent.putExtra(EXTRA_NAME, ave);
intent.putExtra(EXTRA_BELOW, this.below);
intent.putExtra(EXTRA_METHOD,method);
startActivity(intent);

}
else {
Toast.makeText(getApplication(), "Please select method!",
Toast.LENGTH_SHORT).show(); // show toast if nothing is selected
}
}
}

WeatherActivity.java

package thefourbit.drriceapp;

import android.content.Intent;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.view.View;
//import android.widget.RadioButton;
import android.widget.RadioGroup;
import android.widget.Toast;

public class WeatherActivity extends AppCompatActivity {

private boolean[] data;


private int ave;
private boolean below = false;
private boolean method = false;

@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_weather);

Intent retrieve = getIntent();

data = retrieve.getBooleanArrayExtra(PhosphorusActivity.EXTRA_NAME);
ave = retrieve.getIntExtra(PhosphorusActivity.EXTRA_AVERAGE,0);
below =
retrieve.getBooleanExtra(PhosphorusActivity.EXTRA_BELOW,false);
method =
retrieve.getBooleanExtra(PhosphorusActivity.EXTRA_METHOD,false);

// intent extra id

public final static String EXTRA_BOOLEAN = "extra_boolean";


public final static String EXTRA_AVERAGE = "extra_average";
public final static String EXTRA_WEATHER = "extra_weather";
public final static String EXTRA_BELOW = "extra_below";
public final static String EXTRA_METHOD = "extra_method";

public void calculate(View view) {

Boolean weather;

RadioGroup rg = (RadioGroup)findViewById(R.id.weather); // get radio


group
if(rg.getCheckedRadioButtonId() != -1) { // if radio is checked

//RadioButton radio = (RadioButton)


this.findViewById(rg.getCheckedRadioButtonId());

if (rg.getCheckedRadioButtonId() == R.id.wet) { // condition is


wet
weather = false;
} else { // condition is dry
weather = true;
}

Intent intent = new Intent(this, resultActivity.class); // go


the next intent
intent.putExtra(EXTRA_BOOLEAN, data);
intent.putExtra(EXTRA_AVERAGE, ave);
intent.putExtra(EXTRA_WEATHER, weather);
intent.putExtra(EXTRA_BELOW, below);
intent.putExtra(EXTRA_METHOD,method);
startActivity(intent);

}
else {
Toast.makeText(getApplication(), "Please select season!",
Toast.LENGTH_SHORT).show(); // if no season selected show toast
}
}

Color.xml

<?xml version="1.0" encoding="utf-8"?>


<resources>
<color name="colorPrimary">#3F51B5</color>
<color name="colorPrimaryDark">#303F9F</color>
<color name="colorAccent">#FF4081</color>
</resources>

Dimens.xml

<resources>
<!-- Default screen margins, per the Android Design guidelines. -->
<dimen name="activity_horizontal_margin">16dp</dimen>
<dimen name="activity_vertical_margin">16dp</dimen>
</resources>

String.xml

<resources>
<string name="app_name">Do It Rice!</string>
<string name="app_title">Do It Rice!</string>
<string name="app_button_start">Start</string>
<string name="app_button_capture">Capture</string>
<string name="app_button_proceed">Analyze Samples</string>
<string name="app_label_sample">Capture leaf color samples</string>
<string name="app_button_next">Next</string>
<string name="app_button_help">How To Use?</string>
<string name="app_label_color">Leaf Color Chart</string>
</resources>

Styles.xml

<resources>
<!-- Base application theme. -->
<style name="AppTheme" parent="Theme.AppCompat.Light.DarkActionBar">
<!-- Customize your theme here. -->
<item name="colorPrimary">@color/colorPrimary</item>
<item name="colorPrimaryDark">@color/colorPrimaryDark</item>
<item name="colorAccent">@color/colorAccent</item>
<item name="windowActionBar">false</item>
<item name="windowNoTitle">true</item>
<item name="android:windowFullscreen">true</item>
</style>

</resources>
AndroidManifest.xml

<?xml version="1.0" encoding="utf-8"?>


<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="thefourbit.drriceapp">

<uses-feature
android:name="android.hardware.camera"
android:required="true" />

<uses-permission android:name="android.permission.CAMERA" />

<application
android:allowBackup="true"
android:icon="@mipmap/ic_launcher2"
android:label="@string/app_title"
android:supportsRtl="true"
android:theme="@style/AppTheme">
<activity
android:name=".MainActivity"
android:screenOrientation="portrait">
<intent-filter>
<action android:name="android.intent.action.MAIN" />

<category android:name="android.intent.category.LAUNCHER" />


</intent-filter>
</activity>
<activity
android:name=".SamplingActivity"
android:screenOrientation="portrait" />
<activity
android:name=".SamplingResult"
android:screenOrientation="portrait" />
<activity android:name=".PotassiumActivity" />
<activity android:name=".PhosphorusActivity" />
<activity android:name=".WeatherActivity" />
<activity android:name=".resultActivity" />
<activity android:name=".tipsActivity" />
<activity android:name=".DeveloperActivity" />
<activity android:name=".TypeActivity"></activity>
</application>

</manifest>
(log)Lint-result-release-fatal.html

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"


"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"
/><title>Lint Report</title>
<link rel="stylesheet" type="text/css"
href="http://fonts.googleapis.com/css?family=Roboto" />
<style>
body {
max-width: 800px;
background-color: #000000;
background: -webkit-gradient(linear, left top, right bottom,
from(#000000), to(#272d33));
background: -moz-linear-gradient(left top, #000000, #272d33);
color: #f3f3f3;
font-family: 'Roboto', Sans-Serif;
}
.issue {
margin-top: 10px;
margin-bottom: 10px;
padding: 5px 0px 5px 5px;
}
.id {
font-size: 14pt;
color: #bebebe;
margin: 5px 0px 5px 0px;
}
.category {
font-size: 18pt;
color: #bebebe;
margin: 10px 0px 5px 0px;
}
.explanation {
margin-top: 10px;
}
.explanation b {
color: #ffbbbb;
}
.explanation code {
color: #bebebe;
font-family: 'Roboto', Sans-Serif;
}
pre {
background-color: #282828;
margin: 5px 0px 5px 5px;
padding: 5px 5px 5px 0px;
overflow: hidden;
}
.lineno {
color: #4f4f4f;
}
.embedimage {
max-width: 200px;
max-height: 200px;
}
th { font-weight: normal; }
table { border: none; }
.metadata {
}
.location {
color: #bebebe;
}
.message { }
.errorspan { color: #33b5e5; }
.errorline { color: #33b5e5; }
.warningslist { margin-bottom: 20px; }
.overview {
padding: 10pt;
width: 100%;
overflow: auto;
border-collapse:collapse;
}
.overview tr {
border-top: solid 1px #39393a;
border-bottom: solid 1px #39393a;
}
.countColumn {
text-align: right;
padding-right: 20px;
}
.issueColumn {
padding-left: 16px;
}
.categoryColumn {
position: relative;
left: -50px;
padding-top: 20px;
padding-bottom: 5px;
}
.titleSeparator {
background-color: #33b5e5;
height: 3px;
margin-bottom: 10px;
}
.categorySeparator {
background-color: #33b5e5;
height: 3px;
margin-bottom: 10px;
}
.issueSeparator {
background-color: #39393a;
height: 2px;
margin-bottom: 10px;
}
.location a:link {
text-decoration: none;
color: #bebebe;
}
.location a:hover {
text-decoration: underline;
color: #f3f3f3;
}
a:link {
text-decoration: none;
color: #f3f3f3;
}
a:visited {
text-decoration: none;
color: #bebebe;
}
a:hover {
text-decoration: underline;
color: #f3f3f3;
}
a:active {
text-decoration: underline;
color: #f3f3f3;
}
.moreinfo a:link {
text-decoration: underline;
color: #33b5e5;
}
.moreinfo a:visited {
text-decoration: underline;
color: #33b5e5;
}
.issue a:link {
text-decoration: underline;
}
.issue a:visited {
text-decoration: underline;
}
.id a:link {
text-decoration: none;
color: #bebebe;
}
.id a:visited {
text-decoration: none;
color: #bebebe;
}
.id a:hover {
text-decoration: underline;
color: #f3f3f3;
}
.id a:active {
text-decoration: underline;
color: #bebebe;
}
.category a:link {
text-decoration: none;
color: #bebebe;
}
.category a:visited {
text-decoration: none;
color: #bebebe;
}
.category a:hover {
text-decoration: underline;
color: #f3f3f3;
}
.category a:active {
text-decoration: underline;
color: #bebebe;
}
button {
color: #ffffff;
background-color: #353535;
border-left: none;
border-right: none;
border-bottom: none;
border-top: solid 1px #5b5b5b;
font-family: 'Roboto', Sans-Serif;
font-size: 12pt;
}
</style>
<script language="javascript" type="text/javascript">
<!--
function reveal(id) {
if (document.getElementById) {
document.getElementById(id).style.display = 'block';
document.getElementById(id+'Link').style.display = 'none';
}
}
//-->
</script>
</head>
<body>
<h1>Lint Report</h1>
<div class="titleSeparator"></div>
Check performed at Thu Feb 23 01:47:36 CST 2017.<br/>
0 errors and 0 warnings found:<br/><br/>
Congratulations!
</body>
</html>

(log)Lint-result-release-fatal.xml

<?xml version="1.0" encoding="UTF-8"?>


<issues format="4" by="lint 25.2.2">

</issues>

exampleinstrumentedTest.java

package thefourbit.drriceapp;

import android.content.Context;
import android.support.test.InstrumentationRegistry;
import android.support.test.runner.AndroidJUnit4;

import org.junit.Test;
import org.junit.runner.RunWith;

import static org.junit.Assert.*;

/**
* Instrumentation test, which will execute on an Android device.
*
* @see <a href="http://d.android.com/tools/testing">Testing
documentation</a>
*/
@RunWith(AndroidJUnit4.class)
public class ExampleInstrumentedTest {
@Test
public void useAppContext() throws Exception {
// Context of the app under test.
Context appContext = InstrumentationRegistry.getTargetContext();

assertEquals("thefourbit.drriceapp", appContext.getPackageName());
}
}

(src)App.iml

<?xml version="1.0" encoding="UTF-8"?>


<module external.linked.project.id=":app"
external.linked.project.path="$MODULE_DIR$"
external.root.project.path="$MODULE_DIR$/.." external.system.id="GRADLE"
type="JAVA_MODULE" version="4">
<component name="FacetManager">
<facet type="android-gradle" name="Android-Gradle">
<configuration>
<option name="GRADLE_PROJECT_PATH" value=":app" />
</configuration>
</facet>
<facet type="android" name="Android">
<configuration>
<option name="SELECTED_BUILD_VARIANT" value="debug" />
<option name="SELECTED_TEST_ARTIFACT" value="_android_test_" />
<option name="ASSEMBLE_TASK_NAME" value="assembleDebug" />
<option name="COMPILE_JAVA_TASK_NAME" value="compileDebugSources" />
<afterSyncTasks>
<task>generateDebugSources</task>
</afterSyncTasks>
<option name="ALLOW_USER_CONFIGURATION" value="false" />
<option name="MANIFEST_FILE_RELATIVE_PATH"
value="/src/main/AndroidManifest.xml" />
<option name="RES_FOLDER_RELATIVE_PATH" value="/src/main/res" />
<option name="RES_FOLDERS_RELATIVE_PATH"
value="file://$MODULE_DIR$/src/main/res" />
<option name="ASSETS_FOLDER_RELATIVE_PATH" value="/src/main/assets"
/>
</configuration>
</facet>
</component>
<component name="NewModuleRootManager" LANGUAGE_LEVEL="JDK_1_7" inherit-
compiler-output="false">
<output url="file://$MODULE_DIR$/build/intermediates/classes/debug" />
<output-test
url="file://$MODULE_DIR$/build/intermediates/classes/test/debug" />
<exclude-output />
<content url="file://$MODULE_DIR$">
<sourceFolder url="file://$MODULE_DIR$/build/generated/source/r/debug"
isTestSource="false" generated="true" />
<sourceFolder
url="file://$MODULE_DIR$/build/generated/source/aidl/debug"
isTestSource="false" generated="true" />
<sourceFolder
url="file://$MODULE_DIR$/build/generated/source/buildConfig/debug"
isTestSource="false" generated="true" />
<sourceFolder
url="file://$MODULE_DIR$/build/generated/source/rs/debug"
isTestSource="false" generated="true" />
<sourceFolder
url="file://$MODULE_DIR$/build/generated/source/apt/debug"
isTestSource="false" generated="true" />
<sourceFolder url="file://$MODULE_DIR$/build/generated/res/rs/debug"
type="java-resource" />
<sourceFolder
url="file://$MODULE_DIR$/build/generated/res/resValues/debug" type="java-
resource" />
<sourceFolder
url="file://$MODULE_DIR$/build/generated/source/r/androidTest/debug"
isTestSource="true" generated="true" />
<sourceFolder
url="file://$MODULE_DIR$/build/generated/source/aidl/androidTest/debug"
isTestSource="true" generated="true" />
<sourceFolder
url="file://$MODULE_DIR$/build/generated/source/buildConfig/androidTest/
debug" isTestSource="true" generated="true" />
<sourceFolder
url="file://$MODULE_DIR$/build/generated/source/rs/androidTest/debug"
isTestSource="true" generated="true" />
<sourceFolder
url="file://$MODULE_DIR$/build/generated/source/apt/androidTest/debug"
isTestSource="true" generated="true" />
<sourceFolder
url="file://$MODULE_DIR$/build/generated/res/rs/androidTest/debug"
type="java-test-resource" />
<sourceFolder
url="file://$MODULE_DIR$/build/generated/res/resValues/androidTest/debug"
type="java-test-resource" />
<sourceFolder url="file://$MODULE_DIR$/src/debug/res" type="java-
resource" />
<sourceFolder url="file://$MODULE_DIR$/src/debug/resources"
type="java-resource" />
<sourceFolder url="file://$MODULE_DIR$/src/debug/assets" type="java-
resource" />
<sourceFolder url="file://$MODULE_DIR$/src/debug/aidl"
isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/src/debug/java"
isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/src/debug/jni"
isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/src/debug/rs"
isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/src/debug/shaders"
isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/src/testDebug/res" type="java-
test-resource" />
<sourceFolder url="file://$MODULE_DIR$/src/testDebug/resources"
type="java-test-resource" />
<sourceFolder url="file://$MODULE_DIR$/src/testDebug/assets"
type="java-test-resource" />
<sourceFolder url="file://$MODULE_DIR$/src/testDebug/aidl"
isTestSource="true" />
<sourceFolder url="file://$MODULE_DIR$/src/testDebug/java"
isTestSource="true" />
<sourceFolder url="file://$MODULE_DIR$/src/testDebug/jni"
isTestSource="true" />
<sourceFolder url="file://$MODULE_DIR$/src/testDebug/rs"
isTestSource="true" />
<sourceFolder url="file://$MODULE_DIR$/src/testDebug/shaders"
isTestSource="true" />
<sourceFolder url="file://$MODULE_DIR$/src/main/res" type="java-
resource" />
<sourceFolder url="file://$MODULE_DIR$/src/main/resources" type="java-
resource" />
<sourceFolder url="file://$MODULE_DIR$/src/main/assets" type="java-
resource" />
<sourceFolder url="file://$MODULE_DIR$/src/main/aidl"
isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/src/main/java"
isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/src/main/jni"
isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/src/main/rs"
isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/src/main/shaders"
isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/src/androidTest/res"
type="java-test-resource" />
<sourceFolder url="file://$MODULE_DIR$/src/androidTest/resources"
type="java-test-resource" />
<sourceFolder url="file://$MODULE_DIR$/src/androidTest/assets"
type="java-test-resource" />
<sourceFolder url="file://$MODULE_DIR$/src/androidTest/aidl"
isTestSource="true" />
<sourceFolder url="file://$MODULE_DIR$/src/androidTest/java"
isTestSource="true" />
<sourceFolder url="file://$MODULE_DIR$/src/androidTest/jni"
isTestSource="true" />
<sourceFolder url="file://$MODULE_DIR$/src/androidTest/rs"
isTestSource="true" />
<sourceFolder url="file://$MODULE_DIR$/src/androidTest/shaders"
isTestSource="true" />
<sourceFolder url="file://$MODULE_DIR$/src/test/res" type="java-test-
resource" />
<sourceFolder url="file://$MODULE_DIR$/src/test/resources" type="java-
test-resource" />
<sourceFolder url="file://$MODULE_DIR$/src/test/assets" type="java-
test-resource" />
<sourceFolder url="file://$MODULE_DIR$/src/test/aidl"
isTestSource="true" />
<sourceFolder url="file://$MODULE_DIR$/src/test/java"
isTestSource="true" />
<sourceFolder url="file://$MODULE_DIR$/src/test/jni"
isTestSource="true" />
<sourceFolder url="file://$MODULE_DIR$/src/test/rs"
isTestSource="true" />
<sourceFolder url="file://$MODULE_DIR$/src/test/shaders"
isTestSource="true" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/assets" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/blame" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/classes"
/>
<excludeFolder
url="file://$MODULE_DIR$/build/intermediates/dependency-cache" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/exploded-
aar/com.android.support.test.espresso/espresso-core/2.2.2/jars" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/exploded-
aar/com.android.support.test.espresso/espresso-idling-resource/2.2.2/jars"
/>
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/exploded-
aar/com.android.support.test/exposed-instrumentation-api-publish/0.5/jars"
/>
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/exploded-
aar/com.android.support.test/rules/0.5/jars" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/exploded-
aar/com.android.support.test/runner/0.5/jars" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/exploded-
aar/com.android.support/animated-vector-drawable/24.2.1/jars" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/exploded-
aar/com.android.support/appcompat-v7/24.2.1/jars" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/exploded-
aar/com.android.support/palette-v7/24.2.1/jars" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/exploded-
aar/com.android.support/support-compat/24.2.1/jars" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/exploded-
aar/com.android.support/support-core-ui/24.2.1/jars" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/exploded-
aar/com.android.support/support-core-utils/24.2.1/jars" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/exploded-
aar/com.android.support/support-fragment/24.2.1/jars" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/exploded-
aar/com.android.support/support-media-compat/24.2.1/jars" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/exploded-
aar/com.android.support/support-v4/24.2.1/jars" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/exploded-
aar/com.android.support/support-vector-drawable/24.2.1/jars" />
<excludeFolder
url="file://$MODULE_DIR$/build/intermediates/incremental" />
<excludeFolder
url="file://$MODULE_DIR$/build/intermediates/incremental-safeguard" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/jniLibs"
/>
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/manifests"
/>
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/pre-dexed"
/>
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/res" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/rs" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/shaders"
/>
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/symbols"
/>
<excludeFolder
url="file://$MODULE_DIR$/build/intermediates/transforms" />
<excludeFolder url="file://$MODULE_DIR$/build/outputs" />
<excludeFolder url="file://$MODULE_DIR$/build/tmp" />
</content>
<orderEntry type="jdk" jdkName="Android API 24 Platform"
jdkType="Android SDK" />
<orderEntry type="sourceFolder" forTests="false" />
<orderEntry type="library" exported="" name="support-v4-24.2.1"
level="project" />
<orderEntry type="library" exported="" name="support-compat-24.2.1"
level="project" />
<orderEntry type="library" exported="" name="support-media-compat-
24.2.1" level="project" />
<orderEntry type="library" exported="" name="animated-vector-drawable-
24.2.1" level="project" />
<orderEntry type="library" exported="" scope="TEST" name="espresso-core-
2.2.2" level="project" />
<orderEntry type="library" exported="" name="support-fragment-24.2.1"
level="project" />
<orderEntry type="library" exported="" scope="TEST" name="runner-0.5"
level="project" />
<orderEntry type="library" exported="" scope="TEST" name="exposed-
instrumentation-api-publish-0.5" level="project" />
<orderEntry type="library" exported="" name="support-core-ui-24.2.1"
level="project" />
<orderEntry type="library" exported="" scope="TEST" name="espresso-
idling-resource-2.2.2" level="project" />
<orderEntry type="library" exported="" scope="TEST" name="rules-0.5"
level="project" />
<orderEntry type="library" exported="" name="appcompat-v7-24.2.1"
level="project" />
<orderEntry type="library" exported="" name="support-vector-drawable-
24.2.1" level="project" />
<orderEntry type="library" exported="" scope="TEST" name="hamcrest-
library-1.3" level="project" />
<orderEntry type="library" exported="" scope="TEST"
name="javax.annotation-api-1.2" level="project" />
<orderEntry type="library" exported="" name="support-core-utils-24.2.1"
level="project" />
<orderEntry type="library" exported="" scope="TEST" name="javax.inject-
1" level="project" />
<orderEntry type="library" exported="" scope="TEST" name="hamcrest-
integration-1.3" level="project" />
<orderEntry type="library" exported="" name="support-annotations-24.2.1"
level="project" />
<orderEntry type="library" exported="" name="palette-v7-24.2.1"
level="project" />
<orderEntry type="library" exported="" scope="TEST" name="javawriter-
2.1.1" level="project" />
<orderEntry type="library" exported="" scope="TEST" name="hamcrest-core-
1.3" level="project" />
<orderEntry type="library" exported="" scope="TEST" name="junit-4.12"
level="project" />
<orderEntry type="library" exported="" scope="TEST" name="jsr305-2.0.1"
level="project" />
</component>
</module>

(src)Build.gradle

apply plugin: 'com.android.application'

android {
compileSdkVersion 24
buildToolsVersion "24.0.3"
defaultConfig {
applicationId "thefourbit.drriceapp"
minSdkVersion 17
targetSdkVersion 24
versionCode 1
versionName "1.0"
testInstrumentationRunner
"android.support.test.runner.AndroidJUnitRunner"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'),
'proguard-rules.pro'
}
}
}

dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
androidTestCompile('com.android.support.test.espresso:espresso-
core:2.2.2', {
exclude group: 'com.android.support', module: 'support-annotations'
})
compile 'com.android.support:appcompat-v7:24.2.1'
compile 'com.android.support:palette-v7:24.2.1'
testCompile 'junit:junit:4.12'
}

You might also like