Tracks: Energy and Environment Track(non beginner), Google Cloud and Duke Innovation Studio

Inspiration

Plastics are goods primarily made of fossil-fuel based chemicals that are usually disposed of after one or two uses. They are used everywhere: for packaging and for food and beverage service ware, such as bottles, wrappers, straws, bags, spoons, forks, etc. This plastic ends up in our landfills, oceans, and our environment. Plastic is not biodegradable and breaks down into smaller pieces of plastic called microplastics. It contaminates our water and soil, and as a result, the toxic chemicals from the plastic can be transferred to animals and eventually enters the human food chain. Plastic is a huge environmental problem and should be used sparingly, if used at all. We should all do our part to reduce, reuse and recycle.

I want to tackle the problem of recycling since recycling can be such a pain a lot of the time. Sorting is confusing, and where do we even take our recycling as not all communities have recycling bins that get emptied out magically everyday. You love the environment, and I do too. You want to help save the environment, but don't really know where to start? Let me help you! Start by recycling your everyday items by sorting trash into recyclables and nonrecyclables, and take them to your nearest recycling center.

What it does

The app has 2 main functionalities: 1.Scanning a barcode and comparing the barcode to the zxing library to get the number from the barcode. Then comparing the barcode to a database on Firebase deployed on Heroku to see whether or not the item is recyclable, and if so what type it is. Then users can click done to upload all their scanned items to track their recycling journey. 2.Getting your current location and the closest recycling center to you. Then, shows your current address and the address of the nearest recycling center on screen on a map widget on the screen. Users can then tap on the pin of the recycling center, which will show you the shortest route. The map also is a functioning map where you can search for places and click on the markers to get directions

How I built it

Google Maps API, Google Places, Google Directions, Google Geocoder API, zxing library, Firebase, Heroku using Android Studio, and Google OAuth. User accounts will be generated with Google OAuth for our Firebase Firestore database. When users hit scan, the zxing library is called to read the barcode. The read barcode data is then compared to our database, to then get the name, type and whether or not it is recyclable. If there is a match, the recyclerview will update it, as well as a little toast. When users click done, this session will be uploaded to Firebase, so users can view it in the future in feed.

There is also a map made with Google Maps API. When I search for a place by place name and not address, the Places API will match that location name to an address so I can put down a pin. I also used Google Geocoding to translate these addresses into a latitude and longtitude so I can put down markers. Paths are generated by the Google Directions API. The polylines were retrieved using a HTTP get request, then parsing out the JSON to get the polyline. Then I used PolyUtil package to decode the polyline into a list of latitude and longtitudes, then draw it as a polyline on the Map.

Challenges I ran into

Coding solo. Period. I wanted to see what I could make in 24 hours, and this was it! I had a lot of trouble finding a good library for the barcodes and free, and it took a while to find zxing. I couldn't find a god and free library that had barcode info and recycling info (type, recyclable or not). I was able to find https://www.barcodelookup.com/api but it is expensive. Using Firebase and google log in is always a challenge. Getting used to fragments, models, recyclerview, adapters, etc. Working with a big variety of APIs means that lots of documentation reading and confusion.

Accomplishments that I'm proud of

I have built a functioning app, with most of the features that I had originally planned for. The UI is very clean, though could be better if I had more time.

What I learned

How to use RecyclerView, fragments, models, adapters, Google Maps API, Google Places, Google Directions, Google Geocoder API, zxing library, Firebase, Heroku using Android Studio, and Google OAuth.

What's next for Sharkko

A bigger and better database. Only a few entries were stored and it was made locally. I want to add more features to the app. I also want to expand the UI, and make it more user friendly.

Share this project:

Updates