App Version 0.0.3
Added All File Access Permission and Modified the All Android Permission for Api 30. App Working on android 11 Devices .
This commit is contained in:
@@ -42,6 +42,7 @@ dependencies {
|
|||||||
implementation 'com.google.firebase:firebase-database:20.0.1'
|
implementation 'com.google.firebase:firebase-database:20.0.1'
|
||||||
testImplementation 'junit:junit:4.+'
|
testImplementation 'junit:junit:4.+'
|
||||||
implementation 'com.google.firebase:firebase-database:19.5.1'
|
implementation 'com.google.firebase:firebase-database:19.5.1'
|
||||||
|
implementation 'com.opencsv:opencsv:4.6'
|
||||||
|
|
||||||
|
|
||||||
androidTestImplementation 'androidx.test.ext:junit:1.1.3'
|
androidTestImplementation 'androidx.test.ext:junit:1.1.3'
|
||||||
|
|||||||
@@ -1,7 +1,10 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
|
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
xmlns:tools="http://schemas.android.com/tools"
|
||||||
package="com.smi.SickleCell">
|
package="com.smi.SickleCell">
|
||||||
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/>
|
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/>
|
||||||
|
<uses-permission android:name="android.permission.QUERY_ALL_PACKAGES" tools:ignore="QueryAllPackagesPermission" />
|
||||||
|
<uses-permission android:name="android.permission.MANAGE_EXTERNAL_STORAGE" />
|
||||||
|
|
||||||
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
|
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
|
||||||
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
|
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
|
||||||
|
|||||||
@@ -12,15 +12,21 @@ import android.content.ContentValues;
|
|||||||
import android.content.Intent;
|
import android.content.Intent;
|
||||||
import android.content.SharedPreferences;
|
import android.content.SharedPreferences;
|
||||||
import android.content.pm.PackageManager;
|
import android.content.pm.PackageManager;
|
||||||
|
import android.graphics.Color;
|
||||||
import android.net.Uri;
|
import android.net.Uri;
|
||||||
import android.os.Bundle;
|
import android.os.Bundle;
|
||||||
import android.os.Environment;
|
import android.os.Environment;
|
||||||
|
import android.provider.Settings;
|
||||||
import android.util.Log;
|
import android.util.Log;
|
||||||
|
import android.view.Gravity;
|
||||||
import android.view.View;
|
import android.view.View;
|
||||||
import android.widget.AdapterView;
|
import android.widget.AdapterView;
|
||||||
import android.widget.ArrayAdapter;
|
import android.widget.ArrayAdapter;
|
||||||
import android.widget.Button;
|
import android.widget.Button;
|
||||||
|
import android.widget.RelativeLayout;
|
||||||
import android.widget.Spinner;
|
import android.widget.Spinner;
|
||||||
|
import android.widget.TableLayout;
|
||||||
|
import android.widget.TableRow;
|
||||||
import android.widget.TextView;
|
import android.widget.TextView;
|
||||||
import android.widget.Toast;
|
import android.widget.Toast;
|
||||||
|
|
||||||
@@ -28,10 +34,13 @@ import com.google.android.gms.tasks.OnCompleteListener;
|
|||||||
import com.google.android.gms.tasks.Task;
|
import com.google.android.gms.tasks.Task;
|
||||||
import com.google.firebase.database.DatabaseReference;
|
import com.google.firebase.database.DatabaseReference;
|
||||||
import com.google.firebase.database.FirebaseDatabase;
|
import com.google.firebase.database.FirebaseDatabase;
|
||||||
|
import com.opencsv.CSVReader;
|
||||||
|
|
||||||
import java.io.BufferedReader;
|
import java.io.BufferedReader;
|
||||||
import java.io.File;
|
import java.io.File;
|
||||||
import java.io.FileInputStream;
|
import java.io.FileInputStream;
|
||||||
|
import java.io.FileNotFoundException;
|
||||||
|
import java.io.FileReader;
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
import java.io.InputStream;
|
import java.io.InputStream;
|
||||||
import java.io.InputStreamReader;
|
import java.io.InputStreamReader;
|
||||||
@@ -39,27 +48,34 @@ import java.text.SimpleDateFormat;
|
|||||||
import java.util.Calendar;
|
import java.util.Calendar;
|
||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
|
|
||||||
public class MainActivity extends AppCompatActivity implements AdapterView.OnItemSelectedListener{
|
public class MainActivity extends AppCompatActivity implements AdapterView.OnItemSelectedListener {
|
||||||
private Button confirmatory,screening;
|
private Button confirmatory, screening;
|
||||||
|
|
||||||
private static final int REQUEST_CODE_PICK_FILE = 300;
|
private static final int REQUEST_CODE_PICK_FILE = 300;
|
||||||
String FilePath;
|
String FilePath;
|
||||||
private TextView result;
|
private TextView result;
|
||||||
float number1;
|
float number1;
|
||||||
float number2;
|
float number2;
|
||||||
private String TestRandomKey,saveCurrentDate, saveCurrentTime;
|
private String TestRandomKey, saveCurrentDate, saveCurrentTime;
|
||||||
private DatabaseReference TestRef;
|
private DatabaseReference TestRef;
|
||||||
private TextView result_confirmatory;
|
private TextView result_confirmatory;
|
||||||
String device;
|
String device;
|
||||||
String result_test;
|
String result_test;
|
||||||
String result_test1;
|
String result_test1;
|
||||||
String targetUri;
|
String targetUri;
|
||||||
|
TextView Type;
|
||||||
|
String line;
|
||||||
|
TableLayout table;
|
||||||
|
RelativeLayout relativeLayout1;
|
||||||
|
String Extension;
|
||||||
|
|
||||||
String directory_path;
|
String directory_path;
|
||||||
float value;
|
float value;
|
||||||
int flag=0;
|
int columnCount = 0;
|
||||||
|
int flag = 0;
|
||||||
|
String serial_no, sample_name, numbers1, numbers2, ratios, resultsamp;
|
||||||
|
|
||||||
File file=null;
|
File file = null;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void onCreate(Bundle savedInstanceState) {
|
protected void onCreate(Bundle savedInstanceState) {
|
||||||
@@ -68,24 +84,31 @@ public class MainActivity extends AppCompatActivity implements AdapterView.OnIt
|
|||||||
setContentView(R.layout.activity_main);
|
setContentView(R.layout.activity_main);
|
||||||
String directory_path = Environment.getExternalStorageDirectory().getPath() + "/SickleCell/";
|
String directory_path = Environment.getExternalStorageDirectory().getPath() + "/SickleCell/";
|
||||||
|
|
||||||
screening=findViewById(R.id.screening);
|
screening = findViewById(R.id.screening);
|
||||||
confirmatory=findViewById(R.id.confirmatory);
|
confirmatory = findViewById(R.id.confirmatory);
|
||||||
|
relativeLayout1 = findViewById(R.id.RelativeLayout1);
|
||||||
|
table = findViewById(R.id.table_main);
|
||||||
TestRef = FirebaseDatabase.getInstance().getReference().child("Test_Data");
|
TestRef = FirebaseDatabase.getInstance().getReference().child("Test_Data");
|
||||||
|
Type = findViewById(R.id.type);
|
||||||
AppCompatDelegate.setDefaultNightMode(AppCompatDelegate.MODE_NIGHT_YES);
|
AppCompatDelegate.setDefaultNightMode(AppCompatDelegate.MODE_NIGHT_YES);
|
||||||
Spinner Spinner_gender = findViewById(R.id.spinner_device);
|
Spinner Spinner_type = findViewById(R.id.spinner_device);
|
||||||
ArrayAdapter<CharSequence> adapter = ArrayAdapter.createFromResource(this,
|
ArrayAdapter<CharSequence> adapter = ArrayAdapter.createFromResource(this,
|
||||||
R.array.instrument, android.R.layout.simple_spinner_item);
|
R.array.instrument, android.R.layout.simple_spinner_item);
|
||||||
adapter.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item);
|
adapter.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item);
|
||||||
Spinner_gender.setAdapter(adapter);
|
Spinner_type.setAdapter(adapter);
|
||||||
Spinner_gender.setOnItemSelectedListener(this);
|
Spinner_type.setOnItemSelectedListener(this);
|
||||||
result=findViewById(R.id.result);
|
result = findViewById(R.id.result);
|
||||||
result_confirmatory=findViewById(R.id.result_confirmatory);
|
result_confirmatory = findViewById(R.id.result_confirmatory);
|
||||||
|
if (!Environment.isExternalStorageManager()) {
|
||||||
|
Intent intent = new Intent();
|
||||||
|
intent.setAction(Settings.ACTION_MANAGE_APP_ALL_FILES_ACCESS_PERMISSION);
|
||||||
|
Uri uri = Uri.fromParts("package", this.getPackageName(), null);
|
||||||
|
intent.setData(uri);
|
||||||
|
startActivity(intent);
|
||||||
|
}
|
||||||
|
if (ContextCompat.checkSelfPermission(this, Manifest.permission.WRITE_EXTERNAL_STORAGE) != PackageManager.PERMISSION_GRANTED) {
|
||||||
|
|
||||||
if(ContextCompat.checkSelfPermission(this, Manifest.permission.WRITE_EXTERNAL_STORAGE)!= PackageManager.PERMISSION_GRANTED)
|
ActivityCompat.requestPermissions(this, new String[]{Manifest.permission.WRITE_EXTERNAL_STORAGE}, 23);
|
||||||
{
|
|
||||||
|
|
||||||
ActivityCompat.requestPermissions(this,new String[]{Manifest.permission.WRITE_EXTERNAL_STORAGE},23);
|
|
||||||
|
|
||||||
|
|
||||||
directory_path = Environment.getExternalStorageDirectory().getPath() + "/SickleCell/";
|
directory_path = Environment.getExternalStorageDirectory().getPath() + "/SickleCell/";
|
||||||
@@ -95,7 +118,7 @@ public class MainActivity extends AppCompatActivity implements AdapterView.OnIt
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (ContextCompat.checkSelfPermission(this, Manifest.permission.READ_EXTERNAL_STORAGE) == PackageManager.PERMISSION_GRANTED) {
|
if (ContextCompat.checkSelfPermission(this, Manifest.permission.READ_EXTERNAL_STORAGE) == PackageManager.PERMISSION_GRANTED) {
|
||||||
directory_path = Environment.getExternalStorageDirectory().getPath() + "/SickleCell/";
|
directory_path = Environment.getExternalStorageDirectory().getPath() + "/SickleCell/";
|
||||||
File file = new File(directory_path);
|
File file = new File(directory_path);
|
||||||
if (!file.exists()) {
|
if (!file.exists()) {
|
||||||
file.mkdirs();
|
file.mkdirs();
|
||||||
@@ -114,13 +137,7 @@ public class MainActivity extends AppCompatActivity implements AdapterView.OnIt
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
directory_path = Environment.getExternalStorageDirectory().getPath() + "/SickleCell/";
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
directory_path = Environment.getExternalStorageDirectory().getPath() + "/SickleCell/";
|
|
||||||
file = new File(directory_path);
|
file = new File(directory_path);
|
||||||
if (!file.exists()) {
|
if (!file.exists()) {
|
||||||
file.mkdirs();
|
file.mkdirs();
|
||||||
@@ -129,7 +146,7 @@ public class MainActivity extends AppCompatActivity implements AdapterView.OnIt
|
|||||||
screening.setOnClickListener(new View.OnClickListener() {
|
screening.setOnClickListener(new View.OnClickListener() {
|
||||||
@Override
|
@Override
|
||||||
public void onClick(View v) {
|
public void onClick(View v) {
|
||||||
flag=1;
|
flag = 1;
|
||||||
createfolder();
|
createfolder();
|
||||||
|
|
||||||
selectCSVFile();
|
selectCSVFile();
|
||||||
@@ -140,7 +157,7 @@ public class MainActivity extends AppCompatActivity implements AdapterView.OnIt
|
|||||||
confirmatory.setOnClickListener(new View.OnClickListener() {
|
confirmatory.setOnClickListener(new View.OnClickListener() {
|
||||||
@Override
|
@Override
|
||||||
public void onClick(View v) {
|
public void onClick(View v) {
|
||||||
flag=2;
|
flag = 2;
|
||||||
createfolder();
|
createfolder();
|
||||||
|
|
||||||
selectCSVFile();
|
selectCSVFile();
|
||||||
@@ -149,22 +166,19 @@ public class MainActivity extends AppCompatActivity implements AdapterView.OnIt
|
|||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private void selectCSVFile(){
|
private void selectCSVFile() {
|
||||||
if (ContextCompat.checkSelfPermission(MainActivity.this, Manifest.permission.WRITE_EXTERNAL_STORAGE) != PackageManager.PERMISSION_GRANTED) {
|
if (ContextCompat.checkSelfPermission(MainActivity.this, Manifest.permission.WRITE_EXTERNAL_STORAGE) != PackageManager.PERMISSION_GRANTED) {
|
||||||
|
|
||||||
ActivityCompat.requestPermissions(MainActivity.this, new String[]{Manifest.permission.WRITE_EXTERNAL_STORAGE}, 23);
|
ActivityCompat.requestPermissions(MainActivity.this, new String[]{Manifest.permission.WRITE_EXTERNAL_STORAGE}, 23);
|
||||||
}
|
}
|
||||||
Uri uri = Uri.parse((Environment.getExternalStorageDirectory().getPath() + "/SickleCell/"));
|
Uri uri = Uri.parse((Environment.getExternalStorageDirectory().getPath() + "/SickleCell/"));
|
||||||
Intent intent = new Intent(Intent.ACTION_GET_CONTENT);
|
Intent intent = new Intent(Intent.ACTION_GET_CONTENT);
|
||||||
intent.setDataAndType(uri, "*/*");
|
intent.setDataAndType(uri, "*/*");
|
||||||
|
|
||||||
// intent.setType("*/*");
|
// intent.setType("*/*");
|
||||||
startActivityForResult(intent,REQUEST_CODE_PICK_FILE);
|
startActivityForResult(intent, REQUEST_CODE_PICK_FILE);
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -179,299 +193,403 @@ public class MainActivity extends AppCompatActivity implements AdapterView.OnIt
|
|||||||
if (resultCode == RESULT_OK) {
|
if (resultCode == RESULT_OK) {
|
||||||
|
|
||||||
|
|
||||||
Log.e("file",data.getData().getPath());
|
Log.e("file", data.getData().getPath());
|
||||||
|
|
||||||
FilePath = data.getData().getPath();
|
FilePath = data.getData().getPath();
|
||||||
Log.e("Filepath",FilePath);
|
Log.e("Filepath", FilePath);
|
||||||
|
|
||||||
String filename1=FilePath.substring(FilePath.lastIndexOf("/")+1);
|
String filename1 = FilePath.substring(FilePath.lastIndexOf("/") + 1);
|
||||||
|
|
||||||
Log.e("file",filename1);
|
Log.e("file", filename1);
|
||||||
|
Extension = FilePath.substring(FilePath.lastIndexOf("."));
|
||||||
|
Log.e("Entension ", Extension);
|
||||||
|
|
||||||
String s = FilePath;
|
String s = FilePath;
|
||||||
|
|
||||||
directory_path = Environment.getExternalStorageDirectory().getPath() + "/SickleCell/";
|
directory_path = Environment.getExternalStorageDirectory().getPath() + "/SickleCell/";
|
||||||
targetUri = directory_path+filename1;
|
targetUri = directory_path + filename1;
|
||||||
|
if (!Extension.contains("csv")) {
|
||||||
|
Type.setText("Wrong file Format");
|
||||||
|
result.setText("");
|
||||||
|
Type.setTextColor(Color.RED);
|
||||||
|
|
||||||
if(flag==1)
|
result_confirmatory.setText("");
|
||||||
{
|
} else if (flag == 1) {
|
||||||
ImportCSV(new File(targetUri));
|
ImportCSV(new File(targetUri));
|
||||||
|
|
||||||
}
|
} else if (flag == 2) {
|
||||||
else if(flag==2)
|
|
||||||
{
|
|
||||||
ImportCSV2(new File(targetUri));
|
ImportCSV2(new File(targetUri));
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private void ImportCSV(File from) {
|
private void ImportCSV(File from) {
|
||||||
ContentValues cv = new ContentValues();
|
|
||||||
result_confirmatory.setText("");
|
result_confirmatory.setText("");
|
||||||
result.setText("");
|
result.setText("");
|
||||||
try {
|
value = 0;
|
||||||
|
number1 = 0;
|
||||||
|
number2 = 0;
|
||||||
|
resultsamp = "";
|
||||||
|
table.removeAllViews();
|
||||||
|
try {
|
||||||
|
CSVReader reader = new CSVReader(new FileReader(from));
|
||||||
|
String[] line;
|
||||||
InputStream inputStream = new FileInputStream(from);
|
InputStream inputStream = new FileInputStream(from);
|
||||||
BufferedReader br = new BufferedReader(new InputStreamReader(inputStream));
|
BufferedReader br = new BufferedReader(new InputStreamReader(inputStream));
|
||||||
|
String[] header = reader.readNext(); // assuming first read
|
||||||
|
if (header != null) { // and there is a (header) line
|
||||||
String line;
|
columnCount = header.length; // get the column count
|
||||||
if(device.equals("TestRight"))
|
|
||||||
{
|
|
||||||
result_confirmatory.setText("");
|
|
||||||
result.setText("");
|
|
||||||
Log.e("device", "Test right");
|
|
||||||
|
|
||||||
while ((line = br.readLine()) != null) {
|
|
||||||
String[] values = line.split(",");
|
|
||||||
if (values[0].equals("427.084")) {
|
|
||||||
|
|
||||||
number1 = Float.parseFloat(String.valueOf(values[1]));
|
|
||||||
|
|
||||||
Log.e("number1", String.valueOf(number1));
|
|
||||||
|
|
||||||
|
|
||||||
}
|
|
||||||
else if(values[0].equals("555.035"))
|
|
||||||
{
|
|
||||||
number2 = Float.parseFloat(String.valueOf(values[1]));
|
|
||||||
Log.e("number2", String.valueOf(number2));
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
}
|
|
||||||
value= number2/number1;
|
|
||||||
|
|
||||||
|
|
||||||
Log.e("value",String.valueOf(value));
|
|
||||||
if(value<0.16)
|
|
||||||
{
|
|
||||||
result_confirmatory.setText("");
|
|
||||||
result.setText("Negative");
|
|
||||||
result_test=result.getText().toString();
|
|
||||||
result_test1=result_confirmatory.getText().toString();
|
|
||||||
SaveTestInfoToDatabase();
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
result.setText("Positive");
|
|
||||||
result_confirmatory.setText("");
|
|
||||||
result_test=result.getText().toString();
|
|
||||||
result_test1=result_confirmatory.getText().toString();
|
|
||||||
SaveTestInfoToDatabase();
|
|
||||||
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
Log.e("columc", String.valueOf(columnCount));
|
||||||
|
|
||||||
|
|
||||||
|
if (device.equals("TestRight")) {
|
||||||
|
|
||||||
else if (device.equals("Denovix"))
|
|
||||||
{
|
|
||||||
result_confirmatory.setText("");
|
result_confirmatory.setText("");
|
||||||
result.setText("");
|
result.setText("");
|
||||||
|
resultsamp = "";
|
||||||
|
|
||||||
|
Type.setText(" Select Test Type * ");
|
||||||
|
Type.setTextColor(Color.WHITE);
|
||||||
|
|
||||||
|
if (columnCount > 100) {
|
||||||
|
Type.setText("Wrong File");
|
||||||
|
Type.setTextColor(Color.RED);
|
||||||
|
|
||||||
|
} else {
|
||||||
|
|
||||||
|
|
||||||
|
Log.e("device", "Test right");
|
||||||
|
while ((line = reader.readNext()) != null) {
|
||||||
|
|
||||||
|
|
||||||
|
String[] values = line;
|
||||||
|
|
||||||
|
if (values[0].equals("427.084")) {
|
||||||
|
number1 = Float.parseFloat(String.valueOf(values[1]));
|
||||||
|
Log.e("number1", String.valueOf(number1));
|
||||||
|
|
||||||
|
|
||||||
|
} else if (values[0].equals("555.035")) {
|
||||||
|
number2 = Float.parseFloat(String.valueOf(values[1]));
|
||||||
|
Log.e("number2", String.valueOf(number2));
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
if (number1 != 0 || number2 != 0) {
|
||||||
|
|
||||||
|
|
||||||
|
value = number2 / number1;
|
||||||
|
Log.e("value", String.valueOf(value));
|
||||||
|
if (value < 0.16 || value == 0.0) {
|
||||||
|
result.setText("Negative");
|
||||||
|
result_test = result.getText().toString();
|
||||||
|
result_test1 = result_confirmatory.getText().toString();
|
||||||
|
|
||||||
|
} else {
|
||||||
|
result.setText("Positive");
|
||||||
|
result_test = result.getText().toString();
|
||||||
|
result_test1 = result_confirmatory.getText().toString();
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
} else {
|
||||||
|
result_confirmatory.setText("");
|
||||||
|
result.setText("");
|
||||||
|
Type.setText("Wrong File");
|
||||||
|
Type.setTextColor(Color.RED);
|
||||||
|
|
||||||
|
value = 0;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
} else if (device.equals("Denovix")) {
|
||||||
|
result_confirmatory.setText("");
|
||||||
|
result.setText("");
|
||||||
|
result_confirmatory.setText("");
|
||||||
|
result.setText("");
|
||||||
|
Type.setText(" Select Test Type * ");
|
||||||
|
Type.setTextColor(Color.WHITE);
|
||||||
|
resultsamp = "";
|
||||||
|
|
||||||
Log.e("device", "denovix");
|
Log.e("device", "denovix");
|
||||||
|
|
||||||
while ((line = br.readLine()) != null) {
|
if (columnCount < 100) {
|
||||||
String[] values = line.split(",");
|
result_confirmatory.setText("");
|
||||||
if (values[2].equals("427.084")) {
|
result.setText("");
|
||||||
|
Type.setText("Wrong file");
|
||||||
|
Type.setTextColor(Color.RED);
|
||||||
|
|
||||||
number1 = Float.parseFloat(String.valueOf(values[3]));
|
} else {
|
||||||
|
|
||||||
Log.e("number1", String.valueOf(number1));
|
init1();
|
||||||
|
|
||||||
|
|
||||||
|
while ((line = reader.readNext()) != null) {
|
||||||
|
|
||||||
|
String[] values = line;
|
||||||
|
|
||||||
|
|
||||||
|
if (values[1].equals("Blank")) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
if ((values[262].replaceAll("[^\\d.]", "")).equals("427") || (values[390].replaceAll("[^\\d.]", "")).equals("555")) {
|
||||||
|
continue; //just skip the rows if row number is 0 or 1
|
||||||
|
|
||||||
|
} else {
|
||||||
|
number1 = Float.parseFloat(String.valueOf(values[262].replaceAll("[^\\d.]", "")));
|
||||||
|
Log.e("number1", String.valueOf(number1));
|
||||||
|
number2 = Float.parseFloat(String.valueOf(values[390]).replaceAll("[^\\d.]", ""));
|
||||||
|
Log.e("number2", String.valueOf(number2));
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
if (number1 != 0 || number2 != 0) {
|
||||||
|
|
||||||
|
value = number2 / number1;
|
||||||
|
Log.e("value", String.valueOf(value));
|
||||||
|
if (value < 0.16 || value == 0.0) {
|
||||||
|
resultsamp = "Negative";
|
||||||
|
|
||||||
|
} else {
|
||||||
|
resultsamp = "Positive";
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
} else if (columnCount < 100) {
|
||||||
|
result_confirmatory.setText("");
|
||||||
|
result.setText("");
|
||||||
|
Type.setText("Wrong file");
|
||||||
|
Type.setTextColor(Color.RED);
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
serial_no = values[0];
|
||||||
|
sample_name = values[1];
|
||||||
|
numbers1 = values[262];
|
||||||
|
numbers2 = values[390];
|
||||||
|
ratios = String.valueOf(value);
|
||||||
|
init(serial_no, sample_name, ratios, resultsamp);
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
else if(values[2].equals("555.035"))
|
|
||||||
{
|
|
||||||
number2 = Float.parseFloat(String.valueOf(values[3]));
|
|
||||||
Log.e("number2", String.valueOf(number2));
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
}
|
|
||||||
value=number2/number1;
|
|
||||||
Log.e("value",String.valueOf(value));
|
|
||||||
if(value<0.16)
|
|
||||||
{
|
|
||||||
result.setText("Negative");
|
|
||||||
result_test=result.getText().toString();
|
|
||||||
result_test1=result_confirmatory.getText().toString();
|
|
||||||
SaveTestInfoToDatabase();
|
|
||||||
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
result.setText("Positive");
|
|
||||||
result_test=result.getText().toString();
|
|
||||||
result_test1=result_confirmatory.getText().toString();
|
|
||||||
SaveTestInfoToDatabase();
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
} catch (IOException ex) {
|
} catch (IOException ex) {
|
||||||
|
|
||||||
throw new RuntimeException("Error in reading CSV file: " + ex);
|
throw new RuntimeException("Error in reading CSV file: " + ex);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private void ImportCSV2(File from) {
|
private void ImportCSV2(File from) {
|
||||||
result_confirmatory.setText("");
|
result_confirmatory.setText("");
|
||||||
result.setText("");
|
result.setText("");
|
||||||
|
value = 0;
|
||||||
|
number1 = 0;
|
||||||
|
number2 = 0;
|
||||||
|
table.removeAllViews();
|
||||||
try {
|
try {
|
||||||
|
CSVReader reader = new CSVReader(new FileReader(from));
|
||||||
|
String[] line;
|
||||||
InputStream inputStream = new FileInputStream(from);
|
InputStream inputStream = new FileInputStream(from);
|
||||||
BufferedReader br = new BufferedReader(new InputStreamReader(inputStream));
|
BufferedReader br = new BufferedReader(new InputStreamReader(inputStream));
|
||||||
|
String[] header = reader.readNext(); // assuming first read
|
||||||
|
if (header != null) { // and there is a (header) line
|
||||||
String line;
|
columnCount = header.length; // get the column count
|
||||||
if(device.equals("TestRight"))
|
|
||||||
{
|
|
||||||
result_confirmatory.setText("");
|
|
||||||
result.setText("");
|
|
||||||
Log.e("device", "Test right");
|
|
||||||
|
|
||||||
while ((line = br.readLine()) != null) {
|
|
||||||
String[] values = line.split(",");
|
|
||||||
|
|
||||||
if (values[0].equals("427.084")) {
|
|
||||||
number1 = Float.parseFloat(String.valueOf(values[1]));
|
|
||||||
Log.e("number1", String.valueOf(number1));
|
|
||||||
|
|
||||||
|
|
||||||
}
|
|
||||||
else if(values[0].equals("555.035"))
|
|
||||||
{
|
|
||||||
number2 = Float.parseFloat(String.valueOf(values[1]));
|
|
||||||
Log.e("number2", String.valueOf(number2));
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
}
|
|
||||||
value=number2/number1;
|
|
||||||
Log.e("value",String.valueOf(value));
|
|
||||||
if(value<0.16)
|
|
||||||
{
|
|
||||||
result.setText("Negative");
|
|
||||||
result_test=result.getText().toString();
|
|
||||||
result_test1=result_confirmatory.getText().toString();
|
|
||||||
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
result.setText("Positive");
|
|
||||||
result_test=result.getText().toString();
|
|
||||||
result_test1=result_confirmatory.getText().toString();
|
|
||||||
|
|
||||||
|
|
||||||
}
|
|
||||||
if(value>=0.16 && value < 0.24)
|
|
||||||
{
|
|
||||||
result_confirmatory.setText("Sickle Cell Trait");
|
|
||||||
result_test=result.getText().toString();
|
|
||||||
result_test1=result_confirmatory.getText().toString();
|
|
||||||
SaveTestInfoToDatabase();
|
|
||||||
|
|
||||||
}
|
|
||||||
else if( value >=0.24)
|
|
||||||
{
|
|
||||||
result_confirmatory.setText("Sickle-Cell Disease");
|
|
||||||
result_test=result.getText().toString();
|
|
||||||
result_test1=result_confirmatory.getText().toString();
|
|
||||||
SaveTestInfoToDatabase();
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
Log.e("columc", String.valueOf(columnCount));
|
||||||
|
|
||||||
|
|
||||||
|
if (device.equals("TestRight")) {
|
||||||
|
resultsamp = "";
|
||||||
|
|
||||||
else if (device.equals("Denovix"))
|
|
||||||
{
|
|
||||||
result_confirmatory.setText("");
|
result_confirmatory.setText("");
|
||||||
result.setText("");
|
result.setText("");
|
||||||
|
Type.setText(" Select Test Type * ");
|
||||||
|
Type.setTextColor(Color.WHITE);
|
||||||
|
|
||||||
|
if (columnCount > 100) {
|
||||||
|
Type.setText("Wrong File");
|
||||||
|
Type.setTextColor(Color.RED);
|
||||||
|
|
||||||
|
|
||||||
|
} else {
|
||||||
|
|
||||||
|
|
||||||
|
Log.e("device", "Test right");
|
||||||
|
while ((line = reader.readNext()) != null) {
|
||||||
|
|
||||||
|
|
||||||
|
String[] values = line;
|
||||||
|
|
||||||
|
if (values[0].equals("427.084")) {
|
||||||
|
number1 = Float.parseFloat(String.valueOf(values[1]));
|
||||||
|
Log.e("number1", String.valueOf(number1));
|
||||||
|
|
||||||
|
|
||||||
|
} else if (values[0].equals("555.035")) {
|
||||||
|
number2 = Float.parseFloat(String.valueOf(values[1]));
|
||||||
|
Log.e("number2", String.valueOf(number2));
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
if (number1 != 0 || number2 != 0) {
|
||||||
|
|
||||||
|
|
||||||
|
value = number2 / number1;
|
||||||
|
Log.e("value", String.valueOf(value));
|
||||||
|
if (value < 0.16 || value == 0.0) {
|
||||||
|
result.setText("Negative");
|
||||||
|
result_test = result.getText().toString();
|
||||||
|
result_test1 = result_confirmatory.getText().toString();
|
||||||
|
|
||||||
|
} else {
|
||||||
|
result.setText("Positive");
|
||||||
|
result_test = result.getText().toString();
|
||||||
|
result_test1 = result_confirmatory.getText().toString();
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
if (value >= 0.16 && value < 0.24) {
|
||||||
|
result_confirmatory.setText("Sickle Cell Trait");
|
||||||
|
result_test = result.getText().toString();
|
||||||
|
result_test1 = result_confirmatory.getText().toString();
|
||||||
|
|
||||||
|
} else if (value >= 0.24) {
|
||||||
|
result_confirmatory.setText("Sickle-Cell Disease");
|
||||||
|
result_test = result.getText().toString();
|
||||||
|
result_test1 = result_confirmatory.getText().toString();
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
result_confirmatory.setText("");
|
||||||
|
result.setText("");
|
||||||
|
Type.setText("Wrong File");
|
||||||
|
Type.setTextColor(Color.RED);
|
||||||
|
|
||||||
|
value = 0;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
} else if (device.equals("Denovix")) {
|
||||||
|
resultsamp = "";
|
||||||
|
|
||||||
|
result_confirmatory.setText("");
|
||||||
|
result.setText("");
|
||||||
|
result_confirmatory.setText("");
|
||||||
|
result.setText("");
|
||||||
|
Type.setText(" Select Test Type * ");
|
||||||
|
Type.setTextColor(Color.WHITE);
|
||||||
|
|
||||||
Log.e("device", "denovix");
|
Log.e("device", "denovix");
|
||||||
|
|
||||||
while ((line = br.readLine()) != null) {
|
if (columnCount < 100) {
|
||||||
String[] values = line.split(",");
|
result_confirmatory.setText("");
|
||||||
if (values[2].equals("427.084")) {
|
result.setText("");
|
||||||
number1 = Float.parseFloat(String.valueOf(values[3]));
|
Type.setText("Wrong file");
|
||||||
Log.e("number1", String.valueOf(number1));
|
Type.setTextColor(Color.RED);
|
||||||
|
|
||||||
|
} else {
|
||||||
|
|
||||||
|
init1();
|
||||||
|
|
||||||
|
|
||||||
|
while ((line = reader.readNext()) != null) {
|
||||||
|
|
||||||
|
String[] values = line;
|
||||||
|
|
||||||
|
|
||||||
|
if (values[1].equals("Blank")) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
if ((values[262].replaceAll("[^\\d.]", "")).equals("427") || (values[390].replaceAll("[^\\d.]", "")).equals("555")) {
|
||||||
|
continue; //just skip the rows if row number is 0 or 1
|
||||||
|
|
||||||
|
} else {
|
||||||
|
number1 = Float.parseFloat(String.valueOf(values[262].replaceAll("[^\\d.]", "")));
|
||||||
|
Log.e("number1", String.valueOf(number1));
|
||||||
|
number2 = Float.parseFloat(String.valueOf(values[390]).replaceAll("[^\\d.]", ""));
|
||||||
|
Log.e("number2", String.valueOf(number2));
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
if (number1 != 0 || number2 != 0) {
|
||||||
|
|
||||||
|
value = number2 / number1;
|
||||||
|
Log.e("value", String.valueOf(value));
|
||||||
|
if (value < 0.16 || value == 0.0) {
|
||||||
|
resultsamp = "Negative";
|
||||||
|
|
||||||
|
} else {
|
||||||
|
resultsamp = "Positive";
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
if (value >= 0.16 && value < 0.24) {
|
||||||
|
|
||||||
|
resultsamp = "Sickle Cell Trait ";
|
||||||
|
|
||||||
|
} else if (value > 0.24) {
|
||||||
|
resultsamp = "Sickle-Cell Disease";
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
} else if (columnCount < 100) {
|
||||||
|
result_confirmatory.setText("");
|
||||||
|
result.setText("");
|
||||||
|
Type.setText("Wrong file");
|
||||||
|
Type.setTextColor(Color.RED);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
serial_no = values[0];
|
||||||
|
sample_name = values[1];
|
||||||
|
numbers1 = values[262];
|
||||||
|
numbers2 = values[390];
|
||||||
|
ratios = String.valueOf(value);
|
||||||
|
init(serial_no, sample_name, ratios, resultsamp);
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
else if(values[2].equals("555.035"))
|
|
||||||
{
|
|
||||||
number2 = Float.parseFloat(String.valueOf(values[3]));
|
|
||||||
Log.e("number2", String.valueOf(number2));
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
value=number2/number1;
|
|
||||||
Log.e("value",String.valueOf(value));
|
|
||||||
if(value<0.16)
|
|
||||||
{
|
|
||||||
result.setText("Negative");
|
|
||||||
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
result.setText("Positive");
|
|
||||||
|
|
||||||
|
|
||||||
}
|
|
||||||
if(value>=0.16 && value < 0.24)
|
|
||||||
{
|
|
||||||
result_confirmatory.setText("Sickle Cell Trait ");
|
|
||||||
SaveTestInfoToDatabase();
|
|
||||||
|
|
||||||
}
|
|
||||||
else if( value >0.24)
|
|
||||||
{
|
|
||||||
result_confirmatory.setText("Sickle-Cell Disease");
|
|
||||||
SaveTestInfoToDatabase();
|
|
||||||
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
} catch (IOException ex) {
|
} catch (IOException ex) {
|
||||||
|
|
||||||
throw new RuntimeException("Error in reading CSV file: " + ex);
|
throw new RuntimeException("Error in reading CSV file: " + ex);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onItemSelected(AdapterView<?> parent, View view, int position, long id) {
|
public void onItemSelected(AdapterView<?> parent, View view, int position, long id) {
|
||||||
if(parent.getId() == R.id.spinner_device)
|
if (parent.getId() == R.id.spinner_device) {
|
||||||
{
|
|
||||||
device = parent.getItemAtPosition(position).toString();
|
device = parent.getItemAtPosition(position).toString();
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -482,8 +600,8 @@ else if (device.equals("Denovix"))
|
|||||||
public void onNothingSelected(AdapterView<?> parent) {
|
public void onNothingSelected(AdapterView<?> parent) {
|
||||||
|
|
||||||
}
|
}
|
||||||
private void createfolder()
|
|
||||||
{
|
private void createfolder() {
|
||||||
directory_path = Environment.getExternalStorageDirectory().getPath() + "/SickleCell/";
|
directory_path = Environment.getExternalStorageDirectory().getPath() + "/SickleCell/";
|
||||||
file = new File(directory_path);
|
file = new File(directory_path);
|
||||||
if (!file.exists()) {
|
if (!file.exists()) {
|
||||||
@@ -493,54 +611,47 @@ else if (device.equals("Denovix"))
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
private void SaveTestInfoToDatabase()
|
private void SaveTestInfoToDatabase() {
|
||||||
{
|
|
||||||
HashMap<String, Object> productMap = new HashMap<>();
|
HashMap<String, Object> productMap = new HashMap<>();
|
||||||
productMap.put("Value", String.valueOf(value));
|
productMap.put("Value", String.valueOf(value));
|
||||||
productMap.put("number1", String.valueOf(number1));
|
productMap.put("number1", String.valueOf(number1));
|
||||||
productMap.put("number2",String.valueOf(number2));
|
productMap.put("number2", String.valueOf(number2));
|
||||||
productMap.put("Device",device);
|
productMap.put("Device", device);
|
||||||
productMap.put("Result",result_test);
|
productMap.put("Result", result_test);
|
||||||
productMap.put("Result Confirmatory",result_test1);
|
productMap.put("Result Confirmatory", result_test1);
|
||||||
productMap.put("Directory Path",directory_path);
|
productMap.put("Directory Path", directory_path);
|
||||||
productMap.put("Full Path",targetUri);
|
productMap.put("Full Path", targetUri);
|
||||||
|
|
||||||
|
|
||||||
// productMap("Result",String.valueOf(result.getText().toString()));
|
// productMap("Result",String.valueOf(result.getText().toString()));
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
Calendar calendar = Calendar.getInstance();
|
Calendar calendar = Calendar.getInstance();
|
||||||
|
|
||||||
SimpleDateFormat currentDate = new SimpleDateFormat("MMM dd, yyyy");
|
SimpleDateFormat currentDate = new SimpleDateFormat("MMM dd, yyyy");
|
||||||
|
|
||||||
saveCurrentDate = currentDate.format(calendar.getTime());
|
saveCurrentDate = currentDate.format(calendar.getTime());
|
||||||
saveCurrentDate = saveCurrentDate .replaceAll("[^A-Za-z0-9 ]","");
|
saveCurrentDate = saveCurrentDate.replaceAll("[^A-Za-z0-9 ]", "");
|
||||||
|
|
||||||
|
|
||||||
SimpleDateFormat currentTime = new SimpleDateFormat("h:mm a");
|
SimpleDateFormat currentTime = new SimpleDateFormat("h:mm a");
|
||||||
saveCurrentTime = currentTime.format(calendar.getTime());
|
saveCurrentTime = currentTime.format(calendar.getTime());
|
||||||
|
|
||||||
TestRandomKey = saveCurrentDate + saveCurrentTime+String.valueOf( Math.random());
|
TestRandomKey = saveCurrentDate + saveCurrentTime + String.valueOf(Math.random());
|
||||||
TestRandomKey = TestRandomKey .replaceAll("[^A-Za-z0-9 ]","");
|
TestRandomKey = TestRandomKey.replaceAll("[^A-Za-z0-9 ]", "");
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
TestRef.child(TestRandomKey).updateChildren(productMap)
|
TestRef.child(TestRandomKey).updateChildren(productMap)
|
||||||
.addOnCompleteListener(new OnCompleteListener<Void>() {
|
.addOnCompleteListener(new OnCompleteListener<Void>() {
|
||||||
@Override
|
@Override
|
||||||
public void onComplete(@NonNull Task<Void> task)
|
public void onComplete(@NonNull Task<Void> task) {
|
||||||
{
|
|
||||||
if (task.isSuccessful()) {
|
if (task.isSuccessful()) {
|
||||||
|
|
||||||
|
|
||||||
Toast.makeText(MainActivity.this, "Test Result added in backend successfully ", Toast.LENGTH_SHORT).show();
|
Toast.makeText(MainActivity.this, "Test Result added in backend successfully ", Toast.LENGTH_SHORT).show();
|
||||||
|
|
||||||
|
|
||||||
|
} else {
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
|
|
||||||
String message = task.getException().toString();
|
String message = task.getException().toString();
|
||||||
Toast.makeText(MainActivity.this, "Error: " + message, Toast.LENGTH_SHORT).show();
|
Toast.makeText(MainActivity.this, "Error: " + message, Toast.LENGTH_SHORT).show();
|
||||||
@@ -550,24 +661,73 @@ else if (device.equals("Denovix"))
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public void init1() {
|
||||||
|
|
||||||
|
TableLayout stk = (TableLayout) findViewById(R.id.table_main);
|
||||||
|
|
||||||
|
|
||||||
|
TableRow tbrow0 = new TableRow(this);
|
||||||
|
tbrow0.setBackgroundResource(R.color.purple_700);
|
||||||
|
|
||||||
|
TextView tv0 = new TextView(this);
|
||||||
|
tv0.setText(" S.No ");
|
||||||
|
tbrow0.addView(tv0);
|
||||||
|
TextView tv1 = new TextView(this);
|
||||||
|
tv1.setText(" Name sample ");
|
||||||
|
tbrow0.addView(tv1);
|
||||||
|
|
||||||
|
|
||||||
|
TextView tv2 = new TextView(this);
|
||||||
|
tv2.setText(" Ratio ");
|
||||||
|
tbrow0.addView(tv2);
|
||||||
|
|
||||||
|
|
||||||
|
TextView tv3 = new TextView(this);
|
||||||
|
tv3.setText("Result ");
|
||||||
|
tbrow0.addView(tv3);
|
||||||
|
stk.addView(tbrow0);
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public void init(String sno, String samplename, String ratio, String result) {
|
||||||
|
|
||||||
|
TableLayout stk = (TableLayout) findViewById(R.id.table_main);
|
||||||
|
TableRow tbrow = new TableRow(this);
|
||||||
|
TextView t1v = new TextView(this);
|
||||||
|
t1v.setText("" + sno + " ");
|
||||||
|
t1v.setBackgroundResource(R.drawable.cellshape);
|
||||||
|
|
||||||
|
t1v.setGravity(Gravity.CENTER);
|
||||||
|
tbrow.addView(t1v);
|
||||||
|
TextView t2v = new TextView(this);
|
||||||
|
t2v.setText(samplename + " ");
|
||||||
|
t2v.setBackgroundResource(R.drawable.cellshape);
|
||||||
|
|
||||||
|
t2v.setGravity(Gravity.CENTER);
|
||||||
|
tbrow.addView(t2v);
|
||||||
|
|
||||||
|
|
||||||
|
TextView t5v = new TextView(this);
|
||||||
|
t5v.setText(ratio + " ");
|
||||||
|
t5v.setGravity(Gravity.CENTER);
|
||||||
|
tbrow.addView(t5v);
|
||||||
|
t5v.setBackgroundResource(R.drawable.cellshape);
|
||||||
|
|
||||||
|
|
||||||
|
TextView t6v = new TextView(this);
|
||||||
|
t6v.setText(" " + result);
|
||||||
|
t6v.setGravity(Gravity.LEFT);
|
||||||
|
t6v.setBackgroundResource(R.drawable.cellshape);
|
||||||
|
|
||||||
|
tbrow.addView(t6v);
|
||||||
|
|
||||||
|
|
||||||
|
stk.addView(tbrow);
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -142,7 +142,25 @@ android:id="@+id/type"
|
|||||||
android:layout_width="fill_parent"
|
android:layout_width="fill_parent"
|
||||||
android:layout_height="2dp"
|
android:layout_height="2dp"
|
||||||
android:background="#EEE" />
|
android:background="#EEE" />
|
||||||
|
<RelativeLayout
|
||||||
|
android:paddingTop="0dp"
|
||||||
|
android:layout_marginTop="0dp"
|
||||||
|
|
||||||
|
android:id="@+id/RelativeLayout1"
|
||||||
|
android:layout_width="fill_parent"
|
||||||
|
android:layout_gravity="center"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:orientation="vertical" >
|
||||||
|
|
||||||
|
|
||||||
|
<TableLayout
|
||||||
|
android:paddingBottom="23dp"
|
||||||
|
android:id="@+id/table_main"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_centerHorizontal="true" >
|
||||||
|
</TableLayout>
|
||||||
|
</RelativeLayout>
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
android:id="@+id/result"
|
android:id="@+id/result"
|
||||||
@@ -162,6 +180,8 @@ android:id="@+id/type"
|
|||||||
android:textSize="23dp" />
|
android:textSize="23dp" />
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
</ScrollView>
|
</ScrollView>
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user