Commit 83089381 authored by ranthilina99's avatar ranthilina99

modify height measrement and conflit change

parents a27ef530 8226a8dd
*.iml
.gradle
/.idea/.name
/.idea/gradle.xml
/.idea/misc.xml
/.idea
/local.properties
/.idea/caches
/.idea/libraries
......
super
\ No newline at end of file
E ketha
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="GradleMigrationSettings" migrationVersion="1" />
<component name="GradleSettings">
<option name="linkedExternalProjectsSettings">
<GradleProjectSettings>
......
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="VcsDirectoryMappings">
<mapping directory="" vcs="Git" />
</component>
</project>
\ No newline at end of file
/build
\ No newline at end of file
/build
/src/main/assets/model.tflite
plugins {
id 'com.android.application'
id 'com.google.gms.google-services'
id 'com.chaquo.python'
}
android {
compileSdkVersion 32
compileSdkVersion 31
buildToolsVersion "30.0.3"
defaultConfig {
applicationId "com.example.asuper"
applicationId "com.example.eketha"
minSdkVersion 21
targetSdkVersion 32
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 {
......@@ -26,13 +59,37 @@ android {
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:+'
implementation 'androidx.appcompat:appcompat:1.5.1'
implementation 'com.google.android.material:material:1.6.1'
implementation 'androidx.constraintlayout:constraintlayout:2.1.4'
testImplementation 'junit:junit:4.+'
androidTestImplementation 'androidx.test.ext:junit:1.1.3'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.4.0'
......
{
"project_info": {
"project_number": "298794319825",
"project_id": "e-ketha-1d78c",
"storage_bucket": "e-ketha-1d78c.appspot.com"
},
"client": [
{
"client_info": {
"mobilesdk_app_id": "1:298794319825:android:655562d35cdefc6beb2af0",
"android_client_info": {
"package_name": "com.example.eketha"
}
},
"oauth_client": [
{
"client_id": "298794319825-ggpi5ip7rblgnrtjd45agcgpta9vosfu.apps.googleusercontent.com",
"client_type": 3
}
],
"api_key": [
{
"current_key": "AIzaSyDUT3ASDvnYO9wWONGaXq8VceXfKTgYYGY"
}
],
"services": {
"appinvite_service": {
"other_platform_oauth_client": [
{
"client_id": "298794319825-ggpi5ip7rblgnrtjd45agcgpta9vosfu.apps.googleusercontent.com",
"client_type": 3
}
]
}
}
}
],
"configuration_version": "1"
}
\ No newline at end of file
package com.example.eketha;
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.eketha", 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.asuper">
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="@mipmap/ic_launcher"
android:icon="@drawable/logo"
android:label="@string/app_name"
android:roundIcon="@mipmap/ic_launcher_round"
android:supportsRtl="true"
android:theme="@style/Theme.Super">
<activity android:name=".MainActivity">
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.asuper;
package com.example.eketha;
import androidx.appcompat.app.AppCompatActivity;
import android.os.Bundle;
public class MainActivity extends AppCompatActivity {
public class Admin extends AppCompatActivity {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
setContentView(R.layout.activity_admin);
}
}
\ 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
This diff is collapsed.
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.view.View;
import android.widget.Button;
import android.widget.ImageView;
import android.widget.TextView;
import org.tensorflow.lite.support.common.TensorProcessor;
import org.tensorflow.lite.support.tensorbuffer.TensorBuffer;
import java.io.FileInputStream;
import java.io.FileOutputStream;
import java.util.List;
public class GrowthDetect extends AppCompatActivity {
private TensorBuffer outputProbabilityBuffer;
private TensorProcessor probabilityProcessor;
private Bitmap bitmap,inputImage,outputImage,outputImage1;
private List<String> labels;
private TextView resulttext,resulttext2;
private Button btnTreatment, btn;
private ImageView imageView1;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_growth_detect);
imageView1 = findViewById(R.id.image2);
btnTreatment = findViewById(R.id.btnTreatment);
resulttext = findViewById(R.id.resulttext);
resulttext2 = findViewById(R.id.resulttext2);
String result = getIntent().getStringExtra("results");
resulttext.setText(result);
String det = getIntent().getStringExtra("details");
resulttext2.setText(det);
String button = getIntent().getStringExtra("button");
btnTreatment.setText(button);
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();
}
if(button.equals("Height Measurement")){
btnTreatment.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
String result2 = resulttext.getText().toString();
String treatment = "";
if(result2.equals("Rice")){
treatment="Rice";
System.out.println(result2);
} else if(result2.equals("Weed")){
treatment=getResources().getString(R.string.treatment1);
System.out.println(result2);
}
BitmapDrawable drawable = (BitmapDrawable) imageView1.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();
Intent intent2 = new Intent(GrowthDetect.this, GrowthHeight.class);
intent2.putExtra("results2", result2);
intent2.putExtra("image", filename);
startActivity(intent2);
} catch (Exception e) {
e.printStackTrace();
}
}
});
}else if(button.equals("Weed Identification")) {
{
btnTreatment.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
// Intent intent2 = new Intent(GrowthDetect.this, Weeds.class);
// startActivity(intent2);
}
});
}
}
}
}
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.annotation.NonNull;
import androidx.appcompat.app.AppCompatActivity;
import android.content.Intent;
import android.content.SharedPreferences;
import android.os.Bundle;
import android.text.InputType;
import android.util.Log;
import android.view.View;
import android.widget.Button;
import android.widget.CheckBox;
import android.widget.EditText;
import android.widget.TextView;
import android.widget.Toast;
import com.google.android.gms.tasks.OnFailureListener;
import com.google.android.gms.tasks.OnSuccessListener;
import com.google.firebase.auth.AuthResult;
import com.google.firebase.auth.FirebaseAuth;
import com.google.firebase.firestore.DocumentReference;
import com.google.firebase.firestore.DocumentSnapshot;
import com.google.firebase.firestore.FirebaseFirestore;
public class Login extends AppCompatActivity {
EditText Email, password;
Button login;
boolean valid;
FirebaseAuth fAuth;
FirebaseFirestore fStore;
TextView text2;
CheckBox remember;
SharedPreferences sharedPreferences;
SharedPreferences.Editor editor;
Boolean saveLogin;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_login);
Email = findViewById(R.id.loginemail);
password = findViewById(R.id.loginpassword);
login = findViewById(R.id.btnlogin);
text2 = findViewById(R.id.txtdonthaveacc);
fAuth = FirebaseAuth.getInstance();
fStore = FirebaseFirestore.getInstance();
remember=findViewById(R.id.rememmber_me);
password.setInputType(InputType.TYPE_CLASS_TEXT | InputType.TYPE_TEXT_VARIATION_PASSWORD);
//remember me---------------------------------------------------------------------------------------------------------------------------
sharedPreferences=getSharedPreferences("PRESS_NAME",MODE_PRIVATE);
editor=sharedPreferences.edit();
saveLogin=sharedPreferences.getBoolean("SaveLogin",true);
if (saveLogin = true) {
Email.setText(sharedPreferences.getString("Email", null));
password.setText(sharedPreferences.getString("password", null));
}
//click the signUp button----------------------------------------------------------------------------------------------------------
text2.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
startActivity(new Intent(getApplicationContext(), Register.class));
}
});
//-----------------------------------------------------------------------------------------------------------------------------------
//Click the login button------------------------------------------------------------------------------------------------------------
login.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
checkField(Email);
checkField(password);
if (valid) {
fAuth.signInWithEmailAndPassword(Email.getText().toString(), password.getText().toString()).addOnSuccessListener(new OnSuccessListener<AuthResult>() {
@Override
public void onSuccess(AuthResult authResult) {
Toast.makeText(Login.this, "Logging Successfully", Toast.LENGTH_SHORT).show();
checkUserAccessLevel(authResult.getUser().getUid());
//check the remember me checked------------------------------------------------------------------------------------------
if(remember.isChecked()){
editor.putBoolean("SaveLogin",true);
editor.putString("Email",Email.getText().toString());
editor.putString("password",password.getText().toString());
editor.commit();
Toast.makeText(Login.this, "Save Email and password", Toast.LENGTH_SHORT).show();
}else {
//Toast.makeText(Login.this, "Remember Not Save Email and password", Toast.LENGTH_SHORT).show();
}
//---------------------------------------------------------------------------------------------------------------------
}
}).addOnFailureListener(new OnFailureListener() {
@Override
public void onFailure(@NonNull Exception e) {
Toast.makeText(Login.this, "Logging Failed", Toast.LENGTH_SHORT).show();
}
});
}
}
});
//------------------------------------------------------------------------------------------------------------------------------------------
}//end the main-------------------------------------------------------------------------------------------------------------------------------
//Define the user roles user and admin-------------------------------------------------------------------------------------------------------
private void checkUserAccessLevel(String uid) {
DocumentReference df = fStore.collection("Users").document(uid);
//extract data from the users
df.get().addOnSuccessListener(new OnSuccessListener<DocumentSnapshot>() {
@Override
public void onSuccess(DocumentSnapshot documentSnapshot) {
Log.d("TAG", "onSuccess" + documentSnapshot.getData());
//identity user access level
if (documentSnapshot.getString("isAdmin") != null) {
//user admin
startActivity(new Intent(getApplicationContext(), Admin.class));
finish();
}
if (documentSnapshot.getString("isUser") != null) {
//user users
Intent i = new Intent(getApplicationContext(), MainActivity.class);
startActivity(i);
finish();
}
}
});
}//end user role-----
//check the validation------------------------------------------------------------------------------------------------------------------------
public boolean checkField(EditText textFiled) {
if (textFiled == Email) {
String val = Email.getText().toString();
String emailPattern = "[a-zA-Z0-9._-]+@[a-z]+\\.+[a-z]+";
if (val.isEmpty()) {
Email.setError("Field cannot be empty");
valid = false;
} else if (!val.matches(emailPattern)) {
Email.setError("Invalid email address");
valid = false;
} else {
Email.setError(null);
valid = true;
}
return valid;
}
else if(textFiled==password){
String val=password.getText().toString();
if (val.isEmpty()) {
password.setError("Field cannot be empty");
valid= false;
} else if (val.length()<6) {
password.setError("At least 6 characters");
valid= false;
}else {
password.setError(null);
valid= true;
}
return valid;
}
return valid;
}
@Override
protected void onStart() {
super.onStart();
if (FirebaseAuth.getInstance().getCurrentUser() != null) {
startActivity(new Intent(getApplicationContext(), MainActivity.class));
finish();
}
}//end validation
}
\ No newline at end of file
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;
import okhttp3.OkHttpClient;
import retrofit2.Retrofit;
import retrofit2.converter.gson.GsonConverterFactory;
public class NetworkClient {
private static Retrofit retrofit;
private static String BASE_URL = "www.abc.com/";
public static Retrofit getRetrofit() {
OkHttpClient okHttpClient = new OkHttpClient.Builder().build();
if (retrofit == null) {
retrofit = new Retrofit.Builder().baseUrl(BASE_URL).addConverterFactory(GsonConverterFactory.create()).client(okHttpClient).build();
}
return retrofit;
}
}
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.annotation.NonNull;
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.TextView;
import android.widget.Toast;
import com.google.android.gms.tasks.OnFailureListener;
import com.google.android.gms.tasks.OnSuccessListener;
import com.google.firebase.auth.AuthResult;
import com.google.firebase.auth.FirebaseAuth;
import com.google.firebase.auth.FirebaseUser;
import com.google.firebase.firestore.DocumentReference;
import com.google.firebase.firestore.FirebaseFirestore;
import java.util.HashMap;
import java.util.Map;
public class Register extends AppCompatActivity {
EditText fullName, password, retypePassword, Email, mobile;
Button createAccount;
boolean valid = true;
TextView text;
FirebaseAuth fAuth;
FirebaseFirestore fStory;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_register);
fAuth = FirebaseAuth.getInstance();
fStory = FirebaseFirestore.getInstance();
fullName = findViewById(R.id.registerfullName);
Email = findViewById(R.id.registeremail);
mobile = findViewById(R.id.registermobile);
password = findViewById(R.id.registerpassword);
retypePassword = findViewById(R.id.registerretypepassowrd);
createAccount = findViewById(R.id.btnregcreateaccount);
text = findViewById(R.id.txtsigiin);
createAccount.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
//Validation check-----------------------------------------------------------------------------------------------------------------------
checkField(fullName);
checkField(Email);
checkField(mobile);
checkField(password);
checkField(retypePassword);
//database input--------------------------------------------------------------------------------------------------------------------------
if (valid) {
fAuth.createUserWithEmailAndPassword(Email.getText().toString(), password.getText().toString()).addOnSuccessListener(new OnSuccessListener<AuthResult>() {
@Override
public void onSuccess(AuthResult authResult) {
FirebaseUser user = fAuth.getCurrentUser();
Toast.makeText(Register.this, "Account Created", Toast.LENGTH_SHORT).show();
DocumentReference df = fStory.collection("Users").document(user.getUid());
Map<String, Object> userInfo = new HashMap<>();
userInfo.put("FullName", fullName.getText().toString());
userInfo.put("Email", Email.getText().toString());
userInfo.put("Mobile", mobile.getText().toString());
userInfo.put("Password", password.getText().toString());
//specify if the user is admin//
userInfo.put("isUser", "1");
df.set(userInfo);
FirebaseAuth.getInstance().signOut();
//startActivity(new Intent(getApplicationContext(), MainActivity.class));
finish();
}
}).addOnFailureListener(new OnFailureListener() {
@Override
public void onFailure(@NonNull Exception e) {
Toast.makeText(Register.this, "Failed to Create Account", Toast.LENGTH_LONG).show();
}
});
}
}
});
text.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
startActivity(new Intent(getApplicationContext(), Login.class));
}
});
}
//-----------------------------------------------validation-------------------------------------------------------------------------
public boolean checkField(EditText textFiled) {
if (textFiled == fullName) {
String val = fullName.getText().toString();
if (val.isEmpty()) {
fullName.setError("Field cannot be empty");
valid = false;
} else {
fullName.setError(null);
valid = true;
}
return valid;
} else if (textFiled == Email) {
String val = Email.getText().toString();
String emailPattern = "[a-zA-Z0-9._-]+@[a-z]+\\.+[a-z]+";
if (val.isEmpty()) {
Email.setError("Field cannot be empty");
valid = false;
} else if (!val.matches(emailPattern)) {
Email.setError("Invalid email address");
valid = false;
} else {
Email.setError(null);
valid = true;
}
return valid;
} else if (textFiled == mobile) {
String val = mobile.getText().toString();
String MobilePattern = "[0-9]{10}";
if (val.isEmpty()) {
mobile.setError("Field cannot be empty");
valid = false;
} else if (!val.matches(MobilePattern)) {
mobile.setError("Invalid 10 digit mobile no ");
valid = false;
} else if (val.length()<10) {
mobile.setError("Invalid 10 digit no");
valid = false;
} else {
mobile.setError(null);
valid = true;
}
return valid;
} else if (textFiled == password) {
String val = password.getText().toString();
String passwordVal = "^" +
//"(?=.*[0-9])" + //at least 1 digit
//"(?=.*[a-z])" + //at least 1 lower case letter
//"(?=.*[A-Z])" + //at least 1 upper case letter
"(?=.*[a-zA-Z])" + //any letter
"(?=.*[@#$%^&+=])" + //at least 1 special character
"(?=\\S+$)" + //no white spaces
".{4,}" + //at least 4 characters
"$";
if (val.isEmpty()) {
password.setError("Field cannot be empty");
valid = false;
} else if (!val.matches(passwordVal)) {
password.setError("Password is too weak");
valid = false;
} else if (val.length() < 6) {
password.setError("At least 6 characters");
valid = false;
} else {
password.setError(null);
valid = true;
}
return valid;
} else if (textFiled == retypePassword) {
String val = retypePassword.getText().toString();
String val2 = password.getText().toString();
String passwordVal = "^" +
//"(?=.*[0-9])" + //at least 1 digit
//"(?=.*[a-z])" + //at least 1 lower case letter
//"(?=.*[A-Z])" + //at least 1 upper case letter
"(?=.*[a-zA-Z])" + //any letter
"(?=.*[@#$%^&+=])" + //at least 1 special character
"(?=\\S+$)" + //no white spaces
".{4,}" + //at least 4 characters
"$";
if (val.isEmpty()) {
retypePassword.setError("Field cannot be empty");
valid = false;
} else if (!val.matches(passwordVal)) {
retypePassword.setError("Password is too weak");
valid = false;
} else if (val.charAt(0)=='0') {
retypePassword.setError("At first 0 characters");
valid = false;
} else if (!val2.equals(val)) {
retypePassword.setError("Does to match the password");
valid = false;
} else {
retypePassword.setError(null);
valid = true;
}
return valid;
}
return valid;
}
}
\ 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.os.Handler;
import android.view.animation.Animation;
import android.view.animation.AnimationUtils;
import android.widget.ImageView;
import android.widget.TextView;
import com.google.firebase.auth.FirebaseAuth;
public class SplashScreen extends AppCompatActivity {
private static int SPLASH_TIME = 3000;
private ImageView image;
private TextView hi,welcome;
private Animation topanim,bottomanim;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_splash_screen);
image = findViewById(R.id.imageView);
hi = findViewById(R.id.txthi);
welcome = findViewById(R.id.txtwelcm);
//Animations
topanim = AnimationUtils.loadAnimation(this, R.anim.top_animation);
bottomanim = AnimationUtils.loadAnimation(this, R.anim.botton_animation);
image.setAnimation(topanim);
hi.setAnimation(bottomanim);
welcome.setAnimation(bottomanim);
new Handler().postDelayed(new Runnable() {
@Override
public void run() {
FirebaseAuth.getInstance().signOut();
Intent n = new Intent(SplashScreen.this, Login.class);
startActivity(n);
finish();
}
},SPLASH_TIME);
}
}
\ No newline at end of file
package com.example.eketha;
import okhttp3.MultipartBody;
import okhttp3.RequestBody;
import retrofit2.Call;
import retrofit2.http.Multipart;
import retrofit2.http.POST;
import retrofit2.http.Part;
public interface UploadApis {
@Multipart
@POST("upload")
Call<RequestBody> uploadImage(@Part MultipartBody.Part part, @Part("somedata") RequestBody requestBody);
}
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
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;
public class growthHome extends AppCompatActivity {
private LinearLayout layer1, layer2;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_growth_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(),Growth.class);
startActivity(intent);
}
});
// layer2.setOnClickListener(new View.OnClickListener() {
// @Override
// public void onClick(View view) {
// Intent intent = new Intent(getApplicationContext(),Fertilizer.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]
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)
pil_img = Image.fromarray(out_img)
buff = io.BytesIO()
pil_img.save(buff, format="JPEG")
#encode the image
img_str = base64.b64encode(buff.getvalue())
return ""+str(img_str, 'utf-8')
\ 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"?>
<set xmlns:android="http://schemas.android.com/apk/res/android">
<translate
android:duration="1500"
android:fromXDelta="0%"
android:fromYDelta="100%" />
<alpha
android:duration="1500"
android:fromAlpha="0.1"
android:toAlpha="1.0" />
</set>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<set xmlns:android="http://schemas.android.com/apk/res/android">
<translate
android:duration="2000"
android:fromXDelta="0%"
android:fromYDelta="-50%" />
<alpha
android:duration="1500"
android:fromAlpha="0.1"
android:toAlpha="1.0" />
</set>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android">
<solid android:color="@color/limegreen"/>
<corners android:radius="10dp"/>
</shape>
\ No newline at end of file
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
android:height="24dp"
android:viewportWidth="700"
android:viewportHeight="700">
<path
android:fillColor="#FF000000"
android:pathData="m416.64,383.04c-6.719,0.559 -12.879,-2.801 -19.039,-6.16 -56.562,-33.039 -104.72,-80.078 -138.32,-136.08 -6.16,-9.519 -11.762,-20.719 -9.519,-31.922 3.922,-21.281 30.801,-29.68 38.641,-49.84 7.281,-17.359 -2.238,-36.961 -13.441,-52.078 -18.48,-25.199 -42,-47.039 -68.879,-63.281 -12.883,-7.84 -26.883,-14.559 -42.004,-15.68 -67.758,-3.359 -71.68,109.76 -62.719,154 9.519,45.922 32.48,88.48 59.359,127.12 63.281,91.84 150.08,169.68 255.36,206.64 36.961,12.879 76.719,20.719 114.8,11.762 19.039,-4.481 36.961,-12.879 50.398,-27.441 13.441,-14 20.719,-34.16 17.359,-53.199 -3.359,-19.602 -16.801,-35.281 -30.238,-49.281 -19.602,-20.16 -41.441,-38.078 -64.961,-53.762 -4.481,-2.801 -8.961,-5.602 -14,-6.16 -5.602,-0.559 -10.641,2.238 -15.68,5.039 -14,7.84 -26.879,17.359 -38.078,28 -5.039,5.039 -10.641,10.078 -17.359,11.199 -0.559,0.563 -1.121,1.121 -1.68,1.121z"/>
</vector>
<vector android:height="24dp" android:tint="@color/black"
android:viewportHeight="24.0" android:viewportWidth="24.0"
android:width="24dp" xmlns:android="http://schemas.android.com/apk/res/android">
<path android:fillColor="#FF000000" android:pathData="M20,4L4,4c-1.1,0 -1.99,0.9 -1.99,2L2,18c0,1.1 0.9,2 2,2h16c1.1,0 2,-0.9 2,-2L22,6c0,-1.1 -0.9,-2 -2,-2zM20,8l-8,5 -8,-5L4,6l8,5 8,-5v2z"/>
</vector>
<vector android:height="24dp" android:tint="@color/black"
android:viewportHeight="24.0" android:viewportWidth="24.0"
android:width="24dp" xmlns:android="http://schemas.android.com/apk/res/android">
<path android:fillColor="#FF000000" android:pathData="M18,8h-1L17,6c0,-2.76 -2.24,-5 -5,-5S7,3.24 7,6v2L6,8c-1.1,0 -2,0.9 -2,2v10c0,1.1 0.9,2 2,2h12c1.1,0 2,-0.9 2,-2L20,10c0,-1.1 -0.9,-2 -2,-2zM12,17c-1.1,0 -2,-0.9 -2,-2s0.9,-2 2,-2 2,0.9 2,2 -0.9,2 -2,2zM15.1,8L8.9,8L8.9,6c0,-1.71 1.39,-3.1 3.1,-3.1 1.71,0 3.1,1.39 3.1,3.1v2z"/>
</vector>
<vector android:height="40dp" android:viewportHeight="700"
android:viewportWidth="700" android:width="40dp" xmlns:android="http://schemas.android.com/apk/res/android">
<path android:fillColor="#FF000000" android:pathData="m254.27,170.59c0,-25.391 10.086,-49.742 28.039,-67.695 17.953,-17.953 42.305,-28.043 67.695,-28.043s49.742,10.09 67.695,28.043c17.953,17.953 28.039,42.305 28.039,67.695s-10.086,49.738 -28.039,67.695c-17.953,17.953 -42.305,28.039 -67.695,28.039 -25.383,-0.027 -49.715,-10.125 -67.664,-28.07 -17.949,-17.949 -28.043,-42.285 -28.07,-67.664zM377.36,293.68h-54.703c-32.637,0.039 -63.922,13.02 -86.996,36.094 -23.074,23.074 -36.055,54.363 -36.094,86.996 0.023,18.129 7.234,35.508 20.051,48.328 12.82,12.82 30.203,20.031 48.332,20.055h164.12c18.129,-0.023 35.512,-7.234 48.332,-20.055 12.816,-12.82 20.027,-30.199 20.051,-48.328 -0.039,-32.633 -13.02,-63.922 -36.094,-86.996 -23.074,-23.074 -54.359,-36.055 -86.996,-36.094z"/>
</vector>
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android">
<solid android:color="@color/lime"/>
<corners android:radius="100dp"/>
</shape>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<shape android:shape="rectangle" xmlns:android="http://schemas.android.com/apk/res/android">
<stroke android:color="@color/green"
android:width="1dp"/>
<corners android:radius="100dp"/>
</shape>
\ 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="match_parent"
tools:context=".Admin">
</androidx.constraintlayout.widget.ConstraintLayout>
\ 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"?>
<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:gravity="center"
tools:context=".Growth">
<TextView
android:id="@+id/text"
android:layout_margin="10dp"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="IDENTIFICATION OF RICE RELATED PlANTS"
android:textAlignment="center"
android:textColor="#009688"
android:textSize="20dp" />
<ImageView
android:id="@+id/image"
android:layout_width="370sp"
android:layout_height="370sp"
android:layout_centerHorizontal="true"
android:layout_marginTop="10sp" />
<Button
android:id="@+id/btnTakePic"
android:layout_marginTop="200dp"
android:layout_width="match_parent"
android:layout_height="68dp"
android:layout_above="@id/button2"
android:layout_margin="10dp"
android:text="Open Camera"
android:textColor="#EDE8E8"
android:textSize="18sp"
android:textStyle="bold" />
<Button
android:id="@+id/btnOpenCam"
android:layout_width="match_parent"
android:layout_height="68dp"
android:layout_alignParentBottom="true"
android:layout_centerInParent="true"
android:layout_margin="10dp"
android:text="Launch Gallery"
android:textAllCaps="false"
android:textColor="#EDE8E8"
android:textSize="18sp"
android:textStyle="bold" />
<Button
android:id="@+id/btnConfirm"
android:layout_width="wrap_content"
android:layout_height="68dp"
android:layout_margin="10dp"
android:allowClickWhenDisabled="true"
android:text="Rice Identification"
android:textColor="#EDE8E8"
android:textSize="18sp"
android:textStyle="bold" />
<TextView
android:id="@+id/classitext"
android:layout_marginTop="2dp"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textAlignment="center"
android:textColor="#FFFFFF"
android:textSize="20dp" />
<TextView
android:id="@+id/treattext"
android:layout_marginTop="5dp"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Result"
android:textAlignment="center"
android:textColor="#D32F2F"
android:textSize="20dp" />
</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:orientation="vertical"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:gravity="center"
tools:context=".GrowthDetect">
<TextView
android:id="@+id/text2"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="RICE PLANT RESULT"
android:textAlignment="center"
android:textColor="#009688"
android:textSize="30dp" />
<TextView
android:id="@+id/resulttext"
android:layout_marginTop="5dp"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Result"
android:textAlignment="center"
android:textColor="#D32F2F"
android:textSize="30dp" />
<ImageView
android:id="@+id/image2"
android:layout_width="370sp"
android:layout_height="370sp"
android:layout_centerHorizontal="true"
/>
<TextView
android:id="@+id/resulttext2"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="10dp"
android:layout_marginRight="10dp"
android:text="Growth Details"
android:textAlignment="textStart"
android:textColor="#212121"
android:textSize="15dp"
android:textStyle="bold" />
<Button
android:id="@+id/btnTreatment"
android:layout_width="wrap_content"
android:layout_height="68dp"
android:layout_margin="10dp"
android:layout_marginTop="10dp"
android:textColor="#FFFFFF"
android:textSize="18sp"
android:textStyle="bold"
android:text="TREATMENTS"/>
</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"?>
<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=".growthHome">
<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="Growth Management"
android:textStyle="italic"
android:textColor="@color/black"
android:layout_marginTop="10dp"
android:layout_marginLeft="60dp"
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:background="@color/gray"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical">
<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/rice" />
<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="Rice Plant Identification"/>
</LinearLayout>
</LinearLayout>
</androidx.cardview.widget.CardView>
</LinearLayout>
\ 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
<?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=".Login">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
android:layout_marginTop="50dp"
android:layout_marginLeft="20dp"
android:layout_marginRight="20dp">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal">
<TextView
android:id="@+id/textView16"
android:layout_width="wrap_content"
android:layout_height="62dp"
android:layout_marginLeft="20dp"
android:layout_marginTop="40dp"
android:fontFamily="sans-serif-black"
android:text="@string/login"
android:textColor="#006400"
android:textSize="50dp" />
<ImageView
android:id="@+id/imageView4"
android:layout_width="129dp"
android:layout_height="122dp"
android:layout_marginLeft="40dp"
app:srcCompat="@drawable/logo" />
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="40dp"
android:orientation="vertical">
<TextView
android:id="@+id/textView3"
android:layout_width="376dp"
android:layout_height="29dp"
android:layout_margin="10dp"
android:text="@string/email"
android:textColor="@color/black"
android:textColorHint="#FFFBFB"
android:textSize="24sp" />
<EditText
android:id="@+id/loginemail"
android:layout_width="match_parent"
android:layout_height="68dp"
android:hint="@string/email"
android:inputType="textPersonName"
android:padding="16dp"
android:textColorHint="#AFA4A4"/>
<TextView
android:id="@+id/textView4"
android:layout_width="match_parent"
android:layout_marginTop="10dp"
android:layout_height="36dp"
android:text="@string/password"
android:textColor="@color/black"
android:textSize="24sp" />
<EditText
android:id="@+id/loginpassword"
android:layout_width="match_parent"
android:layout_height="68dp"
android:layout_marginTop="10dp"
android:hint="@string/password"
android:inputType="textPassword"
android:padding="16dp"
android:textColorHint="#AFA4A4" />
<CheckBox
android:id="@+id/rememmber_me"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="10dp"
android:textColor="@color/black"
android:text="@string/rememberme"
android:textColorHint="#FFFBFB"
android:textSize="18sp" />
<Button
android:id="@+id/btnlogin"
android:layout_width="match_parent"
android:layout_height="68dp"
android:layout_marginTop="10dp"
android:text="@string/login"
android:textColor="#EDE8E8"
android:textSize="18sp"/>
<TextView
android:id="@+id/txtdonthaveacc"
android:layout_width="wrap_content"
android:layout_marginTop="10dp"
android:layout_marginLeft="60dp"
android:layout_height="wrap_content"
android:text="Don't Have Account? Register"
android:textColor="@color/black"
android:textSize="18sp" />
</LinearLayout>
</LinearLayout>
</LinearLayout>
\ No newline at end of file
This diff is collapsed.
<?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"?>
<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=".Register">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="50dp"
android:layout_marginLeft="20dp"
android:layout_marginRight="20dp"
android:orientation="horizontal">
<TextView
android:id="@+id/textView20"
android:layout_width="178dp"
android:layout_height="62dp"
android:layout_marginTop="40dp"
android:fontFamily="sans-serif-black"
android:text="@string/signup"
android:textColor="#006400"
android:textSize="50dp"/>
<ImageView
android:id="@+id/imageView2"
android:layout_width="129dp"
android:layout_height="122dp"
android:layout_marginTop="4dp"
android:layout_marginLeft="40dp"
app:srcCompat="@drawable/logo" />
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="20dp"
android:layout_marginTop="30dp"
android:orientation="vertical"
android:layout_marginRight="20dp">
<EditText
android:id="@+id/registerfullName"
android:layout_width="match_parent"
android:layout_height="68dp"
android:hint="@string/fullName"
android:inputType="textPersonName"
android:padding="16dp"
android:textColor="#100E0E"
android:textColorHint="#817B7B" />
<EditText
android:id="@+id/registeremail"
android:layout_marginTop="10dp"
android:layout_width="match_parent"
android:layout_height="68dp"
android:drawableLeft="@drawable/ic_email"
android:hint="@string/email"
android:inputType="textEmailAddress"
android:padding="16dp"
android:textColor="#1E1818"
android:textColorHint="#958E8E"/>
<EditText
android:id="@+id/registermobile"
android:layout_width="match_parent"
android:layout_height="68dp"
android:layout_marginTop="10dp"
android:backgroundTint="#120F0F"
android:drawableLeft="@drawable/ic_call"
android:hint="@string/mobile"
android:inputType="phone"
android:padding="16dp"
android:textColor="#000000"
android:textColorHint="#7C7676" />
<EditText
android:id="@+id/registerpassword"
android:layout_width="match_parent"
android:layout_height="68dp"
android:layout_marginTop="10dp"
android:drawableLeft="@drawable/ic_lock"
android:hint="@string/password"
android:inputType="textPassword"
android:padding="16dp"
android:textColor="#0B0909"
android:textColorHint="#8E8282"/>
<EditText
android:id="@+id/registerretypepassowrd"
android:layout_width="match_parent"
android:layout_height="68dp"
android:layout_marginTop="10dp"
android:drawableLeft="@drawable/ic_lock"
android:hint="@string/retypepassword"
android:inputType="textPassword"
android:padding="16dp"
android:textColor="#100F0F"
android:textColorHint="#8A8080" />
<Button
android:id="@+id/btnregcreateaccount"
android:layout_width="match_parent"
android:layout_height="59dp"
android:layout_marginTop="10dp"
android:text="Create Account"
android:textColor="#E8DCDC"
android:textColorHint="#F1ECEC"
android:textSize="16dp" />
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="10dp"
android:layout_marginLeft="40dp"
android:orientation="horizontal">
<TextView
android:id="@+id/btnforgot"
android:layout_width="wrap_content"
android:layout_height="35dp"
android:layout_marginLeft="1dp"
android:layout_weight="1"
android:text="Already Have An Account?"
android:textColor="@color/black"
android:textSize="18sp" />
<TextView
android:id="@+id/txtsigiin"
android:layout_width="wrap_content"
android:layout_height="32dp"
android:text="@string/signin"
android:textColor="@color/green"
android:textSize="18sp" />
</LinearLayout>
</LinearLayout>
</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="match_parent"
android:background="@drawable/back3"
tools:context=".SplashScreen">
<ImageView
android:id="@+id/imageView"
android:layout_width="213dp"
android:layout_height="199dp"
android:layout_marginStart="10dp"
android:layout_marginTop="36dp"
android:layout_marginEnd="10dp"
android:layout_marginBottom="32dp"
android:src="@drawable/logo"
android:transitionName="logo_image"
app:layout_constraintBottom_toTopOf="@+id/txthi"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintHorizontal_bias="0.55"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
<TextView
android:id="@+id/txthi"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginTop="304dp"
android:layout_marginBottom="38dp"
android:text="WELCOME"
android:textAlignment="center"
android:textColor="@color/yellowgreen"
android:textSize="70sp"
android:transitionName="logo_text"
app:layout_constraintBottom_toTopOf="@+id/txtwelcm"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintHorizontal_bias="0.0"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/imageView" />
<TextView
android:id="@+id/txtwelcm"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="4dp"
android:fontFamily="sans-serif-condensed-medium"
android:text="E-KETHA"
android:textAlignment="center"
android:textColor="@color/yellowgreen"
android:textSize="34sp"
android:textStyle="bold"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/txthi" />
</androidx.constraintlayout.widget.ConstraintLayout>
\ 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
<resources xmlns:tools="http://schemas.android.com/tools">
<!-- Base application theme. -->
<style name="Theme.Super" parent="Theme.MaterialComponents.DayNight.DarkActionBar">
<style name="Theme.EKetha" parent="Theme.MaterialComponents.DayNight.NoActionBar">
<!-- Primary brand color. -->
<item name="colorPrimary">@color/purple_200</item>
<item name="colorPrimaryVariant">@color/purple_700</item>
<item name="colorPrimary">@color/green</item>
<item name="colorPrimaryVariant">@color/green</item>
<item name="colorOnPrimary">@color/black</item>
<!-- Secondary brand color. -->
<item name="colorSecondary">@color/teal_200</item>
......
<?xml version="1.0" encoding="utf-8"?>
<resources>
<color name="purple_200">#FFBB86FC</color>
<color name="purple_500">#FF6200EE</color>
<color name="purple_700">#FF3700B3</color>
<color name="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>
<color name="white">#FFFFFFFF</color>
</resources>
\ No newline at end of file
<resources>
<string name="app_name">super</string>
</resources>
\ No newline at end of file
<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>
<resources xmlns:tools="http://schemas.android.com/tools">
<!-- Base application theme. -->
<style name="Theme.Super" parent="Theme.MaterialComponents.DayNight.DarkActionBar">
<style name="Theme.EKetha" parent="Theme.MaterialComponents.DayNight.NoActionBar">
<!-- Primary brand color. -->
<item name="colorPrimary">@color/purple_500</item>
<item name="colorPrimaryVariant">@color/purple_700</item>
<item name="colorPrimary">@color/green</item>
<item name="colorPrimaryVariant">@color/green</item>
<item name="colorOnPrimary">@color/white</item>
<!-- Secondary brand color. -->
<item name="colorSecondary">@color/teal_200</item>
......
<?xml version="1.0" encoding="utf-8"?>
<paths xmlns:android="http://schemas.android.com/apk/res/android">
<external-path
name="project_images"
path="Pictures/"/>
</paths>
\ No newline at end of file
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
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