gw-sd-2016 / EcoFriendly

Tom Senior Design Project
0 stars 0 forks source link

Week 1: UI and Background Services #1

Open ttunca opened 8 years ago

ttunca commented 8 years ago

@twood02 @cctoombs Hello,

First and foremost, I am very sorry that committed files over and over again to this repo, I kept on accidentally putting code in my cloned desktop folder which messed everything up more than once. This was my first time using github and i didn't really understand what it was about until i made about 30 commits. The final files on this repo is finally the files I wanted to be on the repo and is my updated code for my project as of this weekend. I hope you accept my apology! 

There has been a good amount of improvement from week 1 (last week) to week 2 ("initial github push nov. 15"). During Week 1 I finished my user interface for my application using the layouts in the res folder and my MainActivity.java class. In the layouts, activity_main.xml is where the code for navigating to other pages of my application in a nice and organized left hand drawer. Next we have the layout called app_bar_main.xml where you will find the code for a green header bar so all my layouts will have the same type of layout. After that the layout nav_header_main.xml and fragment_process.xml have the initial home screen of the application where the application prompts the user if they are using more or less CO2 than the day before. The history of trips section of the application's UI took a little longer to code because i needed to fragment every section of that page. This way the app can populate the history section automatically, and  the application can easily go into an independent day's trips and compare that day's trips with the day before and see if the user used more or less CO2 and prompt it in the home page with the files Trip.java, HistoryFragment.java, and the layout fragment_history.xml

During week 2 i started to code the trip auto start function for the application. The high end idea of this is that the phone will check its accelerometer (to save battery than checking the gps every minute) if it is more than 0, which means the phone is moving. If the phones accelerometer is not 0 then it will take the location of the phone with its gps and wait some time before it checks the accelerometer again. If the accelerometer is still not at 0, the application will go to the gps and check if its in a significantly distant place from the first gps location and if it is the app will understand that distance as the user starting a trip. I started to code this in the files AutoStart.java and CustomTripsAdapter.java.

during the upcoming week i will code a background service for the application so it can run in the background of the phone and started to code the auto trip start function of the application. This way the application will not stop monitoring if the user starts a trip or lose data if the user is already on a trip when the phone's screen is off or the user goes to the phones home screen. I will also finish the auto start function of the application.