Browse Source

near finish

nearly finished product proggress. finished product info, hanndling errors
pull/1/head
Yiğit Çolakoğlu 7 years ago
parent
commit
d88b59ec5c
10 changed files with 139 additions and 62 deletions
  1. +43
    -28
      Barcode_Reader_Python/.idea/workspace.xml
  2. +15
    -11
      Barcode_Reader_Python/database_append.py
  3. +48
    -8
      FoodCloud/app/src/main/java/gq/yigit/foodcloud/LearnMore.java
  4. +9
    -4
      FoodCloud/app/src/main/java/gq/yigit/foodcloud/MainActivity.java
  5. +3
    -1
      FoodCloud/app/src/main/java/gq/yigit/foodcloud/PHPComm.java
  6. +14
    -3
      FoodCloud/app/src/main/java/gq/yigit/foodcloud/ProductInfo.java
  7. +3
    -3
      FoodCloud/app/src/main/res/layout/activity_learn_more.xml
  8. +2
    -2
      FoodCloud/app/src/main/res/layout/activity_product_info.xml
  9. +1
    -1
      database/content/Processes/1.json
  10. +1
    -1
      database/content/Processes/2.json

+ 43
- 28
Barcode_Reader_Python/.idea/workspace.xml View File

@ -2,13 +2,12 @@
<project version="4">
<component name="ChangeListManager">
<list default="true" id="7b5ef56c-2d3e-44d9-be69-b414f166f99b" name="Default" comment="">
<change beforePath="$PROJECT_DIR$/.idea/workspace.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/workspace.xml" afterDir="false" />
<change beforePath="$PROJECT_DIR$/database_read.py" beforeDir="false" afterPath="$PROJECT_DIR$/database_read.py" afterDir="false" />
<change beforePath="$PROJECT_DIR$/../FoodCloud/app/src/main/java/gq/yigit/foodcloud/GetInfo.java" beforeDir="false" afterPath="$PROJECT_DIR$/../FoodCloud/app/src/main/java/gq/yigit/foodcloud/GetInfo.java" afterDir="false" />
<change beforePath="$PROJECT_DIR$/database_append.py" beforeDir="false" afterPath="$PROJECT_DIR$/database_append.py" afterDir="false" />
<change beforePath="$PROJECT_DIR$/../FoodCloud/app/src/main/java/gq/yigit/foodcloud/LearnMore.java" beforeDir="false" afterPath="$PROJECT_DIR$/../FoodCloud/app/src/main/java/gq/yigit/foodcloud/LearnMore.java" afterDir="false" />
<change beforePath="$PROJECT_DIR$/../FoodCloud/app/src/main/java/gq/yigit/foodcloud/PHPComm.java" beforeDir="false" afterPath="$PROJECT_DIR$/../FoodCloud/app/src/main/java/gq/yigit/foodcloud/PHPComm.java" afterDir="false" />
<change beforePath="$PROJECT_DIR$/../FoodCloud/app/src/main/java/gq/yigit/foodcloud/ProductInfo.java" beforeDir="false" afterPath="$PROJECT_DIR$/../FoodCloud/app/src/main/java/gq/yigit/foodcloud/ProductInfo.java" afterDir="false" />
<change beforePath="$PROJECT_DIR$/../FoodCloud/app/src/main/res/layout/activity_learn_more.xml" beforeDir="false" afterPath="$PROJECT_DIR$/../FoodCloud/app/src/main/res/layout/activity_learn_more.xml" afterDir="false" />
<change beforePath="$PROJECT_DIR$/../FoodCloud/app/src/main/res/layout/activity_product_info.xml" beforeDir="false" afterPath="$PROJECT_DIR$/../FoodCloud/app/src/main/res/layout/activity_product_info.xml" afterDir="false" />
</list>
<option name="EXCLUDED_CONVERTED_TO_IGNORED" value="true" />
<option name="TRACKING_ENABLED" value="true" />
@ -26,15 +25,15 @@
<SUITE FILE_PATH="coverage/Barcode_Reader_Python$sort_date.coverage" NAME="sort_date Coverage Results" MODIFIED="1529590504238" SOURCE_PROVIDER="com.intellij.coverage.DefaultCoverageFileProvider" RUNNER="coverage.py" COVERAGE_BY_TEST_ENABLED="true" COVERAGE_TRACING_ENABLED="false" WORKING_DIRECTORY="$PROJECT_DIR$" />
<SUITE FILE_PATH="coverage/Barcode_Reader_Python$main.coverage" NAME="main Coverage Results" MODIFIED="1529672838644" SOURCE_PROVIDER="com.intellij.coverage.DefaultCoverageFileProvider" RUNNER="coverage.py" COVERAGE_BY_TEST_ENABLED="true" COVERAGE_TRACING_ENABLED="false" WORKING_DIRECTORY="$PROJECT_DIR$" />
<SUITE FILE_PATH="coverage/Barcode_Reader_Python$Unnamed.coverage" NAME="raspberry_live Coverage Results" MODIFIED="1529543452123" SOURCE_PROVIDER="com.intellij.coverage.DefaultCoverageFileProvider" RUNNER="coverage.py" COVERAGE_BY_TEST_ENABLED="true" COVERAGE_TRACING_ENABLED="false" WORKING_DIRECTORY="$PROJECT_DIR$" />
<SUITE FILE_PATH="coverage/Barcode_Reader_Python$database_append.coverage" NAME="database_append Coverage Results" MODIFIED="1529835022690" SOURCE_PROVIDER="com.intellij.coverage.DefaultCoverageFileProvider" RUNNER="coverage.py" COVERAGE_BY_TEST_ENABLED="true" COVERAGE_TRACING_ENABLED="false" WORKING_DIRECTORY="$PROJECT_DIR$" />
<SUITE FILE_PATH="coverage/Barcode_Reader_Python$database_actions.coverage" NAME="database_actions Coverage Results" MODIFIED="1529835364313" SOURCE_PROVIDER="com.intellij.coverage.DefaultCoverageFileProvider" RUNNER="coverage.py" COVERAGE_BY_TEST_ENABLED="true" COVERAGE_TRACING_ENABLED="false" WORKING_DIRECTORY="$PROJECT_DIR$" />
<SUITE FILE_PATH="coverage/Barcode_Reader_Python$database_append.coverage" NAME="database_append Coverage Results" MODIFIED="1529852928832" SOURCE_PROVIDER="com.intellij.coverage.DefaultCoverageFileProvider" RUNNER="coverage.py" COVERAGE_BY_TEST_ENABLED="true" COVERAGE_TRACING_ENABLED="false" WORKING_DIRECTORY="$PROJECT_DIR$" />
</component>
<component name="FileEditorManager">
<leaf SIDE_TABS_SIZE_LIMIT_KEY="300">
<file leaf-file-name="database_read.py" pinned="false" current-in-tab="false">
<entry file="file://$PROJECT_DIR$/database_read.py">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="51">
<state relative-caret-position="45">
<caret line="3" column="23" selection-start-line="3" selection-start-column="23" selection-end-line="3" selection-end-column="23" />
</state>
</provider>
@ -48,17 +47,26 @@
<file leaf-file-name="main.py" pinned="false" current-in-tab="false">
<entry file="file://$PROJECT_DIR$/main.py">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="-600">
<state relative-caret-position="120">
<caret line="16" column="37" selection-start-line="16" selection-start-column="37" selection-end-line="16" selection-end-column="37" />
</state>
</provider>
</entry>
</file>
<file leaf-file-name="sort_date.py" pinned="false" current-in-tab="true">
<file leaf-file-name="sort_date.py" pinned="false" current-in-tab="false">
<entry file="file://$PROJECT_DIR$/sort_date.py">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="75">
<caret line="5" column="47" lean-forward="true" selection-start-line="5" selection-start-column="47" selection-end-line="5" selection-end-column="47" />
<caret line="5" column="47" selection-start-line="5" selection-start-column="47" selection-end-line="5" selection-end-column="47" />
</state>
</provider>
</entry>
</file>
<file leaf-file-name="database_append.py" pinned="false" current-in-tab="true">
<entry file="file://$PROJECT_DIR$/database_append.py">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="414">
<caret line="61" column="107" selection-start-line="61" selection-start-column="107" selection-end-line="61" selection-end-column="107" />
</state>
</provider>
</entry>
@ -102,8 +110,8 @@
<option value="$PROJECT_DIR$/database_actions.py" />
<option value="$PROJECT_DIR$/main.py" />
<option value="$PROJECT_DIR$/Barcode_Reader_Python/database_append.py" />
<option value="$PROJECT_DIR$/database_append.py" />
<option value="$PROJECT_DIR$/database_read.py" />
<option value="$PROJECT_DIR$/database_append.py" />
</list>
</option>
</component>
@ -162,7 +170,7 @@
</list>
</option>
</component>
<component name="RunManager" selected="Python.database_actions">
<component name="RunManager" selected="Python.database_append">
<configuration name="RUN" type="PythonConfigurationType" factoryName="Python">
<module name="Barcode_Reader_Python" />
<option name="INTERPRETER_OPTIONS" value="" />
@ -307,8 +315,8 @@
</list>
<recent_temporary>
<list>
<item itemvalue="Python.database_actions" />
<item itemvalue="Python.database_append" />
<item itemvalue="Python.database_actions" />
<item itemvalue="Python.pydevd" />
<item itemvalue="Python.main" />
<item itemvalue="Python.move" />
@ -353,7 +361,7 @@
<window_info anchor="bottom" id="Python Console" order="7" />
<window_info anchor="bottom" id="Run" order="2" sideWeight="0.49924126" weight="0.28426966" />
<window_info anchor="bottom" id="Terminal" order="7" />
<window_info active="true" content_ui="combo" id="Project" order="0" visible="true" weight="0.2056624" />
<window_info content_ui="combo" id="Project" order="0" visible="true" weight="0.20779915" />
<window_info anchor="bottom" id="Docker" order="7" show_stripe_button="false" />
<window_info anchor="right" id="Database" order="3" />
<window_info anchor="right" id="SciView" order="3" weight="0.32928678" />
@ -373,24 +381,24 @@
<window_info anchor="right" content_ui="combo" id="Hierarchy" order="2" weight="0.24962063" />
<window_info anchor="bottom" id="Docker" order="7" show_stripe_button="false" />
<window_info anchor="bottom" id="Inspection" order="5" weight="0.4" />
<window_info anchor="bottom" id="Cvs" order="4" weight="0.25" />
<window_info id="Favorites" order="2" side_tool="true" />
<window_info content_ui="combo" id="Project" order="0" visible="true" weight="0.26783004" />
<window_info id="Structure" order="1" side_tool="true" weight="0.25" />
<window_info anchor="right" id="Commander" internal_type="SLIDING" order="0" type="SLIDING" weight="0.4" />
<window_info anchor="right" id="Ant Build" order="1" weight="0.25" />
<window_info anchor="bottom" id="TODO" order="6" />
<window_info anchor="bottom" id="Version Control" order="8" />
<window_info active="true" anchor="bottom" id="Run" order="2" sideWeight="0.49924126" visible="true" weight="0.27056962" />
<window_info anchor="bottom" id="Find" order="1" weight="0.32911393" />
<window_info anchor="bottom" id="Python Console" order="10" />
<window_info anchor="bottom" id="Message" order="0" />
<window_info anchor="bottom" id="Debug" order="3" weight="0.39873418" />
<window_info anchor="right" id="Database" order="4" />
<window_info anchor="bottom" id="Terminal" order="11" />
<window_info anchor="bottom" id="Event Log" order="12" sideWeight="0.5007587" side_tool="true" weight="0.4638365" />
<window_info anchor="bottom" id="Database Changes" order="9" show_stripe_button="false" />
<window_info anchor="bottom" id="Cvs" order="4" weight="0.25" />
<window_info anchor="bottom" id="Version Control" order="8" />
<window_info anchor="right" id="SciView" order="3" weight="0.32928678" />
<window_info anchor="bottom" id="Message" order="0" />
<window_info id="Favorites" order="2" side_tool="true" />
<window_info anchor="bottom" id="Find" order="1" weight="0.32911393" />
<window_info anchor="bottom" id="Python Console" order="10" />
</layout-to-restore>
</component>
<component name="TypeScriptGeneratedFilesManager">
@ -411,6 +419,13 @@
</breakpoint-manager>
</component>
<component name="editorHistoryManager">
<entry file="file://$PROJECT_DIR$/sort_date.py">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="75">
<caret line="5" column="47" lean-forward="true" selection-start-line="5" selection-start-column="47" selection-end-line="5" selection-end-column="47" />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/database_append.py">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="210">
@ -534,16 +549,9 @@
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/database_append.py">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="210">
<caret line="14" selection-start-line="14" selection-end-line="14" />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/database_read.py">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="51">
<state relative-caret-position="45">
<caret line="3" column="23" selection-start-line="3" selection-start-column="23" selection-end-line="3" selection-end-column="23" />
</state>
</provider>
@ -553,7 +561,7 @@
</entry>
<entry file="file://$PROJECT_DIR$/main.py">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="-600">
<state relative-caret-position="120">
<caret line="16" column="37" selection-start-line="16" selection-start-column="37" selection-end-line="16" selection-end-column="37" />
</state>
</provider>
@ -561,7 +569,14 @@
<entry file="file://$PROJECT_DIR$/sort_date.py">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="75">
<caret line="5" column="47" lean-forward="true" selection-start-line="5" selection-start-column="47" selection-end-line="5" selection-end-column="47" />
<caret line="5" column="47" selection-start-line="5" selection-start-column="47" selection-end-line="5" selection-end-column="47" />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/database_append.py">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="414">
<caret line="61" column="107" selection-start-line="61" selection-start-column="107" selection-end-line="61" selection-end-column="107" />
</state>
</provider>
</entry>


