├── FEED
├── .gitignore
├── .idea
│ ├── codeStyles
│ │ └── Project.xml
│ ├── encodings.xml
│ ├── gradle.xml
│ ├── misc.xml
│ └── runConfigurations.xml
├── app
│ ├── .gitignore
│ ├── build.gradle
│ ├── google-services.json
│ ├── proguard-rules.pro
│ └── src
│ │ ├── androidTest
│ │ └── java
│ │ │ └── com
│ │ │ └── example
│ │ │ └── feed
│ │ │ └── ExampleInstrumentedTest.java
│ │ ├── main
│ │ ├── AndroidManifest.xml
│ │ ├── java
│ │ │ └── com
│ │ │ │ └── example
│ │ │ │ └── feed
│ │ │ │ ├── Cache.java
│ │ │ │ ├── Child.java
│ │ │ │ ├── DisplayActivity.java
│ │ │ │ ├── DonateActivity.java
│ │ │ │ ├── FirstActivity.java
│ │ │ │ ├── GeoLocation.java
│ │ │ │ ├── MainActivity.java
│ │ │ │ ├── RecieveActivity.java
│ │ │ │ ├── RegisterActivity.java
│ │ │ │ └── SecondActivity.java
│ │ └── res
│ │ │ ├── drawable-v24
│ │ │ └── ic_launcher_foreground.xml
│ │ │ ├── drawable
│ │ │ ├── background.xml
│ │ │ ├── background_login.xml
│ │ │ ├── ic_launcher_background.xml
│ │ │ ├── logo.jpg
│ │ │ ├── myfooddonation.JPG
│ │ │ ├── new_login.jpg
│ │ │ ├── password.png
│ │ │ ├── pexels.jpeg
│ │ │ ├── receiver.JPG
│ │ │ └── username.png
│ │ │ ├── layout-v26
│ │ │ └── activity_donate.xml
│ │ │ ├── layout
│ │ │ ├── activity_display.xml
│ │ │ ├── activity_donate.xml
│ │ │ ├── activity_first.xml
│ │ │ ├── activity_main.xml
│ │ │ ├── activity_recieve.xml
│ │ │ ├── activity_second.xml
│ │ │ └── register_activity.xml
│ │ │ ├── mipmap-anydpi-v26
│ │ │ ├── ic_launcher.xml
│ │ │ └── ic_launcher_round.xml
│ │ │ ├── mipmap-hdpi
│ │ │ ├── ic_launcher.png
│ │ │ └── ic_launcher_round.png
│ │ │ ├── mipmap-mdpi
│ │ │ ├── ic_launcher.png
│ │ │ └── ic_launcher_round.png
│ │ │ ├── mipmap-xhdpi
│ │ │ ├── ic_launcher.png
│ │ │ └── ic_launcher_round.png
│ │ │ ├── mipmap-xxhdpi
│ │ │ ├── ic_launcher.png
│ │ │ └── ic_launcher_round.png
│ │ │ ├── mipmap-xxxhdpi
│ │ │ ├── ic_launcher.png
│ │ │ └── ic_launcher_round.png
│ │ │ └── values
│ │ │ ├── colors.xml
│ │ │ ├── dimens.xml
│ │ │ ├── strings.xml
│ │ │ └── styles.xml
│ │ └── test
│ │ └── java
│ │ └── com
│ │ └── example
│ │ └── feed
│ │ └── ExampleUnitTest.java
├── build.gradle
├── gradle.properties
├── gradle
│ └── wrapper
│ │ ├── gradle-wrapper.jar
│ │ └── gradle-wrapper.properties
├── gradlew
├── gradlew.bat
└── settings.gradle
├── README.md
└── ScreenShots
├── WhatsApp Image 2019-11-19 at 22.20.59 (1).jpeg
├── WhatsApp Image 2019-11-19 at 22.20.59 (2).jpeg
├── WhatsApp Image 2019-11-19 at 22.20.59 (3).jpeg
├── WhatsApp Image 2019-11-19 at 22.20.59 (4).jpeg
├── WhatsApp Image 2019-11-19 at 22.20.59 (5).jpeg
├── WhatsApp Image 2019-11-19 at 22.20.59 (6).jpeg
├── WhatsApp Image 2019-11-19 at 22.20.59 (7).jpeg
└── WhatsApp Image 2019-11-19 at 22.20.59.jpeg
/FEED/.gitignore:
--------------------------------------------------------------------------------
1 | *.iml
2 | .gradle
3 | /local.properties
4 | /.idea/caches
5 | /.idea/libraries
6 | /.idea/modules.xml
7 | /.idea/workspace.xml
8 | /.idea/navEditor.xml
9 | /.idea/assetWizardSettings.xml
10 | .DS_Store
11 | /build
12 | /captures
13 | .externalNativeBuild
14 |
--------------------------------------------------------------------------------
/FEED/.idea/codeStyles/Project.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 | xmlns:android
14 |
15 | ^$
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 | xmlns:.*
25 |
26 | ^$
27 |
28 |
29 | BY_NAME
30 |
31 |
32 |
33 |
34 |
35 |
36 | .*:id
37 |
38 | http://schemas.android.com/apk/res/android
39 |
40 |
41 |
42 |
43 |
44 |
45 |
46 |
47 | .*:name
48 |
49 | http://schemas.android.com/apk/res/android
50 |
51 |
52 |
53 |
54 |
55 |
56 |
57 |
58 | name
59 |
60 | ^$
61 |
62 |
63 |
64 |
65 |
66 |
67 |
68 |
69 | style
70 |
71 | ^$
72 |
73 |
74 |
75 |
76 |
77 |
78 |
79 |
80 | .*
81 |
82 | ^$
83 |
84 |
85 | BY_NAME
86 |
87 |
88 |
89 |
90 |
91 |
92 | .*
93 |
94 | http://schemas.android.com/apk/res/android
95 |
96 |
97 | ANDROID_ATTRIBUTE_ORDER
98 |
99 |
100 |
101 |
102 |
103 |
104 | .*
105 |
106 | .*
107 |
108 |
109 | BY_NAME
110 |
111 |
112 |
113 |
114 |
115 |
116 |
--------------------------------------------------------------------------------
/FEED/.idea/encodings.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
--------------------------------------------------------------------------------
/FEED/.idea/gradle.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
14 |
15 |
--------------------------------------------------------------------------------
/FEED/.idea/misc.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
38 |
39 |
40 |
41 |
42 |
43 |
44 |
45 |
46 |
47 |
48 |
--------------------------------------------------------------------------------
/FEED/.idea/runConfigurations.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
--------------------------------------------------------------------------------
/FEED/app/.gitignore:
--------------------------------------------------------------------------------
1 | /build
2 |
--------------------------------------------------------------------------------
/FEED/app/build.gradle:
--------------------------------------------------------------------------------
1 | apply plugin: 'com.android.application'
2 | apply plugin: 'com.google.gms.google-services'
3 |
4 | android {
5 | compileSdkVersion 29
6 | buildToolsVersion "29.0.1"
7 | defaultConfig {
8 | applicationId "com.example.feed"
9 | minSdkVersion 16
10 | targetSdkVersion 29
11 | versionCode 1
12 | versionName "1.0"
13 | testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
14 | multiDexEnabled true
15 | }
16 | buildTypes {
17 | release {
18 | minifyEnabled false
19 | proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
20 | }
21 | }
22 | }
23 |
24 | dependencies {
25 | implementation fileTree(dir: 'libs', include: ['*.jar'])
26 | implementation 'androidx.constraintlayout:constraintlayout:1.1.3'
27 | implementation 'com.google.android.material:material:1.0.0'
28 | implementation 'com.google.firebase:firebase-auth:16.0.5'
29 | implementation 'com.google.firebase:firebase-database:16.0.4'
30 | implementation 'androidx.appcompat:appcompat:1.0.2'
31 | testImplementation 'junit:junit:4.12'
32 | androidTestImplementation 'androidx.test:runner:1.2.0'
33 | androidTestImplementation 'androidx.test.espresso:espresso-core:3.2.0'
34 | implementation 'com.google.android.gms:play-services:12.0.1'
35 | implementation 'com.android.support:multidex:1.0.3'
36 | implementation 'com.firebase:firebase-client-android:2.5.2'
37 |
38 | }
39 |
--------------------------------------------------------------------------------
/FEED/app/google-services.json:
--------------------------------------------------------------------------------
1 | {
2 | "project_info": {
3 | "project_number": "285973563297",
4 | "firebase_url": "https://feed-85067.firebaseio.com",
5 | "project_id": "feed-85067",
6 | "storage_bucket": "feed-85067.appspot.com"
7 | },
8 | "client": [
9 | {
10 | "client_info": {
11 | "mobilesdk_app_id": "1:285973563297:android:358b2162e412172c",
12 | "android_client_info": {
13 | "package_name": "com.example.feed"
14 | }
15 | },
16 | "oauth_client": [
17 | {
18 | "client_id": "285973563297-2qbasvk9pmpio6fc4i0jhecffdmjq9as.apps.googleusercontent.com",
19 | "client_type": 1,
20 | "android_info": {
21 | "package_name": "com.example.feed",
22 | "certificate_hash": "5fd6a182f435fd3c54f0d925baadbfeac9c57d51"
23 | }
24 | },
25 | {
26 | "client_id": "285973563297-pchfhr60ldqts39qnae6g1qebej9jpds.apps.googleusercontent.com",
27 | "client_type": 3
28 | }
29 | ],
30 | "api_key": [
31 | {
32 | "current_key": "AIzaSyChThneeVQZ3H2E6FgAfYgrzU77LX5SYho"
33 | }
34 | ],
35 | "services": {
36 | "appinvite_service": {
37 | "other_platform_oauth_client": [
38 | {
39 | "client_id": "285973563297-pchfhr60ldqts39qnae6g1qebej9jpds.apps.googleusercontent.com",
40 | "client_type": 3
41 | }
42 | ]
43 | }
44 | }
45 | }
46 | ],
47 | "configuration_version": "1"
48 | }
--------------------------------------------------------------------------------
/FEED/app/proguard-rules.pro:
--------------------------------------------------------------------------------
1 | # Add project specific ProGuard rules here.
2 | # You can control the set of applied configuration files using the
3 | # proguardFiles setting in build.gradle.
4 | #
5 | # For more details, see
6 | # http://developer.android.com/guide/developing/tools/proguard.html
7 |
8 | # If your project uses WebView with JS, uncomment the following
9 | # and specify the fully qualified class name to the JavaScript interface
10 | # class:
11 | #-keepclassmembers class fqcn.of.javascript.interface.for.webview {
12 | # public *;
13 | #}
14 |
15 | # Uncomment this to preserve the line number information for
16 | # debugging stack traces.
17 | #-keepattributes SourceFile,LineNumberTable
18 |
19 | # If you keep the line number information, uncomment this to
20 | # hide the original source file name.
21 | #-renamesourcefileattribute SourceFile
22 |
--------------------------------------------------------------------------------
/FEED/app/src/androidTest/java/com/example/feed/ExampleInstrumentedTest.java:
--------------------------------------------------------------------------------
1 | package com.example.feed;
2 |
3 | import android.content.Context;
4 | import androidx.test.InstrumentationRegistry;
5 | import androidx.test.runner.AndroidJUnit4;
6 |
7 | import org.junit.Test;
8 | import org.junit.runner.RunWith;
9 |
10 | import static org.junit.Assert.*;
11 |
12 | /**
13 | * Instrumented test, which will execute on an Android device.
14 | *
15 | * @see Testing documentation
16 | */
17 | @RunWith(AndroidJUnit4.class)
18 | public class ExampleInstrumentedTest {
19 | @Test
20 | public void useAppContext() {
21 | // Context of the app under test.
22 | Context appContext = InstrumentationRegistry.getTargetContext();
23 |
24 | assertEquals("com.example.feed", appContext.getPackageName());
25 | }
26 | }
27 |
--------------------------------------------------------------------------------
/FEED/app/src/main/AndroidManifest.xml:
--------------------------------------------------------------------------------
1 |
2 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
21 |
22 |
23 |
24 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
38 |
39 |
--------------------------------------------------------------------------------
/FEED/app/src/main/java/com/example/feed/Cache.java:
--------------------------------------------------------------------------------
1 | package com.example.feed;
2 |
3 | public class Cache {
4 |
5 | private Long maxid;
6 | private String userName;
7 | private String foodName;
8 | private String quantity;
9 | private String number;
10 | private Double x,y;
11 |
12 | public Long getMaxid() {
13 | return maxid;
14 | }
15 |
16 | public void setMaxid(Long maxid) {
17 | this.maxid = maxid;
18 | }
19 |
20 | public Double getX() {
21 | return x;
22 | }
23 |
24 | public void setX(Double x) {
25 | this.x = x;
26 | }
27 |
28 | public Double getY() {
29 | return y;
30 | }
31 |
32 | public void setY(Double y) {
33 | this.y = y;
34 | }
35 |
36 | public String getUserName() {
37 | return userName;
38 | }
39 |
40 | public void setUserName(String userName) {
41 | this.userName = userName;
42 | }
43 |
44 | public String getFoodName() {
45 | return foodName;
46 | }
47 |
48 | public void setFoodName(String foodName) {
49 | this.foodName = foodName;
50 | }
51 |
52 | public String getQuantity() {
53 | return quantity;
54 | }
55 |
56 | public void setQuantity(String quantity) {
57 | this.quantity = quantity;
58 | }
59 |
60 | public String getNumber() {
61 | return number;
62 | }
63 |
64 | public void setNumber(String number) {
65 | this.number = number;
66 | }
67 |
68 |
69 | }
70 |
--------------------------------------------------------------------------------
/FEED/app/src/main/java/com/example/feed/Child.java:
--------------------------------------------------------------------------------
1 | package com.example.feed;
2 |
3 | public class Child {
4 |
5 | private String userName;
6 | private String foodName;
7 | private String quantity;
8 | private String number;
9 | private Double x,y;
10 |
11 | public String getUserName() {
12 | return userName;
13 | }
14 |
15 | public void setUserName(String userName) {
16 | this.userName = userName;
17 | }
18 |
19 | public String getFoodName() {
20 | return foodName;
21 | }
22 |
23 | public void setFoodName(String foodName) {
24 | this.foodName = foodName;
25 | }
26 |
27 | public String getQuantity() {
28 | return quantity;
29 | }
30 |
31 | public void setQuantity(String quantity) {
32 | this.quantity = quantity;
33 | }
34 |
35 | public String getNumber() {
36 | return number;
37 | }
38 |
39 | public void setNumber(String number) {
40 | this.number = number;
41 | }
42 |
43 | public Double getX() {
44 | return x;
45 | }
46 |
47 | public void setX(Double x) {
48 | this.x = x;
49 | }
50 |
51 | public Double getY() {
52 | return y;
53 | }
54 |
55 | public void setY(Double y) {
56 | this.y = y;
57 | }
58 | }
--------------------------------------------------------------------------------
/FEED/app/src/main/java/com/example/feed/DisplayActivity.java:
--------------------------------------------------------------------------------
1 | package com.example.feed;
2 |
3 | import androidx.appcompat.app.AppCompatActivity;
4 |
5 | import android.content.Intent;
6 | import android.net.Uri;
7 | import android.os.Bundle;
8 | import android.view.View;
9 | import android.widget.Button;
10 | import android.widget.EditText;
11 |
12 | public class DisplayActivity extends AppCompatActivity {
13 |
14 | private EditText uname, fname, quantity, number;
15 | private Button btn;
16 |
17 | @Override
18 | protected void onCreate(Bundle savedInstanceState) {
19 | super.onCreate(savedInstanceState);
20 | setContentView(R.layout.activity_display);
21 |
22 |
23 |
24 | uname = (EditText) findViewById(R.id.etname);
25 | fname = (EditText) findViewById(R.id.etfoodname);
26 | quantity = (EditText) findViewById(R.id.etquantity);
27 | number = (EditText) findViewById(R.id.etnum);
28 |
29 | Intent i = getIntent();
30 |
31 | String name = i.getStringExtra("name");
32 | String food = i.getStringExtra("food");
33 | String quant = i.getStringExtra("quant");
34 | String num = i.getStringExtra("num");
35 | Double x =i.getDoubleExtra("lat",0);
36 | Double y =i.getDoubleExtra("lng",0);
37 |
38 | uname.setText("Donor Name- "+name);
39 | fname.setText("Food Name- "+food);
40 | quantity.setText("Food Quantity- "+quant);
41 | number.setText("Donor Number- "+num);
42 |
43 | uname.setEnabled(false);
44 | fname.setEnabled(false);
45 | quantity.setEnabled(false);
46 | number.setEnabled(false);
47 |
48 | final String address = "geo:"+String.valueOf(x)+","+String.valueOf(y);
49 |
50 | btn = (Button) findViewById(R.id.btnloc);
51 |
52 | btn.setOnClickListener(new View.OnClickListener() {
53 | @Override
54 | public void onClick(View view) {
55 |
56 | Uri gmmIntentUri = Uri.parse(address);
57 | Intent mapIntent = new Intent(Intent.ACTION_VIEW, gmmIntentUri);
58 | mapIntent.setPackage("com.google.android.apps.maps");
59 | if (mapIntent.resolveActivity(getPackageManager()) != null) {
60 | startActivity(mapIntent);
61 | }
62 |
63 | // Intent intent = new Intent();
64 | // intent.setAction(Intent.ACTION_VIEW);
65 | // intent.setData(Uri.parse(address));
66 | // startActivity(intent);
67 |
68 | }
69 | });
70 |
71 | }
72 | }
73 |
--------------------------------------------------------------------------------
/FEED/app/src/main/java/com/example/feed/DonateActivity.java:
--------------------------------------------------------------------------------
1 | package com.example.feed;
2 |
3 | import androidx.annotation.NonNull;
4 | import androidx.annotation.RequiresApi;
5 | import androidx.appcompat.app.AppCompatActivity;
6 | import androidx.core.app.ActivityCompat;
7 | import androidx.core.content.ContextCompat;
8 |
9 | import android.Manifest;
10 | import android.app.Activity;
11 | import android.content.Intent;
12 | import android.content.pm.PackageManager;
13 | import android.location.Location;
14 | import android.os.Build;
15 | import android.os.Bundle;
16 | import android.text.TextUtils;
17 | import android.view.View;
18 | import android.widget.Button;
19 | import android.widget.EditText;
20 | import android.widget.Toast;
21 |
22 | import com.google.firebase.database.DataSnapshot;
23 | import com.google.firebase.database.DatabaseError;
24 | import com.google.firebase.database.DatabaseReference;
25 | import com.google.firebase.database.FirebaseDatabase;
26 | import com.google.firebase.database.ValueEventListener;
27 |
28 |
29 | public class DonateActivity extends AppCompatActivity {
30 |
31 |
32 | private EditText uname, fname, quantity, number;
33 | private DatabaseReference reff;
34 | private Child member;
35 | private long maxid = 0;
36 | private Double lat,lng;
37 |
38 |
39 | @RequiresApi(api = Build.VERSION_CODES.M)
40 | protected void onCreate(Bundle savedInstanceState) {
41 | super.onCreate(savedInstanceState);
42 | setContentView(R.layout.activity_donate);
43 |
44 | if (!(ContextCompat.checkSelfPermission(this, Manifest.permission.ACCESS_FINE_LOCATION) == PackageManager.PERMISSION_GRANTED)) {
45 | ActivityCompat.requestPermissions(this, new String[] {Manifest.permission.ACCESS_FINE_LOCATION}, 123);
46 | }
47 |
48 | uname = (EditText) findViewById(R.id.etname);
49 | fname = (EditText) findViewById(R.id.etfoodname);
50 | quantity = (EditText) findViewById(R.id.etquantity);
51 | number = (EditText) findViewById(R.id.etnum);
52 |
53 | Button btn = (Button) findViewById(R.id.btnsubmit);
54 |
55 | member = new Child();
56 |
57 | reff = FirebaseDatabase.getInstance().getReference().child("Child");
58 |
59 | reff.addValueEventListener(new ValueEventListener() {
60 | @Override
61 | public void onDataChange(@NonNull DataSnapshot dataSnapshot) {
62 | if (dataSnapshot.exists()) {
63 | maxid = dataSnapshot.getChildrenCount();
64 | }
65 | }
66 |
67 | @Override
68 | public void onCancelled(@NonNull DatabaseError databaseError) {
69 |
70 | }
71 | });
72 |
73 | btn.setOnClickListener(new View.OnClickListener() {
74 | @Override
75 | public void onClick(View view) {
76 | String un, fn, qt, nm;
77 |
78 | un = uname.getText().toString().trim();
79 | fn = fname.getText().toString().trim();
80 | qt = quantity.getText().toString().trim();
81 | nm = number.getText().toString().trim();
82 |
83 | if (TextUtils.isEmpty(un) || TextUtils.isEmpty(fn) || TextUtils.isEmpty(qt) || TextUtils.isEmpty(nm)) {
84 | Toast.makeText(DonateActivity.this, "Fields must not be empty", Toast.LENGTH_SHORT).show();
85 | } else {
86 |
87 |
88 | GeoLocation geoLocation = new GeoLocation(getApplicationContext());
89 |
90 | Location l = geoLocation.getLocation();
91 |
92 | if (l != null) {
93 | lat = l.getLatitude();
94 | lng = l.getLongitude();
95 |
96 |
97 |
98 | member.setUserName(un);
99 | member.setFoodName(fn);
100 | member.setQuantity(qt);
101 | member.setNumber(nm);
102 | member.setX(lat);
103 | member.setY(lng);
104 |
105 | reff.child(String.valueOf(maxid + 1)).setValue(member);
106 |
107 | Toast.makeText(DonateActivity.this, "Donated", Toast.LENGTH_SHORT).show();
108 |
109 | Intent intent = new Intent(DonateActivity.this, SecondActivity.class);
110 | startActivity(intent);
111 | finish();
112 | }
113 | }
114 | }
115 | });
116 | }
117 |
118 | }
119 |
--------------------------------------------------------------------------------
/FEED/app/src/main/java/com/example/feed/FirstActivity.java:
--------------------------------------------------------------------------------
1 | package com.example.feed;
2 |
3 | import androidx.annotation.NonNull;
4 | import androidx.appcompat.app.AppCompatActivity;
5 | import androidx.core.app.ActivityCompat;
6 | import androidx.core.content.ContextCompat;
7 |
8 | import android.Manifest;
9 | import android.content.Intent;
10 | import android.content.pm.PackageManager;
11 | import android.os.Bundle;
12 | import android.text.TextUtils;
13 | import android.util.Log;
14 | import android.widget.Button;
15 |
16 | import android.view.View;
17 | import android.view.View.OnClickListener;
18 | import android.widget.EditText;
19 | import android.widget.Toast;
20 |
21 | import com.google.android.gms.tasks.OnCompleteListener;
22 | import com.google.android.gms.tasks.Task;
23 | import com.google.firebase.auth.AuthResult;
24 | import com.google.firebase.auth.FirebaseAuth;
25 | import com.google.firebase.auth.FirebaseUser;
26 |
27 |
28 | public class FirstActivity extends AppCompatActivity {
29 |
30 | private static final String TAG = "FirstActivity";
31 | private FirebaseAuth mAuth;
32 | private EditText ETemail;
33 | private EditText ETpassword;
34 | long maxid=0;
35 |
36 | @Override
37 | protected void onCreate(Bundle savedInstanceState) {
38 | super.onCreate(savedInstanceState);
39 | setContentView(R.layout.activity_first);
40 |
41 | if (!(ContextCompat.checkSelfPermission(this, Manifest.permission.ACCESS_FINE_LOCATION) == PackageManager.PERMISSION_GRANTED)) {
42 | ActivityCompat.requestPermissions(this, new String[] {Manifest.permission.ACCESS_FINE_LOCATION}, 123);
43 | }
44 |
45 | mAuth = FirebaseAuth.getInstance();
46 |
47 | ETemail = (EditText)findViewById(R.id.editText);
48 | ETpassword = (EditText)findViewById(R.id.editText2);
49 |
50 | final Button signIn = (Button) findViewById(R.id.sign_in);
51 | signIn.setOnClickListener(new OnClickListener() {
52 | @Override
53 | public void onClick(View view) {
54 | signInIntoApp();
55 | }
56 | });
57 |
58 | Button signUp = (Button) findViewById(R.id.sign_up);
59 | signUp.setOnClickListener(new OnClickListener() {
60 | @Override
61 | public void onClick(View view){
62 | Intent intent = new Intent(FirstActivity.this, RegisterActivity.class);
63 | startActivity(intent);
64 | }
65 | });
66 |
67 | }
68 |
69 | private void signInIntoApp(){
70 | String email = ETemail.getText().toString().trim();
71 | String password = ETpassword.getText().toString().trim();
72 |
73 | if(TextUtils.isEmpty(email)){
74 | Toast.makeText(this," Invalid Email ",Toast.LENGTH_SHORT).show();
75 | return;
76 | }
77 |
78 | if(TextUtils.isEmpty(password)){
79 | Toast.makeText(this," Invalid Password ",Toast.LENGTH_SHORT).show();
80 | return;
81 | }
82 |
83 | mAuth.signInWithEmailAndPassword(email, password)
84 | .addOnCompleteListener(this, new OnCompleteListener() {
85 | @Override
86 | public void onComplete(@NonNull Task task) {
87 | if (task.isSuccessful()) {
88 | // Sign in success, update UI with the signed-in user's information
89 | Log.d(TAG, "signInWithEmail:success");
90 | FirebaseUser user = mAuth.getCurrentUser();
91 |
92 | Intent intent = new Intent(FirstActivity.this, SecondActivity.class);
93 | startActivity(intent);
94 | } else {
95 | // If sign in fails, display a message to the user.
96 | Log.w(TAG, "signInWithEmail:failure", task.getException());
97 | Toast.makeText(FirstActivity.this," Authentication failed.",
98 | Toast.LENGTH_SHORT).show();
99 | }
100 |
101 | // ...
102 | }
103 | });
104 | }
105 |
106 | @Override
107 | public void onStart() {
108 | super.onStart();
109 | // Check if user is signed in (non-null) and update UI accordingly.
110 | FirebaseUser currentUser = mAuth.getCurrentUser();
111 | //updateUI(currentUser);
112 | }
113 |
114 | }
115 |
--------------------------------------------------------------------------------
/FEED/app/src/main/java/com/example/feed/GeoLocation.java:
--------------------------------------------------------------------------------
1 | package com.example.feed;
2 |
3 | import android.Manifest;
4 | import android.content.Context;
5 | import android.content.pm.PackageManager;
6 | import android.location.Location;
7 | import android.location.LocationListener;
8 | import android.location.LocationManager;
9 | import android.os.Bundle;
10 | import android.widget.Toast;
11 |
12 | import androidx.core.content.ContextCompat;
13 |
14 | class GeoLocation implements LocationListener {
15 |
16 | Context context;
17 |
18 | public GeoLocation(Context c) {
19 | this.context = c;
20 | }
21 |
22 | public Location getLocation() {
23 |
24 | LocationManager lm = (LocationManager) context.getSystemService(Context.LOCATION_SERVICE);
25 | assert lm != null;
26 | boolean onGPS = lm.isProviderEnabled(LocationManager.GPS_PROVIDER);
27 | if (onGPS) {
28 |
29 | if (ContextCompat.checkSelfPermission(context,Manifest.permission.ACCESS_FINE_LOCATION) != PackageManager.PERMISSION_GRANTED ){
30 | return null;
31 | }
32 |
33 | lm.requestLocationUpdates(LocationManager.GPS_PROVIDER, 6000, 10, this);
34 |
35 | Location l = lm.getLastKnownLocation(LocationManager.GPS_PROVIDER);
36 |
37 | return l;
38 | }
39 | else{
40 | Toast.makeText(context,"Enable GPS",Toast.LENGTH_SHORT).show();
41 | }
42 | return null;
43 | }
44 |
45 | @Override
46 | public void onLocationChanged(Location location) {
47 |
48 | }
49 |
50 | @Override
51 | public void onStatusChanged(String s, int i, Bundle bundle) {
52 |
53 | }
54 |
55 | @Override
56 | public void onProviderEnabled(String s) {
57 |
58 | }
59 |
60 | @Override
61 | public void onProviderDisabled(String s) {
62 |
63 | }
64 | }
65 |
--------------------------------------------------------------------------------
/FEED/app/src/main/java/com/example/feed/MainActivity.java:
--------------------------------------------------------------------------------
1 | package com.example.feed;
2 |
3 | import androidx.appcompat.app.AppCompatActivity;
4 |
5 | import android.content.Intent;
6 | import android.os.Bundle;
7 | import android.os.Handler;
8 |
9 |
10 | public class MainActivity extends AppCompatActivity {
11 |
12 | @Override
13 | protected void onCreate(Bundle savedInstanceState) {
14 | super.onCreate(savedInstanceState);
15 | setContentView(R.layout.activity_main);
16 |
17 | new Handler().postDelayed(new Runnable() {
18 | @Override
19 | public void run() {
20 | Intent intent = new Intent(MainActivity.this, FirstActivity.class);
21 | startActivity(intent);
22 | finish();
23 | }
24 | },2000);
25 | }
26 | }
27 |
--------------------------------------------------------------------------------
/FEED/app/src/main/java/com/example/feed/RecieveActivity.java:
--------------------------------------------------------------------------------
1 | package com.example.feed;
2 |
3 | import androidx.appcompat.app.AppCompatActivity;
4 |
5 | import android.content.Intent;
6 | import android.os.Bundle;
7 | import android.view.View;
8 | import android.widget.AdapterView;
9 | import android.widget.ArrayAdapter;
10 | import android.widget.ListView;
11 | import android.widget.Toast;
12 |
13 |
14 | import com.google.firebase.database.DataSnapshot;
15 | import com.google.firebase.database.DatabaseError;
16 | import com.google.firebase.database.DatabaseReference;
17 | import com.google.firebase.database.FirebaseDatabase;
18 | import com.google.firebase.database.ValueEventListener;
19 | import java.util.ArrayList;
20 |
21 |
22 | public class RecieveActivity extends AppCompatActivity {
23 |
24 | private DatabaseReference reff;
25 | private ListView mListView;
26 | private ArrayAdapter adapter;
27 | private ArrayList arrayList;
28 | private long N=0;
29 |
30 | @Override
31 | protected void onCreate(Bundle savedInstanceState) {
32 | super.onCreate(savedInstanceState);
33 | setContentView(R.layout.activity_recieve);
34 |
35 | Toast.makeText(RecieveActivity.this,"Please Wait.....",Toast.LENGTH_SHORT).show();
36 |
37 | mListView = (ListView) findViewById(R.id.listview);
38 |
39 |
40 | reff = FirebaseDatabase.getInstance().getReference().child("Child");
41 | arrayList = new ArrayList();
42 |
43 |
44 | reff.addListenerForSingleValueEvent(new ValueEventListener() {
45 | @Override
46 | public void onDataChange(final DataSnapshot dataSnapshot) {
47 | arrayList.clear();
48 | N=dataSnapshot.getChildrenCount();
49 | for( int i = 1 ; i <= N ; i++ ){
50 | arrayList.add(dataSnapshot.child(String.valueOf(i)).child("foodName").getValue(String.class));
51 | }
52 |
53 | adapter = new ArrayAdapter(RecieveActivity.this, android.R.layout.simple_expandable_list_item_1,arrayList);
54 | mListView.setAdapter(adapter);
55 |
56 | mListView.setOnItemClickListener(new AdapterView.OnItemClickListener() {
57 | @Override
58 | public void onItemClick(AdapterView> adapterView, View view, int i, long l) {
59 | Cache c = new Cache();
60 |
61 | i++;
62 |
63 | c.setUserName(dataSnapshot.child(String.valueOf(i)).child("userName").getValue(String.class));
64 | c.setFoodName(dataSnapshot.child(String.valueOf(i)).child("foodName").getValue(String.class));
65 | c.setQuantity(dataSnapshot.child(String.valueOf(i)).child("quantity").getValue(String.class));
66 | c.setNumber(dataSnapshot.child(String.valueOf(i)).child("number").getValue(String.class));
67 | c.setX(dataSnapshot.child(String.valueOf(i)).child("x").getValue(Double.class));
68 | c.setY(dataSnapshot.child(String.valueOf(i)).child("y").getValue(Double.class));
69 |
70 |
71 | Intent intent = new Intent(RecieveActivity.this,DisplayActivity.class);
72 |
73 | intent.putExtra("name",c.getUserName());
74 | intent.putExtra("food",c.getFoodName());
75 | intent.putExtra("quant",c.getQuantity());
76 | intent.putExtra("num",c.getNumber());
77 | intent.putExtra("lat",c.getX());
78 | intent.putExtra("lng",c.getY());
79 |
80 | startActivity(intent);
81 |
82 | }
83 | });
84 |
85 | }
86 |
87 | @Override
88 | public void onCancelled(DatabaseError databaseError) {
89 |
90 | }
91 | });
92 |
93 |
94 |
95 | }
96 |
97 | }
98 |
--------------------------------------------------------------------------------
/FEED/app/src/main/java/com/example/feed/RegisterActivity.java:
--------------------------------------------------------------------------------
1 | package com.example.feed;
2 |
3 | import androidx.annotation.NonNull;
4 | import androidx.appcompat.app.AppCompatActivity;
5 |
6 | import android.content.Intent;
7 | import android.os.Bundle;
8 | import android.text.TextUtils;
9 | import android.util.Log;
10 | import android.view.View;
11 | import android.widget.Button;
12 | import android.widget.EditText;
13 | import android.widget.Toast;
14 |
15 | import com.google.android.gms.tasks.OnCompleteListener;
16 | import com.google.android.gms.tasks.Task;
17 | import com.google.firebase.auth.AuthResult;
18 | import com.google.firebase.auth.FirebaseAuth;
19 | import com.google.firebase.auth.FirebaseUser;
20 |
21 |
22 | public class RegisterActivity extends AppCompatActivity {
23 |
24 | private static final String TAG = ">";
25 | private EditText ETemail;
26 | private EditText ETpassword;
27 | private FirebaseAuth mAuth;
28 |
29 | protected void registerUser(){
30 | String email = ETemail.getText().toString().trim();
31 | String password = ETpassword.getText().toString().trim();
32 |
33 | if(TextUtils.isEmpty(email)){
34 | Toast.makeText(this," Invalid Email ",Toast.LENGTH_SHORT).show();
35 | return;
36 | }
37 |
38 | if(TextUtils.isEmpty(password)){
39 | Toast.makeText(this," Invalid Password ",Toast.LENGTH_SHORT).show();
40 | return;
41 | }
42 |
43 | mAuth.signInWithEmailAndPassword(email, password)
44 | .addOnCompleteListener(this, new OnCompleteListener() {
45 | @Override
46 | public void onComplete(@NonNull Task task) {
47 | if (task.isSuccessful()) {
48 | // Sign in success, update UI with the signed-in user's information
49 | Log.d(TAG, "signInWithEmail:success");
50 | FirebaseUser user = mAuth.getCurrentUser();
51 |
52 | Toast.makeText(RegisterActivity.this," User already exists, Logging in... ", Toast.LENGTH_SHORT).show();
53 |
54 | Intent intent = new Intent(RegisterActivity.this, SecondActivity.class);
55 | startActivity(intent);
56 | finish();
57 |
58 | } else {
59 | createUser();
60 | }
61 |
62 | // ...
63 | }
64 | });
65 |
66 |
67 |
68 | }
69 |
70 | protected void createUser(){
71 |
72 | String email = ETemail.getText().toString().trim();
73 | String password = ETpassword.getText().toString().trim();
74 |
75 | mAuth.createUserWithEmailAndPassword(email, password)
76 | .addOnCompleteListener(this, new OnCompleteListener() {
77 | @Override
78 | public void onComplete(@NonNull Task task) {
79 | if (task.isSuccessful()) {
80 | // Sign in success, update UI with the signed-in user's information
81 | Log.d(TAG, "createUserWithEmail:success");
82 | FirebaseUser user = mAuth.getCurrentUser();
83 | Toast.makeText(RegisterActivity.this,"Logging in... ", Toast.LENGTH_SHORT).show();
84 | Intent intent = new Intent(RegisterActivity.this, SecondActivity.class);
85 | startActivity(intent);
86 | finish();
87 | } else {
88 | // If sign in fails, display a message to the user.
89 | Log.w(TAG, "createUserWithEmail:failure", task.getException());
90 | Toast.makeText(RegisterActivity.this, "Email already exists.",
91 | Toast.LENGTH_SHORT).show();
92 | // updateUI(null);
93 | }
94 |
95 | // ...
96 | }
97 | });
98 | }
99 |
100 | @Override
101 | protected void onCreate(Bundle savedInstanceState) {
102 | super.onCreate(savedInstanceState);
103 | setContentView(R.layout.register_activity);
104 |
105 | // Initialize Firebase Auth
106 | mAuth = FirebaseAuth.getInstance();
107 |
108 | ETemail = (EditText)findViewById(R.id.email);
109 | ETpassword = (EditText)findViewById(R.id.password);
110 |
111 |
112 | Button register = (Button) findViewById(R.id.register);
113 | register.setOnClickListener(new View.OnClickListener() {
114 | @Override
115 | public void onClick(View view) {
116 | registerUser();
117 | }
118 | });
119 | }
120 |
121 | @Override
122 | public void onStart() {
123 | super.onStart();
124 | // Check if user is signed in (non-null) and update UI accordingly.
125 | FirebaseUser currentUser = mAuth.getCurrentUser();
126 | //updateUI(currentUser);
127 | }
128 | }
129 |
--------------------------------------------------------------------------------
/FEED/app/src/main/java/com/example/feed/SecondActivity.java:
--------------------------------------------------------------------------------
1 | package com.example.feed;
2 |
3 | import androidx.appcompat.app.AppCompatActivity;
4 |
5 | import android.content.Intent;
6 | import android.os.Bundle;
7 | import android.view.View;
8 | import android.widget.Button;
9 |
10 | public class SecondActivity extends AppCompatActivity {
11 |
12 | @Override
13 | protected void onCreate(Bundle savedInstanceState) {
14 | super.onCreate(savedInstanceState);
15 | setContentView(R.layout.activity_second);
16 |
17 | Button donate = (Button) findViewById(R.id.donate);
18 | donate.setOnClickListener(new View.OnClickListener() {
19 | @Override
20 | public void onClick(View view) {
21 | Intent intent = new Intent(SecondActivity.this,DonateActivity.class);
22 | startActivity(intent);
23 | }
24 | });
25 |
26 | Button recieve = (Button) findViewById(R.id.recieve);
27 | recieve.setOnClickListener(new View.OnClickListener() {
28 | @Override
29 | public void onClick(View view) {
30 | Intent intent = new Intent(SecondActivity.this,RecieveActivity.class);
31 | startActivity(intent);
32 | }
33 | });
34 | }
35 | }
36 |
--------------------------------------------------------------------------------
/FEED/app/src/main/res/drawable-v24/ic_launcher_foreground.xml:
--------------------------------------------------------------------------------
1 |
7 |
12 |
13 |
19 |
22 |
25 |
26 |
27 |
28 |
34 |
35 |
--------------------------------------------------------------------------------
/FEED/app/src/main/res/drawable/background.xml:
--------------------------------------------------------------------------------
1 |
2 |
4 |
7 |
9 |
10 |
16 |
17 |
18 |
19 |
--------------------------------------------------------------------------------
/FEED/app/src/main/res/drawable/background_login.xml:
--------------------------------------------------------------------------------
1 |
2 |
4 |
7 |
9 |
10 |
16 |
17 |
18 |
19 |
--------------------------------------------------------------------------------
/FEED/app/src/main/res/drawable/ic_launcher_background.xml:
--------------------------------------------------------------------------------
1 |
2 |
8 |
10 |
12 |
14 |
16 |
18 |
20 |
22 |
24 |
26 |
28 |
30 |
32 |
34 |
36 |
38 |
40 |
42 |
44 |
46 |
48 |
50 |
52 |
54 |
56 |
58 |
60 |
62 |
64 |
66 |
68 |
70 |
72 |
74 |
75 |
--------------------------------------------------------------------------------
/FEED/app/src/main/res/drawable/logo.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/nizam19/Feed-Android/1032115c217cbf7bd92060a3d7793e27d9f2b16a/FEED/app/src/main/res/drawable/logo.jpg
--------------------------------------------------------------------------------
/FEED/app/src/main/res/drawable/myfooddonation.JPG:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/nizam19/Feed-Android/1032115c217cbf7bd92060a3d7793e27d9f2b16a/FEED/app/src/main/res/drawable/myfooddonation.JPG
--------------------------------------------------------------------------------
/FEED/app/src/main/res/drawable/new_login.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/nizam19/Feed-Android/1032115c217cbf7bd92060a3d7793e27d9f2b16a/FEED/app/src/main/res/drawable/new_login.jpg
--------------------------------------------------------------------------------
/FEED/app/src/main/res/drawable/password.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/nizam19/Feed-Android/1032115c217cbf7bd92060a3d7793e27d9f2b16a/FEED/app/src/main/res/drawable/password.png
--------------------------------------------------------------------------------
/FEED/app/src/main/res/drawable/pexels.jpeg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/nizam19/Feed-Android/1032115c217cbf7bd92060a3d7793e27d9f2b16a/FEED/app/src/main/res/drawable/pexels.jpeg
--------------------------------------------------------------------------------
/FEED/app/src/main/res/drawable/receiver.JPG:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/nizam19/Feed-Android/1032115c217cbf7bd92060a3d7793e27d9f2b16a/FEED/app/src/main/res/drawable/receiver.JPG
--------------------------------------------------------------------------------
/FEED/app/src/main/res/drawable/username.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/nizam19/Feed-Android/1032115c217cbf7bd92060a3d7793e27d9f2b16a/FEED/app/src/main/res/drawable/username.png
--------------------------------------------------------------------------------
/FEED/app/src/main/res/layout-v26/activity_donate.xml:
--------------------------------------------------------------------------------
1 |
2 |
9 |
10 |
25 |
26 |
44 |
45 |
61 |
62 |
78 |
79 |
90 |
91 |
--------------------------------------------------------------------------------
/FEED/app/src/main/res/layout/activity_display.xml:
--------------------------------------------------------------------------------
1 |
2 |
10 |
11 |
25 |
26 |
42 |
43 |
57 |
58 |
72 |
73 |
84 |
85 |
86 |
87 |
--------------------------------------------------------------------------------
/FEED/app/src/main/res/layout/activity_donate.xml:
--------------------------------------------------------------------------------
1 |
2 |
9 |
10 |
25 |
26 |
43 |
44 |
59 |
60 |
75 |
76 |
87 |
88 |
--------------------------------------------------------------------------------
/FEED/app/src/main/res/layout/activity_first.xml:
--------------------------------------------------------------------------------
1 |
2 |
9 |
10 |
22 |
23 |
40 |
41 |
57 |
58 |
69 |
70 |
71 |
84 |
85 |
94 |
95 |
96 |
--------------------------------------------------------------------------------
/FEED/app/src/main/res/layout/activity_main.xml:
--------------------------------------------------------------------------------
1 |
2 |
8 |
9 |
10 |
22 |
--------------------------------------------------------------------------------
/FEED/app/src/main/res/layout/activity_recieve.xml:
--------------------------------------------------------------------------------
1 |
2 |
11 |
12 |
19 |
20 |
--------------------------------------------------------------------------------
/FEED/app/src/main/res/layout/activity_second.xml:
--------------------------------------------------------------------------------
1 |
2 |
8 |
9 |
18 |
19 |
29 |
30 |
--------------------------------------------------------------------------------
/FEED/app/src/main/res/layout/register_activity.xml:
--------------------------------------------------------------------------------
1 |
2 |
13 |
25 |
26 |
27 |
28 |
41 |
45 |
46 |
50 |
51 |
55 |
56 |
69 |
73 |
74 |
82 |
83 |
84 |
--------------------------------------------------------------------------------
/FEED/app/src/main/res/mipmap-anydpi-v26/ic_launcher.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
--------------------------------------------------------------------------------
/FEED/app/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
--------------------------------------------------------------------------------
/FEED/app/src/main/res/mipmap-hdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/nizam19/Feed-Android/1032115c217cbf7bd92060a3d7793e27d9f2b16a/FEED/app/src/main/res/mipmap-hdpi/ic_launcher.png
--------------------------------------------------------------------------------
/FEED/app/src/main/res/mipmap-hdpi/ic_launcher_round.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/nizam19/Feed-Android/1032115c217cbf7bd92060a3d7793e27d9f2b16a/FEED/app/src/main/res/mipmap-hdpi/ic_launcher_round.png
--------------------------------------------------------------------------------
/FEED/app/src/main/res/mipmap-mdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/nizam19/Feed-Android/1032115c217cbf7bd92060a3d7793e27d9f2b16a/FEED/app/src/main/res/mipmap-mdpi/ic_launcher.png
--------------------------------------------------------------------------------
/FEED/app/src/main/res/mipmap-mdpi/ic_launcher_round.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/nizam19/Feed-Android/1032115c217cbf7bd92060a3d7793e27d9f2b16a/FEED/app/src/main/res/mipmap-mdpi/ic_launcher_round.png
--------------------------------------------------------------------------------
/FEED/app/src/main/res/mipmap-xhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/nizam19/Feed-Android/1032115c217cbf7bd92060a3d7793e27d9f2b16a/FEED/app/src/main/res/mipmap-xhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/FEED/app/src/main/res/mipmap-xhdpi/ic_launcher_round.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/nizam19/Feed-Android/1032115c217cbf7bd92060a3d7793e27d9f2b16a/FEED/app/src/main/res/mipmap-xhdpi/ic_launcher_round.png
--------------------------------------------------------------------------------
/FEED/app/src/main/res/mipmap-xxhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/nizam19/Feed-Android/1032115c217cbf7bd92060a3d7793e27d9f2b16a/FEED/app/src/main/res/mipmap-xxhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/FEED/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/nizam19/Feed-Android/1032115c217cbf7bd92060a3d7793e27d9f2b16a/FEED/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png
--------------------------------------------------------------------------------
/FEED/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/nizam19/Feed-Android/1032115c217cbf7bd92060a3d7793e27d9f2b16a/FEED/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/FEED/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/nizam19/Feed-Android/1032115c217cbf7bd92060a3d7793e27d9f2b16a/FEED/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png
--------------------------------------------------------------------------------
/FEED/app/src/main/res/values/colors.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | #008577
4 | #00574B
5 | #D81B60
6 |
7 |
--------------------------------------------------------------------------------
/FEED/app/src/main/res/values/dimens.xml:
--------------------------------------------------------------------------------
1 |
2 | 16dp
3 |
4 |
--------------------------------------------------------------------------------
/FEED/app/src/main/res/values/strings.xml:
--------------------------------------------------------------------------------
1 |
2 | FEED
3 | RegisterActivity
4 | Your name
5 | Food name
6 | Contact number
7 | Donate
8 | Food quantity
9 |
10 |
--------------------------------------------------------------------------------
/FEED/app/src/main/res/values/styles.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
10 |
11 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
--------------------------------------------------------------------------------
/FEED/app/src/test/java/com/example/feed/ExampleUnitTest.java:
--------------------------------------------------------------------------------
1 | package com.example.feed;
2 |
3 | import org.junit.Test;
4 |
5 | import static org.junit.Assert.*;
6 |
7 | /**
8 | * Example local unit test, which will execute on the development machine (host).
9 | *
10 | * @see Testing documentation
11 | */
12 | public class ExampleUnitTest {
13 | @Test
14 | public void addition_isCorrect() {
15 | assertEquals(4, 2 + 2);
16 | }
17 | }
--------------------------------------------------------------------------------
/FEED/build.gradle:
--------------------------------------------------------------------------------
1 | // Top-level build file where you can add configuration options common to all sub-projects/modules.
2 |
3 | buildscript {
4 | repositories {
5 | google()
6 | jcenter()
7 |
8 | }
9 | dependencies {
10 | classpath 'com.android.tools.build:gradle:3.4.2'
11 | classpath 'com.google.gms:google-services:4.2.0'
12 |
13 | // NOTE: Do not place your application dependencies here; they belong
14 | // in the individual module build.gradle files
15 | }
16 | }
17 |
18 | allprojects {
19 | repositories {
20 | //start here
21 | configurations.all {
22 | resolutionStrategy.eachDependency { DependencyResolveDetails details ->
23 | def requested = details.requested
24 | if (requested.group == 'com.google.android.gms') {
25 | details.useVersion '12.0.1'
26 | }
27 | if (requested.group == 'com.google.firebase') {
28 | details.useVersion '12.0.1'
29 | }
30 | }
31 | }
32 | //end
33 | google()
34 | jcenter()
35 |
36 | }
37 | }
38 |
39 | task clean(type: Delete) {
40 | delete rootProject.buildDir
41 | }
42 |
--------------------------------------------------------------------------------
/FEED/gradle.properties:
--------------------------------------------------------------------------------
1 | # Project-wide Gradle settings.
2 |
3 | # IDE (e.g. Android Studio) users:
4 | # Gradle settings configured through the IDE *will override*
5 | # any settings specified in this file.
6 |
7 | # For more details on how to configure your build environment visit
8 | # http://www.gradle.org/docs/current/userguide/build_environment.html
9 |
10 | # Specifies the JVM arguments used for the daemon process.
11 | # The setting is particularly useful for tweaking memory settings.
12 | org.gradle.jvmargs=-Xmx1536m
13 |
14 | # When configured, Gradle will run in incubating parallel mode.
15 | # This option should only be used with decoupled projects. More details, visit
16 | # http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects
17 | # org.gradle.parallel=true
18 |
19 | # AndroidX package structure to make it clearer which packages are bundled with the
20 | # Android operating system, and which are packaged with your app's APK
21 | # https://developer.android.com/topic/libraries/support-library/androidx-rn
22 | android.useAndroidX=true
23 | # Automatically convert third-party libraries to use AndroidX
24 | android.enableJetifier=true
25 |
26 |
--------------------------------------------------------------------------------
/FEED/gradle/wrapper/gradle-wrapper.jar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/nizam19/Feed-Android/1032115c217cbf7bd92060a3d7793e27d9f2b16a/FEED/gradle/wrapper/gradle-wrapper.jar
--------------------------------------------------------------------------------
/FEED/gradle/wrapper/gradle-wrapper.properties:
--------------------------------------------------------------------------------
1 | #Wed Aug 28 18:41:16 IST 2019
2 | distributionBase=GRADLE_USER_HOME
3 | distributionPath=wrapper/dists
4 | zipStoreBase=GRADLE_USER_HOME
5 | zipStorePath=wrapper/dists
6 | distributionUrl=https\://services.gradle.org/distributions/gradle-5.1.1-all.zip
7 |
--------------------------------------------------------------------------------
/FEED/gradlew:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env sh
2 |
3 | ##############################################################################
4 | ##
5 | ## Gradle start up script for UN*X
6 | ##
7 | ##############################################################################
8 |
9 | # Attempt to set APP_HOME
10 | # Resolve links: $0 may be a link
11 | PRG="$0"
12 | # Need this for relative symlinks.
13 | while [ -h "$PRG" ] ; do
14 | ls=`ls -ld "$PRG"`
15 | link=`expr "$ls" : '.*-> \(.*\)$'`
16 | if expr "$link" : '/.*' > /dev/null; then
17 | PRG="$link"
18 | else
19 | PRG=`dirname "$PRG"`"/$link"
20 | fi
21 | done
22 | SAVED="`pwd`"
23 | cd "`dirname \"$PRG\"`/" >/dev/null
24 | APP_HOME="`pwd -P`"
25 | cd "$SAVED" >/dev/null
26 |
27 | APP_NAME="Gradle"
28 | APP_BASE_NAME=`basename "$0"`
29 |
30 | # Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
31 | DEFAULT_JVM_OPTS=""
32 |
33 | # Use the maximum available, or set MAX_FD != -1 to use that value.
34 | MAX_FD="maximum"
35 |
36 | warn () {
37 | echo "$*"
38 | }
39 |
40 | die () {
41 | echo
42 | echo "$*"
43 | echo
44 | exit 1
45 | }
46 |
47 | # OS specific support (must be 'true' or 'false').
48 | cygwin=false
49 | msys=false
50 | darwin=false
51 | nonstop=false
52 | case "`uname`" in
53 | CYGWIN* )
54 | cygwin=true
55 | ;;
56 | Darwin* )
57 | darwin=true
58 | ;;
59 | MINGW* )
60 | msys=true
61 | ;;
62 | NONSTOP* )
63 | nonstop=true
64 | ;;
65 | esac
66 |
67 | CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar
68 |
69 | # Determine the Java command to use to start the JVM.
70 | if [ -n "$JAVA_HOME" ] ; then
71 | if [ -x "$JAVA_HOME/jre/sh/java" ] ; then
72 | # IBM's JDK on AIX uses strange locations for the executables
73 | JAVACMD="$JAVA_HOME/jre/sh/java"
74 | else
75 | JAVACMD="$JAVA_HOME/bin/java"
76 | fi
77 | if [ ! -x "$JAVACMD" ] ; then
78 | die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME
79 |
80 | Please set the JAVA_HOME variable in your environment to match the
81 | location of your Java installation."
82 | fi
83 | else
84 | JAVACMD="java"
85 | which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
86 |
87 | Please set the JAVA_HOME variable in your environment to match the
88 | location of your Java installation."
89 | fi
90 |
91 | # Increase the maximum file descriptors if we can.
92 | if [ "$cygwin" = "false" -a "$darwin" = "false" -a "$nonstop" = "false" ] ; then
93 | MAX_FD_LIMIT=`ulimit -H -n`
94 | if [ $? -eq 0 ] ; then
95 | if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then
96 | MAX_FD="$MAX_FD_LIMIT"
97 | fi
98 | ulimit -n $MAX_FD
99 | if [ $? -ne 0 ] ; then
100 | warn "Could not set maximum file descriptor limit: $MAX_FD"
101 | fi
102 | else
103 | warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT"
104 | fi
105 | fi
106 |
107 | # For Darwin, add options to specify how the application appears in the dock
108 | if $darwin; then
109 | GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\""
110 | fi
111 |
112 | # For Cygwin, switch paths to Windows format before running java
113 | if $cygwin ; then
114 | APP_HOME=`cygpath --path --mixed "$APP_HOME"`
115 | CLASSPATH=`cygpath --path --mixed "$CLASSPATH"`
116 | JAVACMD=`cygpath --unix "$JAVACMD"`
117 |
118 | # We build the pattern for arguments to be converted via cygpath
119 | ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null`
120 | SEP=""
121 | for dir in $ROOTDIRSRAW ; do
122 | ROOTDIRS="$ROOTDIRS$SEP$dir"
123 | SEP="|"
124 | done
125 | OURCYGPATTERN="(^($ROOTDIRS))"
126 | # Add a user-defined pattern to the cygpath arguments
127 | if [ "$GRADLE_CYGPATTERN" != "" ] ; then
128 | OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)"
129 | fi
130 | # Now convert the arguments - kludge to limit ourselves to /bin/sh
131 | i=0
132 | for arg in "$@" ; do
133 | CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -`
134 | CHECK2=`echo "$arg"|egrep -c "^-"` ### Determine if an option
135 |
136 | if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then ### Added a condition
137 | eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"`
138 | else
139 | eval `echo args$i`="\"$arg\""
140 | fi
141 | i=$((i+1))
142 | done
143 | case $i in
144 | (0) set -- ;;
145 | (1) set -- "$args0" ;;
146 | (2) set -- "$args0" "$args1" ;;
147 | (3) set -- "$args0" "$args1" "$args2" ;;
148 | (4) set -- "$args0" "$args1" "$args2" "$args3" ;;
149 | (5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;;
150 | (6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;;
151 | (7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;;
152 | (8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;;
153 | (9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;;
154 | esac
155 | fi
156 |
157 | # Escape application args
158 | save () {
159 | for i do printf %s\\n "$i" | sed "s/'/'\\\\''/g;1s/^/'/;\$s/\$/' \\\\/" ; done
160 | echo " "
161 | }
162 | APP_ARGS=$(save "$@")
163 |
164 | # Collect all arguments for the java command, following the shell quoting and substitution rules
165 | eval set -- $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS "\"-Dorg.gradle.appname=$APP_BASE_NAME\"" -classpath "\"$CLASSPATH\"" org.gradle.wrapper.GradleWrapperMain "$APP_ARGS"
166 |
167 | # by default we should be in the correct project dir, but when run from Finder on Mac, the cwd is wrong
168 | if [ "$(uname)" = "Darwin" ] && [ "$HOME" = "$PWD" ]; then
169 | cd "$(dirname "$0")"
170 | fi
171 |
172 | exec "$JAVACMD" "$@"
173 |
--------------------------------------------------------------------------------
/FEED/gradlew.bat:
--------------------------------------------------------------------------------
1 | @if "%DEBUG%" == "" @echo off
2 | @rem ##########################################################################
3 | @rem
4 | @rem Gradle startup script for Windows
5 | @rem
6 | @rem ##########################################################################
7 |
8 | @rem Set local scope for the variables with windows NT shell
9 | if "%OS%"=="Windows_NT" setlocal
10 |
11 | set DIRNAME=%~dp0
12 | if "%DIRNAME%" == "" set DIRNAME=.
13 | set APP_BASE_NAME=%~n0
14 | set APP_HOME=%DIRNAME%
15 |
16 | @rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
17 | set DEFAULT_JVM_OPTS=
18 |
19 | @rem Find java.exe
20 | if defined JAVA_HOME goto findJavaFromJavaHome
21 |
22 | set JAVA_EXE=java.exe
23 | %JAVA_EXE% -version >NUL 2>&1
24 | if "%ERRORLEVEL%" == "0" goto init
25 |
26 | echo.
27 | echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
28 | echo.
29 | echo Please set the JAVA_HOME variable in your environment to match the
30 | echo location of your Java installation.
31 |
32 | goto fail
33 |
34 | :findJavaFromJavaHome
35 | set JAVA_HOME=%JAVA_HOME:"=%
36 | set JAVA_EXE=%JAVA_HOME%/bin/java.exe
37 |
38 | if exist "%JAVA_EXE%" goto init
39 |
40 | echo.
41 | echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%
42 | echo.
43 | echo Please set the JAVA_HOME variable in your environment to match the
44 | echo location of your Java installation.
45 |
46 | goto fail
47 |
48 | :init
49 | @rem Get command-line arguments, handling Windows variants
50 |
51 | if not "%OS%" == "Windows_NT" goto win9xME_args
52 |
53 | :win9xME_args
54 | @rem Slurp the command line arguments.
55 | set CMD_LINE_ARGS=
56 | set _SKIP=2
57 |
58 | :win9xME_args_slurp
59 | if "x%~1" == "x" goto execute
60 |
61 | set CMD_LINE_ARGS=%*
62 |
63 | :execute
64 | @rem Setup the command line
65 |
66 | set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar
67 |
68 | @rem Execute Gradle
69 | "%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS%
70 |
71 | :end
72 | @rem End local scope for the variables with windows NT shell
73 | if "%ERRORLEVEL%"=="0" goto mainEnd
74 |
75 | :fail
76 | rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of
77 | rem the _cmd.exe /c_ return code!
78 | if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1
79 | exit /b 1
80 |
81 | :mainEnd
82 | if "%OS%"=="Windows_NT" endlocal
83 |
84 | :omega
85 |
--------------------------------------------------------------------------------
/FEED/settings.gradle:
--------------------------------------------------------------------------------
1 | include ':app'
2 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # Feed -Food waste management android application
2 | A Mobile Application for Android developed using Android studio as a Micro-Project in 5th semester
3 |
4 | **Technologies used-**
5 | 1) Android Studio (Java and XML)
6 | 2) Firebase (Authentication, Realtime Database)
7 | 3) Google Maps API (Getting user current location in the backend and opening that location in google maps)
8 |
9 | **About-**
10 | FEED is a realtime app which aims to reduce wastage of food.
11 | In the app, any person can register themselves as a user and either donate or recieve food.
12 | When ever a user donates food, it gets stored in the realtime database.
13 | Information is retrieved from the database every time any user wants to recieve food.
14 | The one who wishes to recieve is then directed to Google Maps for Location of the donor.
15 |
16 | [](https://www.youtube.com/watch?v=pEP2Zk_KSfM)
17 |
18 | CLICK :point_up: for a short youtube video demo of how this application functions
19 |
20 | _Enjoy the screenshots :)_
21 |
22 | Logo Page -
23 |
24 |
25 |
26 | Login or Register Page -
27 |
28 |
29 |
30 | Register Page -
31 |
32 |
33 |
34 | Food Donate or Recieve Page -
35 |
36 |
37 |
38 | Food Donation -
39 |
40 |
41 |
42 | Food Recieve -
43 |
44 |
45 |
46 | All Foods available for recieving -
47 |
48 |
49 |
50 | Location of the food you want to recieve -
51 |
52 |
53 |
54 | Thank you for reading!
55 |
--------------------------------------------------------------------------------
/ScreenShots/WhatsApp Image 2019-11-19 at 22.20.59 (1).jpeg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/nizam19/Feed-Android/1032115c217cbf7bd92060a3d7793e27d9f2b16a/ScreenShots/WhatsApp Image 2019-11-19 at 22.20.59 (1).jpeg
--------------------------------------------------------------------------------
/ScreenShots/WhatsApp Image 2019-11-19 at 22.20.59 (2).jpeg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/nizam19/Feed-Android/1032115c217cbf7bd92060a3d7793e27d9f2b16a/ScreenShots/WhatsApp Image 2019-11-19 at 22.20.59 (2).jpeg
--------------------------------------------------------------------------------
/ScreenShots/WhatsApp Image 2019-11-19 at 22.20.59 (3).jpeg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/nizam19/Feed-Android/1032115c217cbf7bd92060a3d7793e27d9f2b16a/ScreenShots/WhatsApp Image 2019-11-19 at 22.20.59 (3).jpeg
--------------------------------------------------------------------------------
/ScreenShots/WhatsApp Image 2019-11-19 at 22.20.59 (4).jpeg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/nizam19/Feed-Android/1032115c217cbf7bd92060a3d7793e27d9f2b16a/ScreenShots/WhatsApp Image 2019-11-19 at 22.20.59 (4).jpeg
--------------------------------------------------------------------------------
/ScreenShots/WhatsApp Image 2019-11-19 at 22.20.59 (5).jpeg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/nizam19/Feed-Android/1032115c217cbf7bd92060a3d7793e27d9f2b16a/ScreenShots/WhatsApp Image 2019-11-19 at 22.20.59 (5).jpeg
--------------------------------------------------------------------------------
/ScreenShots/WhatsApp Image 2019-11-19 at 22.20.59 (6).jpeg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/nizam19/Feed-Android/1032115c217cbf7bd92060a3d7793e27d9f2b16a/ScreenShots/WhatsApp Image 2019-11-19 at 22.20.59 (6).jpeg
--------------------------------------------------------------------------------
/ScreenShots/WhatsApp Image 2019-11-19 at 22.20.59 (7).jpeg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/nizam19/Feed-Android/1032115c217cbf7bd92060a3d7793e27d9f2b16a/ScreenShots/WhatsApp Image 2019-11-19 at 22.20.59 (7).jpeg
--------------------------------------------------------------------------------
/ScreenShots/WhatsApp Image 2019-11-19 at 22.20.59.jpeg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/nizam19/Feed-Android/1032115c217cbf7bd92060a3d7793e27d9f2b16a/ScreenShots/WhatsApp Image 2019-11-19 at 22.20.59.jpeg
--------------------------------------------------------------------------------