Commit c9b5814d authored by Salika952's avatar Salika952

resolve conflict

parents 474bef87 83089381
*.iml
.gradle
/.idea/.name
/.idea/gradle.xml
/.idea/misc.xml
/.idea
/local.properties
/.idea/caches
/.idea/libraries
/.idea/modules.xml
/.idea/workspace.xml
/.idea/navEditor.xml
/.idea/assetWizardSettings.xml
.DS_Store
/build
/captures
.externalNativeBuild
.cxx
local.properties
/build
/src/main/assets/model.tflite
plugins {
id 'com.android.application'
id 'com.google.gms.google-services'
id 'com.chaquo.python'
}
android {
compileSdkVersion 31
buildToolsVersion "30.0.3"
defaultConfig {
applicationId "com.example.eketha"
minSdkVersion 21
targetSdkVersion 31
versionCode 1
versionName "1.0"
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
ndk {
abiFilters "armeabi-v7a", "x86"
}
python {
buildPython "C:/python/python.exe"
pip {
install "opencv-contrib-python-headless"
install "pillow"
install "numpy"
install "fastapi"
install "matplotlib"
install "dlib"
install "imutils"
install "argparse"
install "scipy"
}
}
sourceSets {
main {
python.srcDir "src/main/python"
}
}
}
lintOptions {
checkReleaseBuilds false
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
}
}
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
aaptOptions {
noCompress "tflite"
//noCompress "lite"
}
buildFeatures {
mlModelBinding true
}
}
dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation 'com.android.support:appcompat-v7:26.1.0'
implementation 'androidx.appcompat:appcompat:1.4.1'
implementation 'com.google.android.material:material:1.5.0'
implementation 'com.android.support:support-annotations:27.1.1'
implementation 'com.android.support:cardview-v7:26.1.0'
implementation 'androidx.constraintlayout:constraintlayout:2.1.3'
implementation 'com.google.firebase:firebase-firestore:23.0.3'
implementation 'com.google.firebase:firebase-auth:21.0.1'
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:+'
testImplementation 'junit:junit:4.+'
androidTestImplementation 'androidx.test.ext:junit:1.1.3'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.4.0'
}
\ No newline at end of file
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
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.example.eketha">
<uses-feature
android:name="android.hardware.Camera.any"
android:required="true" />
<uses-feature
android:name="android.hardware.Camera"
android:required="true" />
<uses-permission android:name="android.permission.CAMERA" />
<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"
android:icon="@drawable/logo"
android:label="@string/app_name"
android:roundIcon="@mipmap/ic_launcher_round"
android:supportsRtl="true"
android:theme="@style/Theme.EKetha">
<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" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity android:name=".GrowthHeight" />
<activity android:name=".GrowthThreatment" />
<activity android:name=".GrowthDetect" />
<activity android:name=".Admin" />
<activity android:name=".growthHome" />
<activity android:name=".Growth" />
<activity android:name=".Register" />
<activity android:name=".Login" />
<activity android:name=".MainActivity" />
<provider
android:name="androidx.core.content.FileProvider"
android:authorities="${applicationId}.fileprovider"
android:exported="false"
android:grantUriPermissions="true">
<meta-data
android:name="android.support.FILE_PROVIDER_PATHS"
android:resource="@xml/file_paths" />
</provider>
</application>
</manifest>
\ No newline at end of file
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
package com.example.eketha;
import androidx.annotation.Nullable;
import androidx.annotation.RequiresApi;
import androidx.appcompat.app.AppCompatActivity;
import androidx.core.content.FileProvider;
import android.Manifest;
import android.app.Activity;
import android.content.Context;
import android.content.Intent;
import android.content.pm.PackageManager;
import android.content.res.AssetFileDescriptor;
import android.graphics.Bitmap;
import android.graphics.BitmapFactory;
import android.graphics.drawable.BitmapDrawable;
import android.media.ThumbnailUtils;
import android.net.Uri;
import android.os.Build;
import android.os.Bundle;
import android.os.Environment;
import android.provider.MediaStore;
import android.util.Log;
import android.view.View;
import android.widget.Button;
import android.widget.ImageView;
import android.widget.TextView;
import org.tensorflow.lite.DataType;
import org.tensorflow.lite.Interpreter;
import org.tensorflow.lite.support.common.FileUtil;
import org.tensorflow.lite.support.common.TensorOperator;
import org.tensorflow.lite.support.common.TensorProcessor;
import org.tensorflow.lite.support.common.ops.NormalizeOp;
import org.tensorflow.lite.support.image.ImageProcessor;
import org.tensorflow.lite.support.image.TensorImage;
import org.tensorflow.lite.support.image.ops.ResizeOp;
import org.tensorflow.lite.support.image.ops.ResizeWithCropOrPadOp;
import org.tensorflow.lite.support.label.TensorLabel;
import org.tensorflow.lite.support.tensorbuffer.TensorBuffer;
import java.io.ByteArrayOutputStream;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileOutputStream;
import java.io.IOException;
import java.nio.MappedByteBuffer;
import java.nio.channels.FileChannel;
import java.text.SimpleDateFormat;
import java.util.Collections;
import java.util.Date;
import java.util.List;
import java.util.Map;
public class Growth extends AppCompatActivity {
protected Interpreter tflite;
private MappedByteBuffer tfliteModel;
private TensorImage inputImageBuffer;
private int imageSizeX;
private int imageSizeY;
private TensorBuffer outputProbabilityBuffer;
private TensorProcessor probabilityProcessor;
private static final float IMAGE_MEAN = 0.0f;
private static final float IMAGE_STD = 1.0f;
private static final float PROBABILITY_MEAN = 0.0f;
private static final float PROBABILITY_STD = 255.0f;
private Bitmap bitmap,outputImage;
private List<String> labels;
private Context context;
private Button btnTakePic, btnOpenCam, btnConfirm;
private ImageView imageView;
private String pathToFile;
private static final int PICK_IMAGE = 100;
private Uri imageUri;
private TextView classitext, treattext;
private String filepath = "";
private int imageSize = 32;
private Bitmap bitmapImage;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_growth);
btnTakePic = findViewById(R.id.btnTakePic);
imageView = findViewById(R.id.image);
btnOpenCam = findViewById(R.id.btnOpenCam);
btnConfirm = findViewById(R.id.btnConfirm);
classitext = findViewById(R.id.classitext);
btnConfirm.setVisibility(View.INVISIBLE);
if (Build.VERSION.SDK_INT >= 23) {
requestPermissions(new String[] {Manifest.permission.CAMERA, Manifest.permission.WRITE_EXTERNAL_STORAGE}, 2);
}
btnTakePic.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);
}
}
});
btnOpenCam.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);
}
});
imageView.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
Intent intent = new Intent();
intent.setType("image/");
intent.setAction(Intent.ACTION_GET_CONTENT);
startActivityForResult(Intent.createChooser(intent, "Select Picture"), 1);
}
});
btnConfirm.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
int imageTensorIndex = 0;
int[] imageShape = tflite.getInputTensor(imageTensorIndex).shape(); // {1, height, width, 3}
imageSizeY = imageShape[1];
imageSizeX = imageShape[2];
DataType imageDataType = tflite.getInputTensor(imageTensorIndex).dataType();
int probabilityTensorIndex = 0;
int[] probabilityShape =
tflite.getOutputTensor(probabilityTensorIndex).shape(); // {1, NUM_CLASSES}
DataType probabilityDataType = tflite.getOutputTensor(probabilityTensorIndex).dataType();
inputImageBuffer = new TensorImage(imageDataType);
outputProbabilityBuffer = TensorBuffer.createFixedSize(probabilityShape, probabilityDataType);
probabilityProcessor = new TensorProcessor.Builder().add(getPostprocessNormalizeOp()).build();
inputImageBuffer = loadImage(bitmap);
tflite.run(inputImageBuffer.getBuffer(),outputProbabilityBuffer.getBuffer().rewind());
showResult();
String result = classitext.getText().toString();
String details="";
String treatment2="";
if(result.equals("Rice")){
details="Rice";
System.out.println(result);
} else if(result.equals("Weed")){
details=getResources().getString(R.string.treatment1);
System.out.println(result);
}
BitmapDrawable drawable = (BitmapDrawable) imageView.getDrawable();
outputImage = drawable.getBitmap();
try {
//Write file
String filename = "bitmap.png";
FileOutputStream stream = openFileOutput(filename, Context.MODE_PRIVATE);
outputImage.compress(Bitmap.CompressFormat.PNG, 100, stream);
//Cleanup
stream.close();
outputImage.recycle();
//Pop intent
Intent intent = new Intent(Growth.this, GrowthDetect.class);
intent.putExtra("results", result);
intent.putExtra("details", details);
if(result.equals("rice")){
intent.putExtra("button", "Height Measurement");
}else if(result.equals("weed")){
intent.putExtra("button", "Weed Identification");
}
intent.putExtra("image", filename);
startActivity(intent);
} catch (Exception e) {
e.printStackTrace();
}
}
});
// First we must create the tflite object, loaded from the model file
try{
tflite=new Interpreter(loadmodelfile(this));
}catch (Exception e) {
e.printStackTrace();
}
}
private TensorImage loadImage(Bitmap bitmap) {
// Loads bitmap into a TensorImage.
bitmap = ((BitmapDrawable)imageView.getDrawable()).getBitmap();
inputImageBuffer.load(bitmap);
// Creates processor for the TensorImage.
int cropSize = Math.min(bitmap.getWidth(), bitmap.getHeight());
// TODO(b/143564309): Fuse ops inside ImageProcessor.
ImageProcessor imageProcessor =
new ImageProcessor.Builder()
.add(new ResizeWithCropOrPadOp(cropSize, cropSize))
.add(new ResizeOp(imageSizeX, imageSizeY, ResizeOp.ResizeMethod.NEAREST_NEIGHBOR))
.add(getPreprocessNormalizeOp())
.build();
return imageProcessor.process(inputImageBuffer);
}
private MappedByteBuffer loadmodelfile(Activity activity) throws IOException {
// Open the model using an input stream and memory map it to load
AssetFileDescriptor fileDescriptor=activity.getAssets().openFd("model.tflite");
FileInputStream inputStream=new FileInputStream(fileDescriptor.getFileDescriptor());
FileChannel fileChannel=inputStream.getChannel();
long startoffset = fileDescriptor.getStartOffset();
long declaredLength=fileDescriptor.getDeclaredLength();
return fileChannel.map(FileChannel.MapMode.READ_ONLY,startoffset,declaredLength);
}
private TensorOperator getPreprocessNormalizeOp() {
return new NormalizeOp(IMAGE_MEAN, IMAGE_STD);
}
private TensorOperator getPostprocessNormalizeOp(){
return new NormalizeOp(PROBABILITY_MEAN, PROBABILITY_STD);
}
private void showResult(){
try{
labels = FileUtil.loadLabels(this,"dictT.txt");
}catch (Exception e){
e.printStackTrace();
}
Map<String, Float> labeledProbability =
new TensorLabel(labels, probabilityProcessor.process(outputProbabilityBuffer))
.getMapWithFloatValue();
float maxValueInMap =(Collections.max(labeledProbability.values()));
for (Map.Entry<String, Float> entry : labeledProbability.entrySet()) {
if (entry.getValue()==maxValueInMap) {
classitext.setText(entry.getKey());
}
}
}
@Override
protected void onActivityResult(int requestCode, int resultCode, Intent data) {
if(resultCode == RESULT_OK){
if(requestCode == 3){
Bitmap image = (Bitmap) data.getExtras().get("data");
bitmapImage = image;
int dimension = Math.min(image.getWidth(), image.getHeight());
image = ThumbnailUtils.extractThumbnail(image, dimension, dimension);
imageView.setImageBitmap(image);
btnConfirm.setVisibility(View.VISIBLE);
}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);
btnConfirm.setVisibility(View.VISIBLE);
}
}
super.onActivityResult(requestCode, resultCode, data);
}
}
\ No newline at end of file
package com.example.eketha;
import androidx.appcompat.app.AppCompatActivity;
import android.content.Context;
import android.content.Intent;
import android.graphics.Bitmap;
import android.graphics.BitmapFactory;
import android.graphics.drawable.BitmapDrawable;
import android.os.Bundle;
import android.os.Handler;
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;
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 {
private Handler handler = null;
private Bitmap inputImage,newImage,bitmap,outputImage,outputImage1;
private Button btnHeight,btnThreatment;
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) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_growth_height);
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));
}
String filename = getIntent().getStringExtra("image");
try {
FileInputStream is = this.openFileInput(filename);
inputImage = BitmapFactory.decodeStream(is);
imageView1.setImageBitmap(inputImage);
is.close();
} catch (Exception e) {
e.printStackTrace();
}
btnThreatment.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
BitmapDrawable drawable = (BitmapDrawable) imageView1.getDrawable();
outputImage1 = drawable.getBitmap();
try {
//Write file
String filename = "bitmap.png";
FileOutputStream stream = openFileOutput(filename, Context.MODE_PRIVATE);
outputImage1.compress(Bitmap.CompressFormat.PNG, 100, stream);
//Cleanup
stream.close();
outputImage1.recycle();
//Pop intent
Intent intent = new Intent(GrowthHeight.this, GrowthThreatment.class);
intent.putExtra("results", value);
intent.putExtra("image", filename);
startActivity(intent);
} catch (Exception e) {
e.printStackTrace();
}
}
});
btnHeight.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
autoDenoiseImage();
}
});
}
private void autoDenoiseImage() {
new Thread() {
public void run() {
startMeasuring();
newImage = outputImage;
handler.sendEmptyMessage(0);
}
}.start();
handler = new Handler() {
public void handleMessage(android.os.Message msg) {
imageView1.setImageBitmap(outputImage);
}
;
};
}
public void heightImage(View v) {
autoDenoiseImage();
imageView1.setImageBitmap(newImage);
}
private String getStringImage(Bitmap bitmap) {
ByteArrayOutputStream byteArrayOutputStream = new ByteArrayOutputStream();
bitmap.compress(Bitmap.CompressFormat.JPEG, 100, byteArrayOutputStream);
byte[] imageBytes = byteArrayOutputStream.toByteArray();
String encodedImage = Base64.encodeToString(imageBytes, Base64.DEFAULT);
return encodedImage;
}
public void startMeasuring() {
final Python py= Python.getInstance();
imageString = getStringImage(inputImage);
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
package com.example.eketha;
import androidx.appcompat.app.AppCompatActivity;
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 {
FileInputStream is = this.openFileInput(filename);
inputImage = BitmapFactory.decodeStream(is);
imageView1.setImageBitmap(inputImage);
is.close();
} 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();
}
}
package com.example.eketha;
import androidx.appcompat.app.AppCompatActivity;
import androidx.cardview.widget.CardView;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;
import android.widget.ImageButton;
import com.google.firebase.auth.FirebaseAuth;
public class MainActivity extends AppCompatActivity {
private CardView cardView1, cardView2, cardView3, cardView4;
private ImageButton logout;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
cardView1 = findViewById(R.id.card1);
cardView2 = findViewById(R.id.card2);
cardView3 = findViewById(R.id.card3);
cardView4 = findViewById(R.id.card4);
logout = findViewById(R.id.btnalogout);
logout.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
FirebaseAuth.getInstance().signOut();
startActivity(new Intent(getApplicationContext(), Login.class));
finish();
}
});
// cardView1.setOnClickListener(new View.OnClickListener() {
// @Override
// public void onClick(View view) {
// Intent intent = new Intent(getApplicationContext(),pdHome.class);
// startActivity(intent);
// }
// });
//
// cardView2.setOnClickListener(new View.OnClickListener() {
// @Override
// public void onClick(View view) {
// Intent intent = new Intent(getApplicationContext(),weedHome.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
public void onClick(View view) {
Intent intent = new Intent(getApplicationContext(),growthHome.class);
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 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
<?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"
android:layout_margin="10dp"
tools:context=".GrowthHeight">
<Button
android:id="@+id/button3"
android:layout_width="match_parent"
android:layout_height="68dp"
android:layout_alignParentBottom="true"
android:layout_centerVertical="true"
android:layout_marginTop="10dp"
android:layout_marginBottom="108dp"
android:onClick="heightImage"
android:text="Height Measurement"
android:textAllCaps="false"
android:textSize="21sp"
android:textStyle="bold" />
<Button
android:id="@+id/button2"
android:layout_width="match_parent"
android:layout_height="68dp"
android:layout_alignParentBottom="true"
android:layout_centerVertical="true"
android:layout_marginTop="10dp"
android:layout_marginBottom="24dp"
android:text="Growth Threatment"
android:textAllCaps="false"
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"
android:layout_centerHorizontal="true"
android:textColor="#009688"
android:text="Height Measurement"
android:textStyle="bold"
android:textSize="30sp"
android:id="@+id/height"
android:layout_marginTop="20sp"
/>
<ImageView
android:id="@+id/imageHeightView"
android:layout_width="370sp"
android:src="@drawable/a"
android:layout_height="370sp"
android:layout_below="@+id/height"
android:layout_centerHorizontal="true"
android:layout_marginTop="10sp"
android:onClick="heightImage" />
</RelativeLayout>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<ScrollView 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=".GrowthThreatment">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
android:gravity="center">
<TextView
android:id="@+id/treatText1"
android:layout_margin="20dp"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="GROWTH TREATMENTS"
android:textAlignment="center"
android:textColor="#009688"
android:textSize="20dp" />
<TextView
android:id="@+id/treatText2Rice"
android:layout_marginTop="10dp"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Growth"
android:textAlignment="center"
android:textColor="#D32F2F"
android:textSize="20dp">
</TextView>
<ImageView
android:id="@+id/treatImg"
android:layout_width="196dp"
android:layout_height="226dp"
android:layout_marginTop="5dp">
</ImageView>
<TextView
android:id="@+id/treatText3"
android:layout_marginTop="5dp"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Treatments"
android:textAlignment="viewStart"
android:textColor="#00BCD4"
android:textSize="20dp">
</TextView>
<TextView
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"
android:layout_marginRight="10dp"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="Treatment Details"
android:textAlignment="viewStart"
android:textColor="#212121"
android:textStyle="bold"
android:textSize="15dp">
</TextView>
</LinearLayout>
</ScrollView>
\ No newline at end of file
<ScrollView 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:background="@color/green"
tools:context=".MainActivity">
<androidx.constraintlayout.widget.ConstraintLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@drawable/back6">
<androidx.appcompat.widget.Toolbar
android:id="@+id/toolbar"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:background="#00008577"
android:minHeight="?attr/actionBarSize"
android:theme="?attr/actionBarTheme"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
<TextView
android:id="@+id/textView"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginStart="16dp"
android:layout_marginLeft="16dp"
android:layout_marginTop="24dp"
android:text="My Dashboard"
android:textColor="@color/limegreen"
android:textSize="25sp"
app:layout_constraintEnd_toStartOf="@+id/imageView"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/toolbar" />
<TextView
android:id="@+id/textView2"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginStart="16dp"
android:layout_marginLeft="16dp"
android:text="E-Ketha"
android:textColor="@color/white"
app:layout_constraintEnd_toStartOf="@+id/imageView"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/textView" />
<ImageView
android:id="@+id/imageView"
android:layout_width="0dp"
android:layout_height="160dp"
android:layout_marginEnd="16dp"
android:layout_marginRight="16dp"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toEndOf="@+id/textView"
app:layout_constraintTop_toBottomOf="@+id/toolbar"
app:srcCompat="@drawable/logo" />
<LinearLayout
android:id="@+id/linearLayout"
android:layout_width="0dp"
android:layout_height="175dp"
android:orientation="horizontal"
android:padding="10dp"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintHorizontal_bias="0.0"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/imageView">
<androidx.cardview.widget.CardView
android:id="@+id/card1"
app:cardCornerRadius="15dp"
android:layout_width="10dp"
android:layout_height="145dp"
android:layout_margin="10dp"
android:layout_weight="1">
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="match_parent">
<TextView
android:id="@+id/textView3"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="@id/bus"
android:layout_centerHorizontal="true"
android:layout_marginTop="10dp"
android:textColor="@color/black"
android:text="Pests"
android:textSize="24sp" />
<ImageView
android:id="@+id/bus"
android:layout_width="85dp"
android:layout_height="85dp"
android:layout_centerHorizontal="true"
android:layout_marginTop="15dp"
app:srcCompat="@drawable/pests"/>
</RelativeLayout>
</androidx.cardview.widget.CardView>
<androidx.cardview.widget.CardView
android:id="@+id/card2"
app:cardCornerRadius="15dp"
android:layout_width="10dp"
android:layout_height="145dp"
android:layout_margin="10dp"
android:layout_weight="1">
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="match_parent">
<TextView
android:id="@+id/textView4"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="@id/imageView3"
android:layout_centerHorizontal="true"
android:textColor="@color/black"
android:layout_marginTop="10dp"
android:text="Weeds"
android:textSize="24sp" />
<ImageView
android:id="@+id/imageView3"
android:layout_width="85dp"
android:layout_height="85dp"
android:layout_centerHorizontal="true"
android:layout_marginTop="15dp"
app:srcCompat="@drawable/weed"/>
</RelativeLayout>
</androidx.cardview.widget.CardView>
</LinearLayout>
<LinearLayout
android:id="@+id/linearLayout2"
android:layout_width="0dp"
android:layout_height="175dp"
android:orientation="horizontal"
android:padding="10dp"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintHorizontal_bias="0.0"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/linearLayout">
<androidx.cardview.widget.CardView
android:id="@+id/card3"
app:cardCornerRadius="15dp"
android:layout_width="10dp"
android:layout_height="145dp"
android:layout_margin="10dp"
android:layout_weight="1">
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="wrap_content">
<TextView
android:id="@+id/textView6"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="@id/bus1"
android:layout_centerHorizontal="true"
android:textColor="@color/black"
android:layout_marginTop="9dp"
android:text="Fertilizer"
android:textSize="24sp" />
<ImageView
android:id="@+id/bus1"
android:layout_width="85dp"
android:layout_height="85dp"
android:layout_centerHorizontal="true"
android:layout_marginTop="15dp"
app:srcCompat="@drawable/fertilizer"/>
</RelativeLayout>
</androidx.cardview.widget.CardView>
<androidx.cardview.widget.CardView
android:id="@+id/card4"
app:cardCornerRadius="15dp"
android:layout_width="10dp"
android:layout_height="145dp"
android:layout_margin="10dp"
android:layout_weight="1">
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="wrap_content">
<TextView
android:id="@+id/textView7"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="@id/train"
android:layout_centerHorizontal="true"
android:layout_marginTop="10dp"
android:textColor="@color/black"
android:text="Rice Growth"
android:textSize="24sp" />
<ImageView
android:id="@+id/train"
android:layout_width="85dp"
android:layout_height="85dp"
android:layout_centerHorizontal="true"
android:layout_marginTop="15dp"
app:srcCompat="@drawable/growth"/>
</RelativeLayout>
</androidx.cardview.widget.CardView>
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical">
<ImageButton
android:id="@+id/btnalogout"
android:layout_width="wrap_content"
android:layout_marginTop="650dp"
android:layout_marginLeft="320dp"
android:src="@drawable/logout"
android:layout_height="wrap_content"/>
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_marginTop="20dp"
android:orientation="vertical" >
<TextView
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_marginLeft="120dp"
android:textSize="20dp"
android:textColor="@color/white"
android:layout_marginTop="750dp"
android:text="copyright@2022"/>
</LinearLayout>
</androidx.constraintlayout.widget.ConstraintLayout>
</ScrollView>
<?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="lawngreen">#7CFC00</color>
<color name="chartreuse">#7FFF00</color>
<color name="limegreen">#32CD32 </color>
<color name="lime">#00FF00 </color>
<color name="forestgreen">#228B22 </color>
<color name="green">#008000 </color>
<color name="darkgreen">#006400 </color>
<color name="greenyellow">#ADFF2F</color>
<color name="yellowgreen">#9ACD32</color>
<color name="springgreen">#00FF7F</color>
<color name="mediumspringgreen">#00FA9A</color>
<color name="lightgreen">#90EE90</color>
<color name="mediumseagreen">#3CB371</color>
<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
<resources>
<string name="app_name">E ketha</string>
<string name="menu_home">Home</string>
<string name="menu_gallery">Gallery</string>
<string name="menu_slideshow">Contact Us</string>
<string name="email">Email</string>
<string name="password">Password</string>
<string name="rememberme">Remember Me</string>
<string name="login">Login</string>
<string name="forgotpassword">Forgot Password</string>
<string name="signup">Sign Up</string>
<string name="fullName">Full Name</string>
<string name="lastName">Last Name</string>
<string name="mobile">Mobile</string>
<string name="retypepassword">Retype Password</string>
<string name="signin">Sign In</string>
<string name="logout">Logout</string>
<string name="title_activity_adminpa">Adminpa</string>
<string name="changeprofile">Change Profile</string>
<string name="deleteprofile">Delete Profile</string>
<string name="save">Save</string>
<string name="cancel">Cancel</string>
<string name="oldpassword">Current Password</string>
<string name="newpassword">New Password</string>
<string name="changepassowrd">Change password</string>
<string name="confirmpassword">ConfirmPassowrd</string>
<string name="resetpassword">Reset Password</string>
<string name="treatment1">
• 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">
• OAntibiotic injections. And increase the fertilizer.\n\n
</string>
<string name="treatment3">
• OAntibiotic injections. And increase the fertilizer.\n\n
</string>
<string name="treatment4">
• OAntibiotic injections. And increase the fertilizer.\n\n
</string>
<string name="treatment5">
• 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
# Project-wide Gradle settings.
# IDE (e.g. Android Studio) users:
# Gradle settings configured through the IDE *will override*
# any settings specified in this file.
# For more details on how to configure your build environment visit
# http://www.gradle.org/docs/current/userguide/build_environment.html
# Specifies the JVM arguments used for the daemon process.
# The setting is particularly useful for tweaking memory settings.
org.gradle.jvmargs=-Xmx2048m -Dfile.encoding=UTF-8
# When configured, Gradle will run in incubating parallel mode.
# This option should only be used with decoupled projects. More details, visit
# http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects
# org.gradle.parallel=true
# AndroidX package structure to make it clearer which packages are bundled with the
# Android operating system, and which are packaged with your app"s APK
# https://developer.android.com/topic/libraries/support-library/androidx-rn
android.useAndroidX=true
android.enableJetifier=true
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