+ 15
- 11
Barcode_Reader_Python/database_append.py View File

@ -6,11 +6,11 @@ data_format_prod = {
}
data_format_proc = {
'Harvested': {'Date': '', 'Location': '', 'Product': ''},
'Transport1': {'Duration': 0, 'Moved to,from': '-', 'Condition': True, 'Stopped': False},
'Process': {'Location': '', 'Processes': ''},
'Transport2': {'Duration': 0, 'Moved to,from': '-', 'Condition': 0, 'Stopped': False},
'Packaging': {'Location': '', 'Material': '', 'Cancerogen': True}
'Harvested': {'Date': '', 'Location': '', 'Product': '','Problematic':False},
'Transport1': {'Duration': 0, 'Moved to,from': '-', 'Condition': True, 'Stopped': False,'Problematic':False},
'Process': {'Location': '', 'Processes': '','Problematic':False},
'Transport2': {'Duration': 0, 'Moved to,from': '-', 'Condition': 0, 'Stopped': False,'Problematic':False},
'Packaging': {'Location': '', 'Material': '', 'Cancerogen': True,'Problematic':False}
}
data_1_prod = {
@ -28,33 +28,37 @@ data_1_proc = {
'Harvested': {
'Date': '18.08.2018', 'Location': 'Larson Family',
'Product': 'Raw Milk'
,'Problematic':False
},
'Transport1': {
'Duration': 9, 'Moved to,from': 'Larson Family-McCarty Family Farms', 'Condition': True,
'Stopped': True
,'Problematic':True
}, 'Process': {
'Location': 'McCarty Family Farms',
'Processes': 'Reverse Osmosis,Nanofiltration,Ultrafiltration,Microfiltration'
,'Problematic':False
},
'Transport2': {
'Duration': 13, 'Moved to,from': 'McCarty Family Farms-JJX Packaging', 'Condition': True,
'Stopped': True
,'Problematic':False
},
'Packaging': {'Location': 'JJX Packaging', 'Material': 'Carton', 'Cancerogen': False}
'Packaging': {'Location': 'JJX Packaging', 'Material': 'Carton', 'Cancerogen': False,'Problematic':True}
}
data_2_proc = {
'Harvested': {
'Date': '27.01.2018', 'Location': 'India',
'Product': 'Cocoa'
'Product': 'Cocoa','Problematic':True
},
'Transport1': {'Duration': 71, 'Moved to,from': 'India-Nestle ', 'Condition': True, 'Stopped': True},
'Process': {'Location': 'Nestle', 'Processes': 'Roasting,Pulp,Conching,Moulding'},
'Transport1': {'Duration': 71, 'Moved to,from': 'India-Nestle ', 'Condition': True, 'Stopped': True,'Problematic':False},
'Process': {'Location': 'Nestle', 'Processes': 'Roasting,Pulp,Conching,Moulding','Problematic':False},
'Transport2': {
'Duration': 4, 'Moved to,from': 'Nestle-Ulma Packaging', 'Condition': True,
'Stopped': False
'Stopped': False,'Problematic':False
},
'Packaging': {'Location': 'Ulma Packaging', 'Material': 'Foil', 'Cancerogen': False}
'Packaging': {'Location': 'Ulma Packaging', 'Material': 'Foil', 'Cancerogen': False,'Problematic':False}
}
Products = [data_1_prod, data_2_prod]


+ 48
- 8
FoodCloud/app/src/main/java/gq/yigit/foodcloud/LearnMore.java View File

@ -9,6 +9,10 @@ import android.widget.Button;
import android.widget.ImageView;
import android.widget.TextView;
import android.widget.Toast;
import org.json.JSONException;
import org.json.JSONObject;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.Map;
@ -21,18 +25,19 @@ public class LearnMore extends AppCompatActivity implements View.OnClickListener
public ImageView packaging;
public ImageView trans1;
public ImageView trans2;
public ImageView factory_cond;
public ImageView farm_cond;
public ImageView packaging_cond;
public ImageView trans1_cond;
public ImageView trans2_cond;
static public ImageView factory_cond;
static public ImageView farm_cond;
static public ImageView packaging_cond;
static public ImageView trans1_cond;
static public ImageView trans2_cond;
public Button back_to_main;
public Map<String, Object> someMap;
public String prod_loc;
static public JSONObject process;
@Override
protected void onCreate(Bundle savedInstanceState) {
System.gc();
Bundle extras = getIntent().getExtras();
if (extras != null) {
prod_loc_more = extras.getString("key");
@ -40,24 +45,59 @@ public class LearnMore extends AppCompatActivity implements View.OnClickListener
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_learn_more);
factory = (ImageView) findViewById(R.id.factory);
factory_cond = (ImageView) findViewById(R.id.factory_cond);
factory.setOnClickListener(this);
farm = (ImageView) findViewById(R.id.farm);
farm_cond = (ImageView) findViewById(R.id.farm_cond);
farm.setOnClickListener(this);
packaging = (ImageView) findViewById(R.id.packaging);
packaging_cond = (ImageView) findViewById(R.id.packaging_cond);
packaging.setOnClickListener(this);
trans1 = (ImageView) findViewById(R.id.trans1);
trans1_cond = (ImageView) findViewById(R.id.trans1_cond);
trans1.setOnClickListener(this);
trans2 = (ImageView) findViewById(R.id.trans2);
trans2_cond = (ImageView) findViewById(R.id.trans2_cond);
trans2.setOnClickListener(this);
back_to_main = (Button) findViewById(R.id.go_back_to_main);
back_to_main.setOnClickListener(this);
PHPComm comm = new PHPComm(this);
PHPComm.decide = "Proc";
comm.execute("get", prod_loc_more, "Processes");
}
public void onClick(View v){
if(v.getId() == R.id.back_to_main){
if(v.getId() == R.id.go_back_to_main){
Intent i = new Intent(LearnMore.this, MainActivity.class);
startActivity(i);
}
}
static public void adjustImg(ImageView comp,String stage) {
try {
if ((boolean) process.getJSONObject(stage).get("Problematic")) {
comp.setImageResource(R.mipmap.warning);
comp.bringToFront();
} else {
comp.setImageResource(R.mipmap.check);
comp.bringToFront();
}
} catch (JSONException e) {
Log.d(TAG, "An error ocuured with the json");
}
}
static public void continueProg(String result){
try {
process = new JSONObject(result);
}catch (JSONException e){
Log.d(TAG,"An error ocuured with the json");
}
Log.d(TAG,"Received JSON: " + process.toString());
adjustImg(factory_cond,"Process");
adjustImg(farm_cond,"Harvested");
adjustImg(packaging_cond,"Packaging");
adjustImg(trans1_cond,"Transport1");
adjustImg(trans2_cond,"Transport2");
}
}

+ 9
- 4
FoodCloud/app/src/main/java/gq/yigit/foodcloud/MainActivity.java View File

@ -25,7 +25,7 @@ public class MainActivity extends AppCompatActivity implements OnClickListener{
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
System.gc();
scanBtn = (Button)findViewById(R.id.scan_button);
scanBtn.setOnClickListener(this);
@ -51,13 +51,18 @@ public class MainActivity extends AppCompatActivity implements OnClickListener{
public void onActivityResult(int requestCode, int resultCode, Intent intent) {
IntentResult scanningResult = IntentIntegrator.parseActivityResult(requestCode, resultCode, intent);
if (scanningResult != null) {
String scanContent = scanningResult.getContents();
String scanContent = scanningResult.getContents();
try{
scanContent.toString();
Intent i = new Intent(MainActivity.this, ProductInfo.class);
i.putExtra("key",scanContent);
startActivity(i);
}
else{
catch(NullPointerException e) {
Toast toast = Toast.makeText(getApplicationContext(),
"No scan data received!", Toast.LENGTH_SHORT);
toast.show();
}catch(RuntimeException e){
Toast toast = Toast.makeText(getApplicationContext(),
"No scan data received!", Toast.LENGTH_SHORT);
toast.show();


+ 3
- 1
FoodCloud/app/src/main/java/gq/yigit/foodcloud/PHPComm.java View File

@ -30,7 +30,7 @@ public class PHPComm extends AsyncTask<String,Void,String> {
@Override
protected String doInBackground(String... params) {
String type = params[0];
String login_url = "http://192.168.43.125/database/communication/comm.php";
String login_url = "http://192.168.1.21/database/communication/comm.php";
if(type.equals("get")) {
try {
Log.d(TAG,"received get");
@ -84,6 +84,8 @@ public class PHPComm extends AsyncTask<String,Void,String> {
Log.d(TAG,decide);
if(decide == "Prod") {
ProductInfo.continueApp(result);
}else{
LearnMore.continueProg(result);
}
}


+ 14
- 3
FoodCloud/app/src/main/java/gq/yigit/foodcloud/ProductInfo.java View File

@ -70,7 +70,8 @@ public class ProductInfo extends AppCompatActivity implements OnClickListener {
BBD = (TextView) findViewById(R.id.BBD);
Processed = (TextView) findViewById(R.id.Process);
Nutrients = (TextView) findViewById(R.id.nutrients);
Bundle extras = getIntent().getExtras();
Bundle extras =
getIntent().getExtras();
if (extras != null) {
prod_loc = extras.getString("key");
}
@ -88,6 +89,17 @@ public class ProductInfo extends AppCompatActivity implements OnClickListener {
Intent i = new Intent(ProductInfo.this, MainActivity.class);
startActivity(i);
}if (v.getId() == R.id.journey) {
allergens_array = null;
nutrients_array = null;
//expiry_date = null;
nutrients = null;
allergens = null;
processed = null;
name = null;
cooked = null;
cal = null;
bbd = null;
System.gc();
Intent i = new Intent(ProductInfo.this, LearnMore.class);
i.putExtra("key", prod_loc);
startActivity(i);
@ -115,7 +127,6 @@ public class ProductInfo extends AppCompatActivity implements OnClickListener {
}catch (NullPointerException e){
Log.d(TAG,"Received null data!");
}
Log.d(TAG,allergens);
if(processed.length() < 4){
Processed.setText("None");
}
@ -143,7 +154,7 @@ public class ProductInfo extends AppCompatActivity implements OnClickListener {
for(int i = 0; i < nutrients_array.length();i++) {
try {
nutrients_print = nutrients_print + nutrients_array.get(i);
}catch (JSONException e){
}catch (JSONException e){
Log.d(TAG,"An error occured with json");
}
if(i != nutrients_array.length()-1){


+ 3
- 3
FoodCloud/app/src/main/res/layout/activity_learn_more.xml View File

@ -213,8 +213,8 @@
<Button
android:id="@+id/go_back_to_main"
android:layout_width="160dp"
android:layout_height="36dp"
android:layout_width="169dp"
android:layout_height="52dp"
android:layout_marginEnd="8dp"
android:layout_marginStart="8dp"
@ -226,7 +226,7 @@
android:shadowRadius="5"
android:text="@string/back"
android:textColor="#000000"
android:textSize="12sp"
android:textSize="14sp"
app:layout_constraintBottom_toBottomOf="@+id/imageView16"
app:layout_constraintEnd_toEndOf="@+id/trans2"
app:layout_constraintHorizontal_bias="1.0"


+ 2
- 2
FoodCloud/app/src/main/res/layout/activity_product_info.xml View File

@ -4,8 +4,8 @@
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context=".ProductInfo">
tools:context=".ProductInfo"
>
<TextView
android:id="@+id/BBD"
android:layout_width="260dp"


+ 1
- 1
database/content/Processes/1.json View File

@ -1 +1 @@
{"Process": {"Processes": "Reverse Osmosis,Nanofiltration,Ultrafiltration,Microfiltration", "Location": "McCarty Family Farms"}, "Harvested": {"Date": "18.08.2018", "Product": "Raw Milk", "Location": "Larson Family"}, "Packaging": {"Material": "Carton", "Location": "JJX Packaging", "Cancerogen": false}, "Transport2": {"Duration": 13, "Moved to,from": "McCarty Family Farms-JJX Packaging", "Stopped": true, "Condition": true}, "Transport1": {"Duration": 9, "Moved to,from": "Larson Family-McCarty Family Farms", "Stopped": true, "Condition": true}}
{"Process": {"Problematic": false, "Processes": "Reverse Osmosis,Nanofiltration,Ultrafiltration,Microfiltration", "Location": "McCarty Family Farms"}, "Harvested": {"Date": "18.08.2018", "Problematic": false, "Product": "Raw Milk", "Location": "Larson Family"}, "Packaging": {"Problematic": true, "Material": "Carton", "Location": "JJX Packaging", "Cancerogen": false}, "Transport2": {"Duration": 13, "Moved to,from": "McCarty Family Farms-JJX Packaging", "Stopped": true, "Condition": true, "Problematic": false}, "Transport1": {"Duration": 9, "Moved to,from": "Larson Family-McCarty Family Farms", "Stopped": true, "Condition": true, "Problematic": true}}

+ 1
- 1
database/content/Processes/2.json View File

@ -1 +1 @@
{"Process": {"Processes": "Roasting,Pulp,Conching,Moulding", "Location": "Nestle"}, "Harvested": {"Date": "27.01.2018", "Product": "Cocoa", "Location": "India"}, "Packaging": {"Material": "Foil", "Location": "Ulma Packaging", "Cancerogen": false}, "Transport2": {"Duration": 4, "Moved to,from": "Nestle-Ulma Packaging", "Stopped": false, "Condition": true}, "Transport1": {"Duration": 71, "Moved to,from": "India-Nestle ", "Stopped": true, "Condition": true}}
{"Process": {"Problematic": false, "Processes": "Roasting,Pulp,Conching,Moulding", "Location": "Nestle"}, "Harvested": {"Date": "27.01.2018", "Problematic": true, "Product": "Cocoa", "Location": "India"}, "Packaging": {"Problematic": false, "Material": "Foil", "Location": "Ulma Packaging", "Cancerogen": false}, "Transport2": {"Duration": 4, "Moved to,from": "Nestle-Ulma Packaging", "Stopped": false, "Condition": true, "Problematic": false}, "Transport1": {"Duration": 71, "Moved to,from": "India-Nestle ", "Stopped": true, "Condition": true, "Problematic": false}}

Loading…
Cancel
Save