The DBHelper method getAllDistanceDuration is expanded to return cost as well. It is using the following parameters:
- Origin
- Destination
- Emission cost (from settings)
- Time cost (from settings)
- Start and stop time for bicycling (from settings)
- Start and stop time for driving (from settings)
- Cost per kilometer for driving (from settings)
- Emissions per kilometer for driving (from settings)
- Ticket cost for transit (from settings)
- Emissions per kilometer for transit (from settings)
I query the distances and durations from the database:
The values are stored in an array of integers.
The settings are retrieved from SharedPreferences. |
Calculation of costs from the database. |
Finally, some notes about bugs for this project:
One issue was unrealistic calculations for travel mode; "DRIVING", that is solved now.
Two issues are remaining:
The second one will be tricky and the first one probably needs some Googling.
Once those two issues are solved and I've cleaned the code, I'll stop developing this app. In the next blog post, I'll discuss the journey of learning to build an Android App, and why this app won't reach Google Play for now.
One issue was unrealistic calculations for travel mode; "DRIVING", that is solved now.
The second one will be tricky and the first one probably needs some Googling.
Once those two issues are solved and I've cleaned the code, I'll stop developing this app. In the next blog post, I'll discuss the journey of learning to build an Android App, and why this app won't reach Google Play for now.
No comments:
Post a Comment