Commit d158fc43 authored by P.Y.D Jayasinghe's avatar P.Y.D Jayasinghe

master update

parents 9cc91516 83089381
*.iml
.gradle
/.idea/.name
/.idea/gradle.xml
/.idea/misc.xml
/.idea
/local.properties
/.idea/caches
/.idea/libraries
......
/build
/src/main/assets
\ No newline at end of file
/src/main/assets/model.tflite
......@@ -64,6 +64,9 @@ android {
noCompress "tflite"
//noCompress "lite"
}
buildFeatures {
mlModelBinding true
}
}
dependencies {
......@@ -79,12 +82,13 @@ dependencies {
implementation 'org.tensorflow:tensorflow-lite-support:0.1.0'
implementation 'org.tensorflow:tensorflow-lite-metadata:0.1.0'
implementation 'com.squareup.retrofit2:retrofit:2.3.0'
implementation 'com.google.android.gms:play-services-location:20.0.0'
implementation 'com.squareup.retrofit2:converter-gson:2.3.0'
implementation('org.tensorflow:tensorflow-lite:0.0.0-nightly') { changing = true }
implementation('org.tensorflow:tensorflow-lite-gpu:0.0.0-nightly') { changing = true }
implementation('org.tensorflow:tensorflow-lite-support:0.0.0-nightly') { changing = true }
//Tensorflow Lite Dependencies
implementation 'org.tensorflow:tensorflow-lite:+'
//implementation 'org.tensorflow:tensorflow-lite:+'
testImplementation 'junit:junit:4.+'
androidTestImplementation 'androidx.test.ext:junit:1.1.3'
......
package com.example.asuper;
import android.content.Context;
import androidx.test.platform.app.InstrumentationRegistry;
import androidx.test.ext.junit.runners.AndroidJUnit4;
import org.junit.Test;
import org.junit.runner.RunWith;
import static org.junit.Assert.*;
/**
* Instrumented 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() {
// Context of the app under test.
Context appContext = InstrumentationRegistry.getInstrumentation().getTargetContext();
assertEquals("com.example.asuper", appContext.getPackageName());
}
}
\ No newline at end of file
......@@ -13,6 +13,8 @@
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
<application
android:allowBackup="true"
......@@ -21,7 +23,38 @@
android:roundIcon="@mipmap/ic_launcher_round"
android:supportsRtl="true"
android:theme="@style/Theme.EKetha">
<activity android:name=".SplashScreen"
<activity
android:name=".PaddyArea.PaddyAreaView_04"
android:exported="false" />
<activity
android:name=".PaddyArea.PaddyAreaView_03"
android:exported="false" />
<activity
android:name=".PaddyArea.PaddyAreaView_02"
android:exported="false" />
<activity
android:name=".PaddyArea.PaddyAreaView_01"
android:exported="false" />
<activity
android:name=".PaddyArea.PaddyAreaText"
android:exported="false" />
<activity
android:name=".PaddyArea.PaddyAreaResult"
android:exported="false" />
<activity
android:name=".PaddyArea.PaddyAreaHome"
android:exported="false" />
<activity
android:name=".fertilizerHome"
android:exported="false" />
<activity
android:name=".FertilizerGuidence"
android:exported="false" />
<activity
android:name=".Fertilizer"
android:exported="false" />
<activity
android:name=".SplashScreen"
android:exported="true">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
......@@ -36,7 +69,7 @@
<activity android:name=".growthHome" />
<activity android:name=".Growth" />
<activity android:name=".Register" />
<activity android:name=".Login"/>
<activity android:name=".Login" />
<activity android:name=".MainActivity" />
<provider
......
package com.example.eketha;
import androidx.annotation.Nullable;
import androidx.annotation.RequiresApi;
import androidx.appcompat.app.AppCompatActivity;
import android.Manifest;
import android.content.Intent;
import android.content.pm.PackageManager;
import android.graphics.Bitmap;
import android.media.ThumbnailUtils;
import android.net.Uri;
import android.os.Build;
import android.os.Bundle;
import android.provider.MediaStore;
import android.view.View;
import android.widget.Button;
import android.widget.ImageView;
import android.widget.TextView;
import android.widget.Toast;
import com.example.eketha.PaddyArea.PaddyAreaHome;
import com.example.eketha.ml.BmodelTO;
import org.tensorflow.lite.DataType;
import org.tensorflow.lite.support.tensorbuffer.TensorBuffer;
import java.io.IOException;
import java.nio.ByteBuffer;
import java.nio.ByteOrder;
public class Fertilizer extends AppCompatActivity {
private Button camera, gallery,area;
private ImageView imageView;
private TextView result;
private int imageSize = 256;
private String fertilizerType;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_fertilizer);
camera = findViewById(R.id.button);
gallery = findViewById(R.id.button2);
area = findViewById(R.id.button3);
result = findViewById(R.id.result);
imageView = findViewById(R.id.imageView);
area.setEnabled(false);
camera.setOnClickListener(new View.OnClickListener() {
@RequiresApi(api = Build.VERSION_CODES.M)
@Override
public void onClick(View view) {
if (checkSelfPermission(Manifest.permission.CAMERA) == PackageManager.PERMISSION_GRANTED) {
Intent cameraIntent = new Intent(MediaStore.ACTION_IMAGE_CAPTURE);
startActivityForResult(cameraIntent, 3);
} else {
requestPermissions(new String[]{Manifest.permission.CAMERA}, 100);
}
}
});
gallery.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
Intent cameraIntent = new Intent(Intent.ACTION_PICK, MediaStore.Images.Media.EXTERNAL_CONTENT_URI);
startActivityForResult(cameraIntent, 1);
}
});
area.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
Intent intent = new Intent(Fertilizer.this, PaddyAreaHome.class);
intent.putExtra("fertilizerType",fertilizerType);
startActivity(intent);
}
});
}
public void classifyImage(Bitmap image){
try {
BmodelTO model = BmodelTO.newInstance(getApplicationContext());
// Creates inputs for reference.
TensorBuffer inputFeature0 = TensorBuffer.createFixedSize(new int[]{1, 256, 256, 3}, DataType.FLOAT32);
ByteBuffer byteBuffer = ByteBuffer.allocateDirect(4 * imageSize * imageSize * 3);
byteBuffer.order(ByteOrder.nativeOrder());
int[] intValues = new int[imageSize * imageSize];
image.getPixels(intValues, 0, image.getWidth(), 0, 0, image.getWidth(), image.getHeight());
int pixel = 0;
//iterate over each pixel and extract R, G, and B values. Add those values individually to the byte buffer.
for(int i = 0; i < imageSize; i ++){
for(int j = 0; j < imageSize; j++){
int val = intValues[pixel++]; // RGB
byteBuffer.putFloat(((val >> 16) & 0xFF) * (1.f / 1));
byteBuffer.putFloat(((val >> 8) & 0xFF) * (1.f / 1));
byteBuffer.putFloat((val & 0xFF) * (1.f / 1));
}
}
inputFeature0.loadBuffer(byteBuffer);
// Runs model inference and gets result.
BmodelTO.Outputs outputs = model.process(inputFeature0);
TensorBuffer outputFeature0 = outputs.getOutputFeature0AsTensorBuffer();
float[] confidences = outputFeature0.getFloatArray();
// find the index of the class with the biggest confidence.
int maxPos = 0;
float maxConfidence = 0;
for (int i = 0; i < confidences.length; i++) {
if (confidences[i] > maxConfidence) {
maxConfidence = confidences[i];
maxPos = i;
}
}
String[] classes = {"Muriate of Potash (MOP)", "Triple Super Phosphate (TSP)", "Urea","Zinc Sulphate"};
result.setText(classes[maxPos]);
if(classes[maxPos] == "Muriate of Potash (MOP)"){
Toast.makeText(getApplicationContext(),"1", Toast.LENGTH_SHORT).show();
fertilizerType = "1";
}
else if(classes[maxPos] == "Triple Super Phosphate (TSP)"){
Toast.makeText(getApplicationContext(),"2", Toast.LENGTH_SHORT).show();
fertilizerType = "2";
}
else if(classes[maxPos] == "Urea"){
Toast.makeText(getApplicationContext(),"3", Toast.LENGTH_SHORT).show();
fertilizerType = "3";
}
else{
Toast.makeText(getApplicationContext(),"3", Toast.LENGTH_SHORT).show();
fertilizerType = "4";
}
area.setEnabled(true);
// Releases model resources if no longer used.
model.close();
} catch (IOException e) {
// TODO Handle the exception
}
}
@Override
protected void onActivityResult(int requestCode, int resultCode, @Nullable Intent data) {
if(resultCode == RESULT_OK){
if(requestCode == 3){
Bitmap image = (Bitmap) data.getExtras().get("data");
int dimension = Math.min(image.getWidth(), image.getHeight());
image = ThumbnailUtils.extractThumbnail(image, dimension, dimension);
imageView.setImageBitmap(image);
image = Bitmap.createScaledBitmap(image, imageSize, imageSize, false);
classifyImage(image);
}else{
Uri dat = data.getData();
Bitmap image = null;
try {
image = MediaStore.Images.Media.getBitmap(this.getContentResolver(), dat);
} catch (IOException e) {
e.printStackTrace();
}
imageView.setImageBitmap(image);
image = Bitmap.createScaledBitmap(image, imageSize, imageSize, false);
classifyImage(image);
}
}
super.onActivityResult(requestCode, resultCode, data);
}
}
\ No newline at end of file
package com.example.eketha;
import androidx.appcompat.app.AppCompatActivity;
import android.os.Bundle;
import android.widget.TextView;
public class FertilizerGuidence extends AppCompatActivity {
TextView area,feild_01,feild_02,feild_03,feild_04,fType,pArea;
private String areaResult,fertilizerType;
private int fertilizerTypeInt,areaResultInt,areaResultIntFinal;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_fertilizer_guidence);
areaResult = getIntent().getStringExtra("areaResult");
// areaResult = getIntent().getStringExtra("areaResultC");
fertilizerType = getIntent().getStringExtra("fertilizerType");
fType = findViewById(R.id.fType);
pArea = findViewById(R.id.pArea);
//table
feild_01 = findViewById(R.id.feild_01);
feild_02 = findViewById(R.id.feild_02);
feild_03 = findViewById(R.id.feild_03);
feild_04 = findViewById(R.id.feild_04);
fertilizerTypeInt = Integer.valueOf(fertilizerType);
areaResultInt = Integer.valueOf(areaResult);
if(areaResultInt == 0){
areaResultInt = 1;
}
if (fertilizerTypeInt == 1) {
int week3 = areaResultInt * 25;
String week3s = Integer.toString(week3);
int week4 = areaResultInt * 35;
String week4s = Integer.toString(week4);
feild_01.setText("");
feild_02.setText("");
feild_03.setText(week3s);
feild_04.setText(week4s);
}
else if (fertilizerTypeInt == 2) {
int week1 = areaResultInt * 55;
String week1s = Integer.toString(week1);
feild_01.setText(week1s);
feild_02.setText("");
feild_03.setText("");
feild_04.setText("");
}
else if (fertilizerTypeInt == 3) {
int week2 = areaResultInt * 50;
String week2s = Integer.toString(week2);
int week3 = areaResultInt * 75;
String week3s = Integer.toString(week3);
int week4 = areaResultInt * 65;
String week4s = Integer.toString(week4);
feild_01.setText("");
feild_02.setText(week2s);
feild_03.setText(week3s);
feild_04.setText(week4s);
}
else if (fertilizerTypeInt == 4){
int week1 = areaResultInt * 5;
String week1s = Integer.toString(week1);
feild_01.setText(week1s);
feild_02.setText("");
feild_03.setText("");
feild_04.setText("");
}
// TableView tableView = findViewById(R.id.table_data_view);
//
// String[] header = {"1","2","3","4"};
// String[][] data = {{"aa","aa","aa","aa"},{"aa","aa","aa","aa"}};
//
// tableView.setHeaderAdapter(new SimpleTableHeaderAdapter(this,header));
// tableView.setDataAdapter(new SimpleTableDataAdapter(this,data));
// area = findViewById(R.id.area);
// area.setText(fertilizerType);
}
}
\ No newline at end of file
......@@ -52,15 +52,6 @@ import java.util.Date;
import java.util.List;
import java.util.Map;
import okhttp3.MediaType;
import okhttp3.MultipartBody;
import okhttp3.RequestBody;
import retrofit2.Call;
import retrofit2.Callback;
import retrofit2.Response;
import retrofit2.Retrofit;
import static android.os.Environment.getExternalStoragePublicDirectory;
public class Growth extends AppCompatActivity {
......@@ -170,7 +161,7 @@ public class Growth extends AppCompatActivity {
details="Rice";
System.out.println(result);
} else if(result.equals("Weed")){
details=getResources().getString(R.string.detail1);
details=getResources().getString(R.string.treatment1);
System.out.println(result);
}
BitmapDrawable drawable = (BitmapDrawable) imageView.getDrawable();
......
......@@ -13,6 +13,8 @@ import android.util.Base64;
import android.view.View;
import android.widget.Button;
import android.widget.ImageView;
import android.widget.TextView;
import android.widget.Toast;
import com.chaquo.python.PyObject;
import com.chaquo.python.Python;
......@@ -21,6 +23,9 @@ import com.chaquo.python.android.AndroidPlatform;
import java.io.ByteArrayOutputStream;
import java.io.FileInputStream;
import java.io.FileOutputStream;
import java.lang.reflect.Array;
import java.text.DecimalFormat;
import java.util.ArrayList;
public class GrowthHeight extends AppCompatActivity {
......@@ -30,6 +35,9 @@ public class GrowthHeight extends AppCompatActivity {
private ImageView imageView1;
private BitmapDrawable drawable;
private String imageString;
private String value;
private TextView textView;
private static final DecimalFormat df = new DecimalFormat("0.00");
@Override
protected void onCreate(Bundle savedInstanceState) {
......@@ -39,6 +47,7 @@ public class GrowthHeight extends AppCompatActivity {
imageView1 = findViewById(R.id.imageHeightView);
btnHeight = findViewById(R.id.button3);
btnThreatment = findViewById(R.id.button2);
textView = findViewById(R.id.resulttextRice);
if (! Python.isStarted()) {
Python.start(new AndroidPlatform(this));
......@@ -71,7 +80,7 @@ public class GrowthHeight extends AppCompatActivity {
//Pop intent
Intent intent = new Intent(GrowthHeight.this, GrowthThreatment.class);
intent.putExtra("results", value);
intent.putExtra("image", filename);
startActivity(intent);
} catch (Exception e) {
......@@ -128,12 +137,31 @@ public class GrowthHeight extends AppCompatActivity {
PyObject pyo = py.getModule("height");
PyObject obj = pyo.callAttr("main", imageString);
PyObject pyo1 = py.getModule("measurement");
PyObject obj1= pyo1.callAttr("main", imageString);
//System.out.println("-----------------------------------");
System.out.println(obj);
System.out.println(obj1);
// ArrayList<PyObject> arrayList = new ArrayList<PyObject>();
// System.out.println("-----------------------------------");
// arrayList.add(obj);
// System.out.println(arrayList);
String str = obj.toString();
Double str1 =Double.parseDouble(obj1.toString());
//System.out.println("-----------------------------------");
//System.out.println(obj);
//System.out.println(str);
//System.out.println("33333333333333333333333333333333333 ");
if(str.equals("abc")){
Toast.makeText(this, "Please upload quality image", Toast.LENGTH_SHORT).show();
// Intent intent = new Intent(GrowthHeight.this, growthHome.class);
// startActivity(intent);
}else{
byte data[] = Base64.decode(str, Base64.DEFAULT);
Bitmap bmp = BitmapFactory.decodeByteArray(data, 0, data.length);
outputImage = bmp;
value = df.format(str1);
textView.setText("Height is: "+ df.format(str1) + "cm");
}
}
}
\ No newline at end of file
......@@ -6,18 +6,25 @@ import android.graphics.Bitmap;
import android.graphics.BitmapFactory;
import android.os.Bundle;
import android.widget.ImageView;
import android.widget.TextView;
import java.io.FileInputStream;
public class GrowthThreatment extends AppCompatActivity {
private Bitmap inputImage;
private ImageView imageView1;
private TextView textView,textView1;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_growth_threatment);
imageView1 = findViewById(R.id.treatImg);
textView = findViewById(R.id.treatText4Rice);
textView1 = findViewById(R.id.treatText5Rice);
String result = getIntent().getStringExtra("results");
textView.setText(result);
String filename = getIntent().getStringExtra("image");
try {
......@@ -28,5 +35,33 @@ public class GrowthThreatment extends AppCompatActivity {
} catch (Exception e) {
e.printStackTrace();
}
System.out.println(result);
Double df = Double.parseDouble(textView.getText().toString());
String details="";
if(df>=10 || df<20){
details=getResources().getString(R.string.treatment1);
textView1.setText(details);
}else if(df>=10 || df<30){
details=getResources().getString(R.string.treatment2);
textView1.setText(details);
}else if(df>=30 || df<50){
details=getResources().getString(R.string.treatment3);
textView1.setText(details);
}else if(df>=50 || df<70){
details=getResources().getString(R.string.treatment4);
textView1.setText(details);
}else if(df>=70 || df<90){
details=getResources().getString(R.string.treatment5);
textView1.setText(details);
}else if(df>=90 || df<=100){
details=getResources().getString(R.string.treatment6);
textView1.setText(details);
}
}
}
\ No newline at end of file
package com.example.eketha;
import android.app.Activity;
import android.app.AlertDialog;
import android.view.LayoutInflater;
public class LoadingClass {
private Activity activity;
private AlertDialog dialog;
public LoadingClass(Activity myActivity){
activity = myActivity;
}
public void startLoadingDialog(){
AlertDialog.Builder builder = new AlertDialog.Builder(activity);
LayoutInflater inflater = activity.getLayoutInflater();
builder.setView(inflater.inflate(R.layout.custom_loading_bar,null));
// builder.setCancelable(true);
dialog = builder.create();
dialog.show();
}
public void dismissDialog(){
dialog.dismiss();
}
}
......@@ -51,13 +51,13 @@ public class MainActivity extends AppCompatActivity {
// }
// });
//
// cardView3.setOnClickListener(new View.OnClickListener() {
// @Override
// public void onClick(View view) {
// Intent intent = new Intent(getApplicationContext(),fertilizerHome.class);
// startActivity(intent);
// }
// });
cardView3.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
Intent intent = new Intent(getApplicationContext(),fertilizerHome.class);
startActivity(intent);
}
});
cardView4.setOnClickListener(new View.OnClickListener() {
@Override
......
package com.example.eketha.PaddyArea;
import androidx.appcompat.app.AppCompatActivity;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;
import com.example.eketha.R;
public class PaddyAreaHome extends AppCompatActivity {
Button bt1,bt2,bt3;
private String fertilizerType;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_paddy_area_home);
// bt1 = findViewById(R.id.bt_1);
bt2 = findViewById(R.id.bt_2);
bt3 = findViewById(R.id.bt_3);
fertilizerType = getIntent().getStringExtra("fertilizerType");
bt2.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
Intent intent = new Intent(PaddyAreaHome.this,PaddyAreaView_01.class);
intent.putExtra("fertilizerType",fertilizerType);
startActivity(intent);
}
});
bt3.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
Intent intent = new Intent(PaddyAreaHome.this,PaddyAreaText.class);
intent.putExtra("fertilizerType",fertilizerType);
startActivity(intent);
}
});
}
}
\ No newline at end of file
package com.example.eketha.PaddyArea;
import androidx.appcompat.app.AppCompatActivity;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;
import android.widget.TextView;
import com.example.eketha.FertilizerGuidence;
import com.example.eketha.R;
public class PaddyAreaResult extends AppCompatActivity {
Button btLocation,nxt1,navigateFertiGuidence;
TextView area,d1,d2;
private String distance1,lon4,lat4,lon3,lat3;
private int distance;
private double lol,loll,lol1,loll1;
private String fertilizerType;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_paddy_area_result);
distance1 = getIntent().getStringExtra("distance1");
lat3 = getIntent().getStringExtra("lat3");
lon3 = getIntent().getStringExtra("lon3");
lat4 = getIntent().getStringExtra("lat4");
lon4 = getIntent().getStringExtra("lon4");
fertilizerType = getIntent().getStringExtra("fertilizerType");
navigateFertiGuidence = findViewById(R.id.navigateFertiGuidence);
area = findViewById(R.id.area);
// d1 = findViewById(R.id.d1);
// d2 = findViewById(R.id.d2);
// d1.setText(distance1);
int x = Integer.valueOf(distance1);
lol = Double.valueOf(lat3);
loll = Double.valueOf(lon3);
lol1 = Double.valueOf(lat4);
loll1 = Double.valueOf(lon4);
distance = calculateDistanceInKilometer(lol,loll,lol1,loll1);
// distance = calculateDistanceInKilometer(6.713408110319169,79.91602709961393,6.713184955531217,79.91592511089544);
int a = distance * x;
int hect = a / 10000;
// d2.setText(String.valueOf(distance));
area.setText(String.valueOf(a) + "m");
navigateFertiGuidence.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
Intent intent = new Intent(PaddyAreaResult.this, FertilizerGuidence.class);
intent.putExtra("fertilizerType",fertilizerType);
intent.putExtra("areaResult",String.valueOf(hect));
startActivity(intent);
}
});
}
public final static double AVERAGE_RADIUS_OF_EARTH_KM = 6371;
public int calculateDistanceInKilometer(double userLat, double userLng,
double venueLat, double venueLng) {
double latDistance = Math.toRadians(userLat - venueLat);
double lngDistance = Math.toRadians(userLng - venueLng);
double a = Math.sin(latDistance / 2) * Math.sin(latDistance / 2)
+ Math.cos(Math.toRadians(userLat)) * Math.cos(Math.toRadians(venueLat))
* Math.sin(lngDistance / 2) * Math.sin(lngDistance / 2);
double c = 2 * Math.atan2(Math.sqrt(a), Math.sqrt(1 - a));
double r = (AVERAGE_RADIUS_OF_EARTH_KM * c) * 1000;
int x = (int) r * 1;
return x;
}
}
\ No newline at end of file
package com.example.eketha.PaddyArea;
import androidx.appcompat.app.AppCompatActivity;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;
import android.widget.EditText;
import android.widget.Toast;
import com.example.eketha.FertilizerGuidence;
import com.example.eketha.R;
public class PaddyAreaText extends AppCompatActivity {
EditText paddyValue;
Button addPaddyValue,navigateFertiGuidence;
private String fertilizerType;
private String areaResult;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_paddy_area_text);
paddyValue = findViewById(R.id.paddyValue);
addPaddyValue = findViewById(R.id.addPaddyValue);
navigateFertiGuidence = findViewById(R.id.navigateFertiGuidence);
fertilizerType = getIntent().getStringExtra("fertilizerType");
navigateFertiGuidence.setEnabled(false);
addPaddyValue.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
Toast.makeText(getApplicationContext(),paddyValue.getText(), Toast.LENGTH_SHORT).show();
areaResult = paddyValue.getText().toString();
navigateFertiGuidence.setEnabled(true);
}
});
navigateFertiGuidence.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
Intent intent = new Intent(PaddyAreaText.this, FertilizerGuidence.class);
intent.putExtra("fertilizerType",fertilizerType);
intent.putExtra("areaResult",areaResult);
startActivity(intent);
}
});
}
}
\ No newline at end of file
package com.example.eketha.PaddyArea;
import androidx.annotation.NonNull;
import androidx.appcompat.app.AppCompatActivity;
import androidx.core.app.ActivityCompat;
import androidx.core.content.ContextCompat;
import android.Manifest;
import android.annotation.SuppressLint;
import android.content.Intent;
import android.content.pm.PackageManager;
import android.location.Location;
import android.location.LocationListener;
import android.location.LocationManager;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;
import android.widget.TextView;
import com.example.eketha.LoadingClass;
import com.example.eketha.R;
import com.google.android.gms.location.FusedLocationProviderClient;
import java.util.List;
import java.util.Timer;
import java.util.TimerTask;
public class PaddyAreaView_01 extends AppCompatActivity implements LocationListener {
Button btLocation,n;
TextView tvLatitude,tvLongitude;
FusedLocationProviderClient fusedLocationProviderClient;
LocationManager locationManager;
private String l,ll;
private String fertilizerType;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_paddy_area_view01);
btLocation = findViewById(R.id.bt_location);
n = findViewById(R.id.bt_location1);
fertilizerType = getIntent().getStringExtra("fertilizerType");
n.setEnabled(false);
final LoadingClass loadingClass = new LoadingClass(PaddyAreaView_01.this);
//Runtime permissions
if (ContextCompat.checkSelfPermission(PaddyAreaView_01.this, Manifest.permission.ACCESS_FINE_LOCATION)
!= PackageManager.PERMISSION_GRANTED){
ActivityCompat.requestPermissions(PaddyAreaView_01.this,new String[]{
Manifest.permission.ACCESS_FINE_LOCATION
},100);
}
btLocation.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
//create method
getLocation();
loadingClass.startLoadingDialog();
new Timer().schedule(new TimerTask() {
@Override
public void run() {
// this code will be executed after 2 seconds
loadingClass.dismissDialog();
}
}, 25000);
}
});
n.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
lol();
}
});
}
@SuppressLint("MissingPermission")
private void getLocation() {
try {
locationManager = (LocationManager) getApplicationContext().getSystemService(LOCATION_SERVICE);
locationManager.requestLocationUpdates(LocationManager.GPS_PROVIDER,5000,5,this::onLocationChanged);
}catch (Exception e){
e.printStackTrace();
}
}
@Override
public void onLocationChanged(@NonNull Location location) {
l = String.valueOf(location.getLongitude());
ll = String.valueOf(location.getLatitude());
n.setEnabled(true);
}
public void lol(){
Intent intent = new Intent(PaddyAreaView_01.this,PaddyAreaView_02.class);
intent.putExtra("lat",l);
intent.putExtra("lon",ll);
intent.putExtra("fertilizerType",fertilizerType);
startActivity(intent);
}
// @Override
// public void onLocationChanged(@NonNull List<Location> locations) {
// LocationListener.super.onLocationChanged(locations);
// }
// @Override
// public void onFlushComplete(int requestCode) {
// LocationListener.super.onFlushComplete(requestCode);
// }
//
// @Override
// public void onStatusChanged(String provider, int status, Bundle extras) {
// LocationListener.super.onStatusChanged(provider, status, extras);
// }
//
// @Override
// public void onProviderEnabled(@NonNull String provider) {
// LocationListener.super.onProviderEnabled(provider);
// }
//
// @Override
// public void onProviderDisabled(@NonNull String provider) {
// LocationListener.super.onProviderDisabled(provider);
// }
}
\ No newline at end of file
package com.example.eketha.PaddyArea;
import androidx.annotation.NonNull;
import androidx.appcompat.app.AppCompatActivity;
import androidx.core.app.ActivityCompat;
import androidx.core.content.ContextCompat;
import android.Manifest;
import android.annotation.SuppressLint;
import android.content.Intent;
import android.content.pm.PackageManager;
import android.location.Location;
import android.location.LocationManager;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;
import android.widget.TextView;
import com.example.eketha.LoadingClass;
import com.example.eketha.R;
import com.google.android.gms.location.FusedLocationProviderClient;
import com.google.android.gms.location.LocationListener;
import java.util.Timer;
import java.util.TimerTask;
public class PaddyAreaView_02 extends AppCompatActivity implements LocationListener {
Button btLocation,nxt1;
TextView tvLatitude,tvLongitude,lt,lg,ff;
FusedLocationProviderClient fusedLocationProviderClient2;
private String lon,lat,l,ll;
private boolean t;
private int distance;
private double lon2,lat2,lol,loll;
LocationManager locationManager;
private String fertilizerType;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_paddy_area_view02);
btLocation = findViewById(R.id.bt_location2);
nxt1 = findViewById(R.id.nxt1);
fertilizerType = getIntent().getStringExtra("fertilizerType");
nxt1.setEnabled(false);
final LoadingClass loadingClass = new LoadingClass(PaddyAreaView_02.this);
// tvLatitude = findViewById(R.id.tv_latitude2);
// tvLongitude = findViewById(R.id.tv_longitude2);
// lt = findViewById(R.id.tv_lt);
// lg = findViewById(R.id.tv_lg);
// ff = findViewById(R.id.ff);
lat = getIntent().getStringExtra("lat");
lon = getIntent().getStringExtra("lon");
// tvLatitude.setText(lat);
// tvLongitude.setText(lon);
//Runtime permissions
if (ContextCompat.checkSelfPermission(PaddyAreaView_02.this, Manifest.permission.ACCESS_FINE_LOCATION)
!= PackageManager.PERMISSION_GRANTED){
ActivityCompat.requestPermissions(PaddyAreaView_02.this,new String[]{
Manifest.permission.ACCESS_FINE_LOCATION
},100);
}
btLocation.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
//create method
getLocation();
loadingClass.startLoadingDialog();
new Timer().schedule(new TimerTask() {
@Override
public void run() {
// this code will be executed after 2 seconds
loadingClass.dismissDialog();
}
}, 25000);
}
});
nxt1.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
chg();
}
});
}
@SuppressLint("MissingPermission")
private void getLocation() {
try {
locationManager = (LocationManager) getApplicationContext().getSystemService(LOCATION_SERVICE);
locationManager.requestLocationUpdates(LocationManager.GPS_PROVIDER,5000,5,this::onLocationChanged);
}catch (Exception e){
e.printStackTrace();
}
}
@Override
public void onLocationChanged(@NonNull Location location) {
// lt.setText(String.valueOf(location.getLatitude()));
// lg.setText(String.valueOf(location.getLongitude()));
l = String.valueOf(location.getLongitude());
ll = String.valueOf(location.getLatitude());
nxt1.setEnabled(true);
}
private void chg() {
Intent intent = new Intent(PaddyAreaView_02.this,PaddyAreaView_03.class);
intent.putExtra("lat1",lat);
intent.putExtra("lon1",lon);
intent.putExtra("lat2",ll);
intent.putExtra("lon2",l);
intent.putExtra("fertilizerType",fertilizerType);
startActivity(intent);
}
public final static double AVERAGE_RADIUS_OF_EARTH_KM = 6371;
public int calculateDistanceInKilometer(double userLat, double userLng,
double venueLat, double venueLng) {
double latDistance = Math.toRadians(userLat - venueLat);
double lngDistance = Math.toRadians(userLng - venueLng);
double a = Math.sin(latDistance / 2) * Math.sin(latDistance / 2)
+ Math.cos(Math.toRadians(userLat)) * Math.cos(Math.toRadians(venueLat))
* Math.sin(lngDistance / 2) * Math.sin(lngDistance / 2);
double c = 2 * Math.atan2(Math.sqrt(a), Math.sqrt(1 - a));
double r = (AVERAGE_RADIUS_OF_EARTH_KM * c) * 1000;
int x = (int) r * 1;
return x;
}
}
\ No newline at end of file
package com.example.eketha.PaddyArea;
import androidx.annotation.NonNull;
import androidx.appcompat.app.AppCompatActivity;
import androidx.core.app.ActivityCompat;
import androidx.core.content.ContextCompat;
import android.Manifest;
import android.annotation.SuppressLint;
import android.content.Intent;
import android.content.pm.PackageManager;
import android.location.Location;
import android.location.LocationManager;
import android.os.Bundle;
import android.util.Log;
import android.view.View;
import android.widget.Button;
import android.widget.TextView;
import com.example.eketha.LoadingClass;
import com.example.eketha.R;
import com.google.android.gms.location.LocationListener;
import java.util.Timer;
import java.util.TimerTask;
public class PaddyAreaView_03 extends AppCompatActivity implements LocationListener {
Button btLocation,nxt1,nxt2;
TextView tv_latitude2,tv_longitude2,tv_lt,tv_lg,tv_lt1,tv_lg1,ff;
private String lon1,lat1,lon2,lat2,lon3,lat3,p;
LocationManager locationManager;
private int distance;
private double lol,loll,lol1,loll1;
private String fertilizerType;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_paddy_area_view03);
lat1 = getIntent().getStringExtra("lat1");
lon1 = getIntent().getStringExtra("lon1");
lat2 = getIntent().getStringExtra("lat2");
lon2 = getIntent().getStringExtra("lon2");
fertilizerType = getIntent().getStringExtra("fertilizerType");
lol = Double.valueOf(lat1);
loll = Double.valueOf(lon1);
lol1 = Double.valueOf(lat2);
loll1 = Double.valueOf(lon2);
Log.i("gg",lat1);
Log.i("gg",lon1);
Log.i("gg",lat2);
Log.i("gg",lon2);
btLocation = findViewById(R.id.bt_location3);
nxt1 = findViewById(R.id.nxt1);
ff = findViewById(R.id.ff);
nxt2 = findViewById(R.id.nxt2);
// tv_lt1 = findViewById(R.id.tv_lt1);
// tv_lg1 = findViewById(R.id.tv_lg1);
nxt2.setEnabled(false);
final LoadingClass loadingClass = new LoadingClass(PaddyAreaView_03.this);
//Runtime permissions
if (ContextCompat.checkSelfPermission(PaddyAreaView_03.this, Manifest.permission.ACCESS_FINE_LOCATION)
!= PackageManager.PERMISSION_GRANTED){
ActivityCompat.requestPermissions(PaddyAreaView_03.this,new String[]{
Manifest.permission.ACCESS_FINE_LOCATION
},100);
}
btLocation.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
//create method
getLocation();
loadingClass.startLoadingDialog();
new Timer().schedule(new TimerTask() {
@Override
public void run() {
// this code will be executed after 2 seconds
loadingClass.dismissDialog();
}
}, 25000);
}
});
nxt1.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
chg();
}
});
nxt2.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
naviagte();
}
});
}
private void naviagte() {
Intent intent = new Intent(PaddyAreaView_03.this,PaddyAreaView_04.class);
intent.putExtra("distance1",String.valueOf(distance));
intent.putExtra("lat3",lat3);
intent.putExtra("lon3",lon3);
intent.putExtra("fertilizerType",fertilizerType);
startActivity(intent);
}
@SuppressLint("MissingPermission")
private void getLocation() {
try {
locationManager = (LocationManager) getApplicationContext().getSystemService(LOCATION_SERVICE);
locationManager.requestLocationUpdates(LocationManager.GPS_PROVIDER,5000,5,this::onLocationChanged);
}catch (Exception e){
e.printStackTrace();
}
}
@Override
public void onLocationChanged(@NonNull Location location) {
// tv_lt1.setText(String.valueOf(location.getLatitude()));
// tv_lg1.setText(String.valueOf(location.getLongitude()));
lon3 = String.valueOf(location.getLongitude());
lat3 = String.valueOf(location.getLatitude());
nxt2.setEnabled(true);
}
private void chg() {
distance = calculateDistanceInKilometer(loll,lol,lol1,loll1);
// distance = calculateDistanceInKilometer(6.927079,79.861244,6.7132734,79.9160491);
// distance = calculateDistanceInKilometer(6.713408110319169,79.91602709961393,6.713184955531217,79.91592511089544);
ff.setText(String.valueOf(distance));
}
public final static double AVERAGE_RADIUS_OF_EARTH_KM = 6371;
public int calculateDistanceInKilometer(double userLat, double userLng,
double venueLat, double venueLng) {
double latDistance = Math.toRadians(userLat - venueLat);
double lngDistance = Math.toRadians(userLng - venueLng);
double a = Math.sin(latDistance / 2) * Math.sin(latDistance / 2)
+ Math.cos(Math.toRadians(userLat)) * Math.cos(Math.toRadians(venueLat))
* Math.sin(lngDistance / 2) * Math.sin(lngDistance / 2);
double c = 2 * Math.atan2(Math.sqrt(a), Math.sqrt(1 - a));
double r = (AVERAGE_RADIUS_OF_EARTH_KM * c) * 1000;
int x = (int) r * 1;
return x;
}
private static double toRad(double value) {
return value * Math.PI / 180;
}
}
\ No newline at end of file
package com.example.eketha.PaddyArea;
import androidx.annotation.NonNull;
import androidx.appcompat.app.AppCompatActivity;
import androidx.core.app.ActivityCompat;
import androidx.core.content.ContextCompat;
import android.Manifest;
import android.annotation.SuppressLint;
import android.content.Intent;
import android.content.pm.PackageManager;
import android.location.Location;
import android.location.LocationManager;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;
import android.widget.TextView;
import com.example.eketha.LoadingClass;
import com.example.eketha.R;
import com.google.android.gms.location.LocationListener;
import java.util.Timer;
import java.util.TimerTask;
public class PaddyAreaView_04 extends AppCompatActivity implements LocationListener {
Button btLocation,nxt1;
TextView tv_lt1,tv_lg1,tv_lt2,tv_lg2,d1,d2;
private String dstance1,lon3,lat3,lon4,lat4;
LocationManager locationManager;
private String fertilizerType;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_paddy_area_view04);
dstance1 = getIntent().getStringExtra("distance1");
lat3 = getIntent().getStringExtra("lat3");
lon3 = getIntent().getStringExtra("lon3");
fertilizerType = getIntent().getStringExtra("fertilizerType");
btLocation = findViewById(R.id.bt_location3);
nxt1 = findViewById(R.id.nxt1);
// tv_lt1 = findViewById(R.id.tv_lt1);
// tv_lg1 = findViewById(R.id.tv_lg1);
// d1 = findViewById(R.id.distance1);
// tv_lt2 = findViewById(R.id.tv_lt2);
// tv_lg2 = findViewById(R.id.tv_lg2);
// tv_lt1.setText(lat3);
// tv_lg1.setText(lon3);
// d1.setText(dstance1);
nxt1.setEnabled(false);
final LoadingClass loadingClass = new LoadingClass(PaddyAreaView_04.this);
//Runtime permissions
if (ContextCompat.checkSelfPermission(PaddyAreaView_04.this, Manifest.permission.ACCESS_FINE_LOCATION)
!= PackageManager.PERMISSION_GRANTED){
ActivityCompat.requestPermissions(PaddyAreaView_04.this,new String[]{
Manifest.permission.ACCESS_FINE_LOCATION
},100);
}
btLocation.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
getLocation();
loadingClass.startLoadingDialog();
new Timer().schedule(new TimerTask() {
@Override
public void run() {
// this code will be executed after 2 seconds
loadingClass.dismissDialog();
}
}, 25000);
}
});
nxt1.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
navigate();
}
});
}
private void navigate() {
Intent intent = new Intent(PaddyAreaView_04.this,PaddyAreaResult.class);
intent.putExtra("distance1",dstance1);
intent.putExtra("lat3",lat3);
intent.putExtra("lon3",lon3);
intent.putExtra("lat4",lat4);
intent.putExtra("lon4",lon4);
intent.putExtra("fertilizerType",fertilizerType);
startActivity(intent);
}
@Override
public void onLocationChanged(@NonNull Location location) {
// tv_lt2.setText(String.valueOf(location.getLatitude()));
// tv_lg2.setText(String.valueOf(location.getLongitude()));
lon4 = String.valueOf(location.getLongitude());
lat4 = String.valueOf(location.getLatitude());
nxt1.setEnabled(true);
}
@SuppressLint("MissingPermission")
private void getLocation() {
try {
locationManager = (LocationManager) getApplicationContext().getSystemService(LOCATION_SERVICE);
locationManager.requestLocationUpdates(LocationManager.GPS_PROVIDER,5000,5,this::onLocationChanged);
}catch (Exception e){
e.printStackTrace();
}
}
}
\ No newline at end of file
package com.example.eketha;
import androidx.appcompat.app.AppCompatActivity;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.widget.LinearLayout;
import com.example.eketha.PaddyArea.PaddyAreaHome;
public class fertilizerHome extends AppCompatActivity {
private LinearLayout layer1, layer2;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_fertilizer_home);
layer1 = findViewById(R.id.layer2);
layer2 = findViewById(R.id.layer3);
layer1.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
Intent intent = new Intent(getApplicationContext(),Fertilizer.class);
startActivity(intent);
}
});
layer2.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
Intent intent = new Intent(getApplicationContext(), PaddyAreaHome.class);
startActivity(intent);
}
});
}
}
\ No newline at end of file
from scipy.spatial.distance import euclidean
from imutils import perspective
from imutils import contours
import argparse
import numpy as np
import imutils
import cv2
import base64
import io
from PIL import Image
import os
def show_images(images):
for i, img in enumerate(images):
cv2.imshow("image_" + str(i), img)
def main(data):
#decode the image
decoded_data = base64.b64decode(data)
np_data = np.fromstring(decoded_data, np.uint8)
in_img = cv2.imdecode(np_data, cv2.IMREAD_UNCHANGED)
out_img = in_img.copy()
if len(out_img.shape) < 3:
out_img.resize(*out_img.shape,1)
gray = cv2.cvtColor(out_img, cv2.COLOR_BGR2GRAY)
blur = cv2.GaussianBlur(gray, (9, 9), 0)
edged = cv2.Canny(blur, 50, 100)
edged = cv2.dilate(edged, None, iterations=1)
edged = cv2.erode(edged, None, iterations=1)
cnts = cv2.findContours(edged.copy(), cv2.RETR_EXTERNAL, cv2.CHAIN_APPROX_SIMPLE)
cnts = imutils.grab_contours(cnts)
(cnts, _) = contours.sort_contours(cnts)
cnts = [x for x in cnts if cv2.contourArea(x) >2000]
if len(cnts)>0 :
ref_object = cnts[0]
box = cv2.minAreaRect(ref_object)
box = cv2.boxPoints(box)
box = np.array(box, dtype="int")
box = perspective.order_points(box)
(tl, tr, br, bl) = box
dist_in_pixel = euclidean(tl, tr)
dist_in_cm =10
pixel_per_cm = dist_in_pixel/dist_in_cm
for cnt in cnts:
box = cv2.minAreaRect(cnt)
box = cv2.boxPoints(box)
box = np.array(box, dtype="int")
box = perspective.order_points(box)
(tl, tr, br, bl) = box
cv2.drawContours(out_img, [box.astype("int")], -1, (0, 0, 255), 2)
mid_pt_horizontal = (tl[0] + int(abs(tr[0] - tl[0])/2), tl[1] + int(abs(tr[1] - tl[1])/2))
mid_pt_verticle = (tr[0] + int(abs(tr[0] - br[0])/2), tr[1] + int(abs(tr[1] - br[1])/2))
wid = euclidean(tl, tr)/pixel_per_cm
ht = euclidean(tr, br)/pixel_per_cm
cv2.putText(out_img, "{:.1f}cm".format(ht), (int(mid_pt_verticle[0] + 10), int(mid_pt_verticle[1])),
cv2.FONT_HERSHEY_SIMPLEX, 0.5, (0, 0, 5), 2)
return ""+str(ht)
else :
return "abc"
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context=".Fertilizer">
<Button
android:id="@+id/button3"
android:layout_width="300dp"
android:layout_height="wrap_content"
android:layout_alignParentStart="true"
android:layout_alignParentEnd="true"
android:layout_alignParentBottom="true"
android:layout_centerVertical="true"
android:layout_marginStart="50dp"
android:layout_marginTop="20dp"
android:layout_marginEnd="50dp"
android:layout_marginBottom="14dp"
android:background="@drawable/round_bg"
android:text="Area"
android:textAllCaps="false"
android:textSize="21sp"
android:textStyle="bold" />
<Button
android:id="@+id/button"
android:layout_width="300dp"
android:layout_height="wrap_content"
android:layout_above="@+id/button2"
android:layout_alignParentStart="true"
android:layout_alignParentEnd="true"
android:layout_marginStart="50dp"
android:layout_marginEnd="50dp"
android:background="@drawable/round_bg"
android:text="Take Picture"
android:textAllCaps="false"
android:textSize="21sp"
android:textStyle="bold" />
<Button
android:id="@+id/button2"
android:layout_width="300dp"
android:layout_height="wrap_content"
android:layout_alignParentStart="true"
android:layout_alignParentEnd="true"
android:layout_alignParentBottom="true"
android:layout_centerVertical="true"
android:layout_marginStart="50dp"
android:layout_marginTop="3dp"
android:layout_marginEnd="50dp"
android:layout_marginBottom="65dp"
android:background="@drawable/round_bg"
android:text="Launch Gallery"
android:textAllCaps="false"
android:textSize="21sp"
android:textStyle="bold" />
<ImageView
android:layout_width="370sp"
android:layout_height="370sp"
android:layout_centerHorizontal="true"
android:id="@+id/imageView"
android:layout_marginTop="10sp"
/>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerHorizontal="true"
android:text="Classified as:"
android:textStyle="bold"
android:textSize="20sp"
android:id="@+id/classified"
android:layout_below="@+id/imageView"
android:layout_marginTop="10sp"
/>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerHorizontal="true"
android:text=""
android:textColor="#C30000"
android:textStyle="bold"
android:textSize="27sp"
android:id="@+id/result"
android:layout_below="@+id/classified"
/>
</RelativeLayout>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
android:padding="16dp"
android:gravity="center"
android:background="@drawable/back"
tools:context=".FertilizerGuidence">
<!-- <de.codecrafters.tableview.TableView-->
<!-- android:layout_width="match_parent"-->
<!-- android:layout_height="match_parent"-->
<!-- android:id="@+id/table_data_view"-->
<!-- app:tableView_columnCount="4"/>-->
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="2dp"
android:text="Recommended Fertilizer Dosage"
android:textColor="@color/black"
android:textSize="20sp"
android:textStyle="bold" />
<TableLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@android:color/white"
android:layout_margin="20dp">
<!-- Table Heading -->
<TableRow
android:background="@color/cardview_dark_background">
<TextView
android:layout_width="0dp"
android:layout_height="wrap_content"
android:text="Age Group"
android:textColor="@android:color/white"
android:padding="10sp"
android:textSize="14sp"
android:layout_weight="3"
android:gravity="center_horizontal"
/>
<TextView
android:layout_width="0dp"
android:layout_height="wrap_content"
android:text="Time"
android:textColor="@android:color/white"
android:padding="10sp"
android:textSize="14sp"
android:layout_weight="4"
android:gravity="center_horizontal"
/>
<TextView
android:layout_width="0dp"
android:layout_height="wrap_content"
android:text="Dose Kg"
android:textColor="@android:color/white"
android:padding="10sp"
android:textSize="14sp"
android:layout_weight="2"
android:gravity="center_horizontal"
/>
</TableRow>
<!-- Table Data -->
<TableRow>
<TextView
android:layout_width="0dp"
android:layout_height="wrap_content"
android:text="For 3 months"
android:padding="10sp"
android:textSize="12sp"
android:layout_weight="3"
android:gravity="center_horizontal"
/>
<TextView
android:layout_width="0dp"
android:layout_height="wrap_content"
android:text="Basic"
android:padding="10sp"
android:textSize="12sp"
android:layout_weight="4"
android:gravity="center_horizontal"
/>
<TextView
android:layout_width="0dp"
android:layout_height="wrap_content"
android:text=""
android:padding="10sp"
android:textSize="12sp"
android:layout_weight="2"
android:gravity="center_horizontal"
android:id="@+id/feild_01"
/>
</TableRow>
<TableRow>
<TextView
android:layout_width="0dp"
android:layout_height="wrap_content"
android:text=" "
android:padding="10sp"
android:textSize="12sp"
android:layout_weight="3"
android:gravity="center_horizontal"
/>
<TextView
android:layout_width="0dp"
android:layout_height="wrap_content"
android:text="2nd week"
android:padding="10sp"
android:textSize="12sp"
android:layout_weight="4"
android:gravity="center_horizontal"
/>
<TextView
android:layout_width="0dp"
android:layout_height="wrap_content"
android:text=""
android:padding="10sp"
android:textSize="12sp"
android:layout_weight="2"
android:gravity="center_horizontal"
android:id="@+id/feild_02"
/>
</TableRow>
<TableRow>
<TextView
android:layout_width="0dp"
android:layout_height="wrap_content"
android:text=" "
android:padding="10sp"
android:textSize="12sp"
android:layout_weight="3"
android:gravity="center_horizontal"
/>
<TextView
android:layout_width="0dp"
android:layout_height="wrap_content"
android:text="4nd week"
android:padding="10sp"
android:textSize="12sp"
android:layout_weight="4"
android:gravity="center_horizontal"
/>
<TextView
android:layout_width="0dp"
android:layout_height="wrap_content"
android:text=""
android:padding="10sp"
android:textSize="12sp"
android:layout_weight="2"
android:gravity="center_horizontal"
android:id="@+id/feild_03"
/>
</TableRow>
<TableRow>
<TextView
android:layout_width="0dp"
android:layout_height="wrap_content"
android:text=" "
android:padding="10sp"
android:textSize="12sp"
android:layout_weight="3"
android:gravity="center_horizontal"
/>
<TextView
android:layout_width="0dp"
android:layout_height="wrap_content"
android:text="6th week"
android:padding="10sp"
android:textSize="12sp"
android:layout_weight="4"
android:gravity="center_horizontal"
/>
<TextView
android:layout_width="0dp"
android:layout_height="wrap_content"
android:text=""
android:padding="10sp"
android:textSize="12sp"
android:layout_weight="2"
android:gravity="center_horizontal"
android:id="@+id/feild_04"
/>
</TableRow>
</TableLayout>
<TextView
android:id="@+id/fType"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="16dp"
android:text=""
android:textAlignment="textStart"
android:textColor="@color/black"
android:textSize="20sp"
android:textStyle="bold" />
<TextView
android:id="@+id/pArea"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="16dp"
android:text=""
android:textAlignment="textStart"
android:textColor="@color/black"
android:textSize="20sp"
android:textStyle="bold" />
<!-- <TextView-->
<!-- android:layout_width="wrap_content"-->
<!-- android:layout_height="wrap_content"-->
<!-- android:layout_marginTop="16dp"-->
<!-- android:text="0"-->
<!-- android:id="@+id/d2"-->
<!-- android:textColor="@color/black"-->
<!-- android:textSize="20sp"-->
<!-- android:textStyle="bold" />-->
<!-- <TextView-->
<!-- android:layout_width="wrap_content"-->
<!-- android:layout_height="wrap_content"-->
<!-- android:layout_marginTop="16dp"-->
<!-- android:text="0"-->
<!-- android:id="@+id/area"-->
<!-- android:textColor="@color/black"-->
<!-- android:textSize="20sp"-->
<!-- android:textStyle="bold" />-->
</LinearLayout>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
tools:context=".fertilizerHome">
<LinearLayout
android:id="@+id/layer1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="vertical">
<ImageView
android:layout_width="150dp"
android:layout_height="150dp"
android:layout_marginLeft="120dp"
android:layout_marginTop="30dp"
app:srcCompat="@drawable/logo" />
<TextView
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:text="Fertilizer Home"
android:textColor="@color/black"
android:layout_marginTop="10dp"
android:layout_marginLeft="100dp"
android:textSize="30dp"/>
</LinearLayout>
<androidx.cardview.widget.CardView
android:layout_width="match_parent"
android:layout_height="173dp"
android:layout_marginRight="30dp"
app:cardCornerRadius="8dp"
android:layout_marginTop="30dp"
android:layout_marginLeft="30dp">
<LinearLayout
android:id="@+id/layer2"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
android:background="@color/black">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:layout_marginLeft="30dp"
android:layout_marginTop="20dp"
android:layout_marginRight="30dp">
<ImageView
android:layout_width="100dp"
android:layout_height="100dp"
android:layout_marginLeft="10dp"
android:layout_marginTop="10dp"
app:srcCompat="@drawable/logo" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textSize="24dp"
android:layout_marginLeft="20dp"
android:layout_marginTop="36dp"
android:textColor="@color/white"
android:text="Fertilizer Type"/>
</LinearLayout>
</LinearLayout>
</androidx.cardview.widget.CardView>
<androidx.cardview.widget.CardView
android:layout_width="match_parent"
android:layout_height="173dp"
android:layout_marginRight="30dp"
app:cardCornerRadius="8dp"
android:layout_marginTop="30dp"
android:layout_marginLeft="30dp">
<LinearLayout
android:id="@+id/layer3"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
android:background="@color/black">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:layout_marginLeft="30dp"
android:layout_marginTop="20dp"
android:layout_marginRight="30dp">
<ImageView
android:layout_width="100dp"
android:layout_height="100dp"
android:layout_marginLeft="10dp"
android:layout_marginTop="10dp"
app:srcCompat="@drawable/logo" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textSize="24dp"
android:layout_marginLeft="20dp"
android:layout_marginTop="36dp"
android:textColor="@color/white"
android:text="Paddy Area"/>
</LinearLayout>
</LinearLayout>
</androidx.cardview.widget.CardView>
</LinearLayout>
\ No newline at end of file
......@@ -35,6 +35,20 @@
android:textSize="21sp"
android:textStyle="bold" />
<TextView
android:id="@+id/resulttextRice"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="10dp"
android:layout_marginRight="10dp"
android:text="Height Result"
android:textAlignment="center"
android:textColor="#212121"
android:textSize="15dp"
android:layout_below="@+id/imageHeightView"
android:textStyle="bold" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
......@@ -45,6 +59,7 @@
android:textSize="30sp"
android:id="@+id/height"
android:layout_marginTop="20sp"
/>
<ImageView
......
......@@ -24,7 +24,7 @@
android:textSize="20dp" />
<TextView
android:id="@+id/treatText2"
android:id="@+id/treatText2Rice"
android:layout_marginTop="10dp"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
......@@ -53,7 +53,22 @@
</TextView>
<TextView
android:id="@+id/treatText4"
android:id="@+id/treatText4Rice"
android:layout_marginTop="10dp"
android:layout_marginBottom="20dp"
android:layout_marginLeft="10dp"
android:layout_marginRight="10dp"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="Treatment Details"
android:textAlignment="center"
android:textColor="#212121"
android:textStyle="bold"
android:textSize="15dp">
</TextView>
<TextView
android:id="@+id/treatText5Rice"
android:layout_marginTop="10dp"
android:layout_marginBottom="20dp"
android:layout_marginLeft="10dp"
......
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
android:padding="16dp"
android:gravity="center"
xmlns:android="http://schemas.android.com/apk/res/android"
android:background="@drawable/back"
tools:context=".PaddyArea.PaddyAreaHome">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Choose the preferred method to the Area of the Paddy"
android:textSize="15sp"
android:textStyle="bold"
android:textAlignment="center"
android:textColor="@color/black"
android:layout_marginTop="16dp"/>
<!-- <Button-->
<!-- android:layout_width="wrap_content"-->
<!-- android:layout_height="wrap_content"-->
<!-- android:id="@+id/bt_1"-->
<!-- android:text="Image"/>-->
<Button
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="@+id/bt_2"
android:text="Location"/>
<Button
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="@+id/bt_3"
android:text="Input"/>
</LinearLayout>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
android:padding="16dp"
android:gravity="center"
android:background="@drawable/back"
tools:context=".PaddyArea.PaddyAreaResult">
<!-- <TextView-->
<!-- android:layout_width="wrap_content"-->
<!-- android:layout_height="wrap_content"-->
<!-- android:layout_marginTop="16dp"-->
<!-- android:text="0"-->
<!-- android:id="@+id/d1"-->
<!-- android:textColor="@color/black"-->
<!-- android:textSize="20sp"-->
<!-- android:textStyle="bold" />-->
<!-- <TextView-->
<!-- android:layout_width="wrap_content"-->
<!-- android:layout_height="wrap_content"-->
<!-- android:layout_marginTop="16dp"-->
<!-- android:text="0"-->
<!-- android:id="@+id/d2"-->
<!-- android:textColor="@color/black"-->
<!-- android:textSize="20sp"-->
<!-- android:textStyle="bold" />-->
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="16dp"
android:text="Paddy Area"
android:textColor="@color/black"
android:textSize="20sp"
android:textStyle="bold" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="16dp"
android:text="0"
android:id="@+id/area"
android:textColor="@color/black"
android:textSize="20sp"
android:textStyle="bold" />
<Button
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="@+id/navigateFertiGuidence"
android:text="Get Recommendation"/>
</LinearLayout>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
android:padding="16dp"
android:gravity="center"
xmlns:android="http://schemas.android.com/apk/res/android"
android:background="@drawable/back"
tools:context=".PaddyArea.PaddyAreaText">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Insert Paddy area in Hectare(ha)"
android:textSize="15sp"
android:textStyle="bold"
android:textAlignment="center"
android:textColor="@color/black"
android:layout_marginTop="16dp"/>
<EditText
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textAlignment="center"
android:textColor="@color/black"
android:id="@+id/paddyValue"
android:text=""
/>
<Button
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="@+id/addPaddyValue"
android:text="ADD"/>
<Button
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="@+id/navigateFertiGuidence"
android:text="Get Recommendation"/>
</LinearLayout>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
android:padding="16dp"
android:gravity="center"
xmlns:android="http://schemas.android.com/apk/res/android"
android:background="@drawable/back"
tools:context=".PaddyArea.PaddyAreaView_01">
<Button
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="@+id/bt_location"
android:text="Get Location"/>
<Button
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="@+id/bt_location1"
android:text="next"/>
</LinearLayout>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
android:padding="16dp"
android:gravity="center"
xmlns:android="http://schemas.android.com/apk/res/android"
android:background="@drawable/back"
tools:context=".PaddyArea.PaddyAreaView_02">
<Button
android:id="@+id/bt_location2"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Get Location 2" />
<!-- <TextView-->
<!-- android:layout_width="wrap_content"-->
<!-- android:layout_height="wrap_content"-->
<!-- android:layout_marginTop="16dp"-->
<!-- android:text="Latitude 01"-->
<!-- android:textColor="@color/black"-->
<!-- android:textSize="20sp"-->
<!-- android:textStyle="bold" />-->
<!-- <TextView-->
<!-- android:layout_width="wrap_content"-->
<!-- android:layout_height="wrap_content"-->
<!-- android:id="@+id/tv_latitude2"-->
<!-- android:text="0.0"-->
<!-- android:textSize="24sp" />-->
<!-- <TextView-->
<!-- android:layout_width="wrap_content"-->
<!-- android:layout_height="wrap_content"-->
<!-- android:text="Longitude 01"-->
<!-- android:textSize="20sp"-->
<!-- android:textStyle="bold"-->
<!-- android:textColor="@color/black"-->
<!-- android:layout_marginTop="16dp"/>-->
<!-- <TextView-->
<!-- android:layout_width="wrap_content"-->
<!-- android:layout_height="wrap_content"-->
<!-- android:id="@+id/tv_longitude2"-->
<!-- android:text="0.0"-->
<!-- android:textSize="24sp" />-->
<!-- <TextView-->
<!-- android:layout_width="wrap_content"-->
<!-- android:layout_height="wrap_content"-->
<!-- android:layout_marginTop="16dp"-->
<!-- android:text="Latitude 02"-->
<!-- android:textColor="@color/black"-->
<!-- android:textSize="20sp"-->
<!-- android:textStyle="bold" />-->
<!-- <TextView-->
<!-- android:layout_width="wrap_content"-->
<!-- android:layout_height="wrap_content"-->
<!-- android:id="@+id/tv_lt"-->
<!-- android:text="0.0"-->
<!-- android:textSize="24sp" />-->
<!-- <TextView-->
<!-- android:layout_width="wrap_content"-->
<!-- android:layout_height="wrap_content"-->
<!-- android:text="Longitude 02"-->
<!-- android:textSize="20sp"-->
<!-- android:textStyle="bold"-->
<!-- android:textColor="@color/black"-->
<!-- android:layout_marginTop="16dp"/>-->
<!-- <TextView-->
<!-- android:layout_width="wrap_content"-->
<!-- android:layout_height="wrap_content"-->
<!-- android:id="@+id/tv_lg"-->
<!-- android:text="0.0"-->
<!-- android:textSize="24sp" />-->
<!-- <TextView-->
<!-- android:layout_width="wrap_content"-->
<!-- android:layout_height="wrap_content"-->
<!-- android:id="@+id/ff"-->
<!-- android:text="m"-->
<!-- android:textSize="24sp" />-->
<Button
android:id="@+id/nxt1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Next" />
</LinearLayout>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
android:padding="16dp"
android:gravity="center"
xmlns:android="http://schemas.android.com/apk/res/android"
android:background="@drawable/back"
tools:context=".PaddyArea.PaddyAreaView_03">
<Button
android:id="@+id/nxt1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Result - 1" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Distance 1"
android:textSize="24sp" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="@+id/ff"
android:text="m"
android:textSize="24sp" />
<Button
android:id="@+id/bt_location3"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Get Location 3" />
<!-- <TextView-->
<!-- android:layout_width="wrap_content"-->
<!-- android:layout_height="wrap_content"-->
<!-- android:layout_marginTop="16dp"-->
<!-- android:text="Latitude 03"-->
<!-- android:textColor="@color/black"-->
<!-- android:textSize="20sp"-->
<!-- android:textStyle="bold" />-->
<!-- <TextView-->
<!-- android:layout_width="wrap_content"-->
<!-- android:layout_height="wrap_content"-->
<!-- android:id="@+id/tv_lt1"-->
<!-- android:text="0.0"-->
<!-- android:textSize="24sp" />-->
<!-- <TextView-->
<!-- android:layout_width="wrap_content"-->
<!-- android:layout_height="wrap_content"-->
<!-- android:text="Longitude 03"-->
<!-- android:textSize="20sp"-->
<!-- android:textStyle="bold"-->
<!-- android:textColor="@color/black"-->
<!-- android:layout_marginTop="16dp"/>-->
<!-- <TextView-->
<!-- android:layout_width="wrap_content"-->
<!-- android:layout_height="wrap_content"-->
<!-- android:id="@+id/tv_lg1"-->
<!-- android:text="0.0"-->
<!-- android:textSize="24sp" />-->
<Button
android:id="@+id/nxt2"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Next" />
</LinearLayout>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
android:padding="16dp"
android:gravity="center"
xmlns:android="http://schemas.android.com/apk/res/android"
android:background="@drawable/back"
tools:context=".PaddyArea.PaddyAreaView_04">
<Button
android:id="@+id/bt_location3"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Get Location 4" />
<!-- <TextView-->
<!-- android:layout_width="wrap_content"-->
<!-- android:layout_height="wrap_content"-->
<!-- android:layout_marginTop="16dp"-->
<!-- android:text="Latitude 03"-->
<!-- android:textColor="@color/black"-->
<!-- android:textSize="20sp"-->
<!-- android:textStyle="bold" />-->
<!-- <TextView-->
<!-- android:layout_width="wrap_content"-->
<!-- android:layout_height="wrap_content"-->
<!-- android:id="@+id/tv_lt1"-->
<!-- android:text="0.0"-->
<!-- android:textSize="24sp" />-->
<!-- <TextView-->
<!-- android:layout_width="wrap_content"-->
<!-- android:layout_height="wrap_content"-->
<!-- android:text="Longitude 03"-->
<!-- android:textSize="20sp"-->
<!-- android:textStyle="bold"-->
<!-- android:textColor="@color/black"-->
<!-- android:layout_marginTop="16dp"/>-->
<!-- <TextView-->
<!-- android:layout_width="wrap_content"-->
<!-- android:layout_height="wrap_content"-->
<!-- android:id="@+id/tv_lg1"-->
<!-- android:text="0.0"-->
<!-- android:textSize="24sp" />-->
<!-- <TextView-->
<!-- android:layout_width="wrap_content"-->
<!-- android:layout_height="wrap_content"-->
<!-- android:layout_marginTop="16dp"-->
<!-- android:text="Latitude 04"-->
<!-- android:textColor="@color/black"-->
<!-- android:textSize="20sp"-->
<!-- android:textStyle="bold" />-->
<!-- <TextView-->
<!-- android:layout_width="wrap_content"-->
<!-- android:layout_height="wrap_content"-->
<!-- android:id="@+id/tv_lt2"-->
<!-- android:text="0.0"-->
<!-- android:textSize="24sp" />-->
<!-- <TextView-->
<!-- android:layout_width="wrap_content"-->
<!-- android:layout_height="wrap_content"-->
<!-- android:text="Longitude 04"-->
<!-- android:textSize="20sp"-->
<!-- android:textStyle="bold"-->
<!-- android:textColor="@color/black"-->
<!-- android:layout_marginTop="16dp"/>-->
<!-- <TextView-->
<!-- android:layout_width="wrap_content"-->
<!-- android:layout_height="wrap_content"-->
<!-- android:id="@+id/tv_lg2"-->
<!-- android:text="0.0"-->
<!-- android:textSize="24sp" />-->
<!-- <TextView-->
<!-- android:layout_width="wrap_content"-->
<!-- android:layout_height="wrap_content"-->
<!-- android:id="@+id/distance1"-->
<!-- android:text="0.0"-->
<!-- android:textSize="24sp" />-->
<Button
android:id="@+id/nxt1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Get Result" />
</LinearLayout>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:padding="50dp">
<ProgressBar
android:id="@+id/progressBar"
style="?android:attr/progressBarStyle"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintHorizontal_bias="0.498"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintVertical_bias="0.114" />
<TextView
android:id="@+id/textView"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="16dp"
android:textAlignment="center"
android:text="Please wait till we record your Current LOCATION!"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintHorizontal_bias="0.498"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/progressBar"
app:layout_constraintVertical_bias="0.039" />
</androidx.constraintlayout.widget.ConstraintLayout>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<resources>
<color name="purple_200">#FFBB86FC</color>
<color name="purple_500">#FF6200EE</color>
<color name="purple_700">#FF3700B3</color>
<color name="teal_200">#FF03DAC5</color>
<color name="teal_700">#FF018786</color>
<color name="black">#FF000000</color>
<color name="lawngreen">#7CFC00</color>
<color name="chartreuse">#7FFF00</color>
<color name="limegreen">#32CD32 </color>
......@@ -22,4 +16,7 @@
<color name="seagreen">#2E8B57</color>
<color name="white">#FFFFFF</color>
<color name="gray">#484848</color>
<color name="teal_200">#FF03DAC5</color>
<color name="teal_700">#FF018786</color>
<color name="black">#FF000000</color>
</resources>
\ No newline at end of file
......@@ -26,74 +26,29 @@
<string name="confirmpassword">ConfirmPassowrd</string>
<string name="resetpassword">Reset Password</string>
<string name="detail1">
Leaf margins turn brown, beginning with the older leaves and moving outward, spreading to leaves toward the branch tip.
The browned leaves may drop from the tree.
Symptoms become progressively worse over a period of 3 to 8 years, until the entire tree turns brown prematurely.
Infected leafhoppers and spittlebugs feed on the succulent, terminal shoots of susceptible host trees, transmitting the bacteria.
There are no viable control options for the insect vectors.
</string>
<string name="treatment1">
• Maintain plant vigor. Keeping susceptible trees healthy and thriving can help them resist infection and survive longer once they are infected.\n\n
• Practice good sanitation. Branches that have died due to bacterial leaf scorch should be routinely removed. Infected trees that are in a severe state of decline should also be removed.\n\n
• Plant resistant species. In areas where bacterial leaf scorch has occurred, avoid planting highly susceptible trees.\n\n
• Antibiotic injections. Oxytetracycline root flare injections applied in spring can reduce bacterium levels and delay symptoms by a couple of weeks.
</string>
<string name="detail2">
Late blight (Phytophthora infestans) is among the most destructive plant disease.
Late blight is caused by a fungus, and it creates irregularly shaped splotches that are slimy and water-soaked.
The spores of this disease are fast-spreading, moving on the wind for miles. Plant only locally grown plants to help keep the pathogen out of your area.
• Maintaining plant vigor. Keeping vulnerable trees healthy and vigorous allows them to resist growth and survive longer once established.\n\n
• Practice good hygiene. Dead branches due to bacterial leaf blight should be removed regularly. Severely decayed infected trees should also be removed.\n\n
• Species resistant to plant growth retardation. In affected areas, avoid planting highly vulnerable trees.\n\n
• Antibiotic injections. And increase the fertilizer
</string>
<string name="treatment2">
• Once late blight strikes, there is little you can do.\n\n
• Tear out the plants, put them in a garbage bag, and throw them out to keep the disease from spreading.\n\n
• Organic fungicides based on Bacillus subtilis are somewhat effective in preventing this tea plant disease when it’s first discovered in your area.
</string>
<string name="detail3">
Bacterial spot is a widespread disease of tea in Sri Lanka, where rainfall and humidity levels promote disease development.
Bacterial spot reduces tea yield and quality by defoliation. The bacteria enter plants through natural openings or wounds.
The leaf spots produced in bacterial spot are nearly identical to those of bacterial speck, and are similar to the initial symptoms of the fungal disease Septoria leaf spot.
A general yellowing of heavily spotted areas on leaves occurs, followed by leaf scorch.
Blighting (rapid death) of foliage progresses upward from the lower leaves on heavily infected plants.
• OAntibiotic injections. And increase the fertilizer.\n\n
</string>
<string name="treatment3">
• Control of bacterial spot is difficult once it becomes established in the field. Therefore, it is imperative to start with clean seed and transplants.\n\n
• Transplants should be started from clean seed produced in an area where the disease does not occur, or from seed that is disinfested with hot water or chlorine bleach treatment.\n\n
• Remove and destroy diseased crop debris or incorporate it into soil soon after harvest is complete.\n\n
• A weekly spray program with bactericides (mixtures of copper and fungicide) reduces disease development and increases yield.
</string>
<string name="detail4">
Appearing as tiny, round splotches on the leaves, this disease typically starts on the lowest leaves first.
After the plants begin to develop, the lower leaves break out in yellow spots. Within the yellow spots, dark gray centers with dark borders appear.
Black dots appear in the center of the spots. Foliage dies and falls off.
• OAntibiotic injections. And increase the fertilizer.\n\n
</string>
<string name="treatment4">
• Cut off and destroy infected leaves as soon as you spot them and disinfect pruning equipment before moving from one plant to another.\n\n
• Avoid watering from the top, as the spray can force the spores developing on the leaves back into the soil and continue the disease cycle.\n\n
• Organic fungicides based on copper or Bacillus subtilis are effective against septoria leaf spot, especially when used as a preventative measure.
</string>
<string name="detail5">
The disease starts on the older leaves and spreads upwards.
The first signs are irregular-shaped spots (less than 1 mm) with a yellow margin.
Spread to all leaflets and to other leaves is rapid, causing the leaves to turn yellow, collapse and die. Spots also occur on the stems.
The spores are spread by wind-blown rain, and if windy wet weather continues for a few days, spread is fast and plants lose their leaves quickly.
Look for the disease on the bottom leaves. Look for tiny brown spots with yellow margins. Look for larger spots up to 10 mm that have ring patterns. Spots may be present on the stems and on the fruit.
• OAntibiotic injections. And increase the fertilizer.\n\n
</string>
<string name="treatment5">
• Do not plant new crops next to older ones that have the disease.\n\n
• Check all seedlings in the nursery, and throw away any with leaf spots.\n\n
• Remove a few branches from the lower part of the plants to allow better airflow at the base.\n\n
• Remove and burn the lower leaves as soon as the disease is seen.\n\n
• The fungicides products to use are chlorothalonil, copper oxychloride or mancozeb.\n\n
• Treatment should start when the first spots are seen and continue at 10-14-day intervals until 3-4 weeks before last harvest. It is important to spray both sides of the leaves.
• OAntibiotic injections. And increase the fertilizer.\n\n
</string>
<string name="treatment6">
• OAntibiotic injections. And increase the fertilizer.\n\n
</string>
</resources>
package com.example.asuper;
import org.junit.Test;
import static org.junit.Assert.*;
/**
* Example local unit test, which will execute on the development machine (host).
*
* @see <a href="http://d.android.com/tools/testing">Testing documentation</a>
*/
public class ExampleUnitTest {
@Test
public void addition_isCorrect() {
assertEquals(4, 2 + 2);
}
}
\ No newline at end of file
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 to comment