Blog

2/7/21 : I made a crude website that will host my ideas and progress for this project. I’ve had a couple of ideas that I think would be exceptional. I’m going to ping my phone with a gps pinger and store the data say maybe every minute so that I can get a good sample size of coordinates. I just need to figure out how I’m going to get this data and store it.


2/18/21 : We prepared crude drawings of our projects today. It really helped me to get my actual ideas on paper and see where I want to go. I figured out that I’m going to need a server and a client for this project in order to keep processing time done.


2/19/21 : Made some great progress this week. Got the app a crude design from my sketch up. I worked solely on the GPS activity this time because I feel like that’s the most important part at the moment. I figured out how to get the GPS of the device but I can’t stop getting it once the button is hit. Will look into it more next week when I start on Client-Server Communication.

The method
The Pinger Activity

2/27/21: I started to write some PHP and do research into backend development this week. I got some code written and put onto the compsci04 server that should work to return the data sent to itself back to the phone by outputting it into a text view.


3/8/21: After muddling around with PHP and trying to get it to work, I finally decided to go with XAMP on my home PC to run the server. I can just run it 24/7. I did get a response from the server which was pretty nice since I’ve been trying everything to get a response from the damn thing. It’s not a large input but I feel like I made a huge stride here. PHP is all I have left on the backend. This makes me excited.

<– Output | PHP –>

I also got some pretty crude Javascript up and running to show where I am on the map. I’m sure with some fiddling and some input from PHP it’ll all go well once I start throwing actual data in there to make markers with the heatmap.

<– Output | Javascript/HTML –>

3/14/21 : Some more big progress this week. I got some heatmap data hardcoded in to my project and it actually shows up! How neat is that! The only problem I have right now is getting JS and PHP talking to each other. JS needs the data from the SQL server that PHP has grabbed and I can’t seem to get it to work right now.


3/16/21: Got around to coding some more JS today. I made some large progress. I took away the hard coded points I put in for visuals and changed the map around a bit so I can see what I’m doing and see where the buildings are. I got JS and PHP talking to each other with help from Dr. McVey. I put 2 more points in my DB for testing purposes that were a little farther away and it’s pretty nice to see that the points are being generated programmatically. Pay no attention to the errors on the left. The code still runs perfectly fine.


3/20/21 : Ran into a small obstruction on the journey to sending data from the phone. I got the phone to connect to the database which is a great step in the right direction as that was the hefty lifting of the project done with. Now I just need to figure out why the app is sending null data to the database even though I initialize the variables correctly. The weird thing is that the pinger will show the correct lat and lon to the database once the start button is pressed twice which is weird. After the second button press, the data is correct for lat and lon and they send correctly.

First Press of Start
Second press of Start
After insert

As we can see, the data does go into the table. However, the time is null and nonexistent at this time. I have a feeling that the time is going to do the same thing as the lat and lon variables where it won’t initialize the first time but the second it will. I’m meeting with Dr. McVey on Tuesday to hopefully try and debug this.


3/29/21: I made the app finally be able to communicate with the server on my phone. I also set up the database on compsci04 as I was ready to migrate the data over as I knew it worked from my home PC. Low and behold, we got some DATA!!! And it looks pretty nifty! Now I just gotta refine the data from the table and somehow make the app work like I want it to. Other than that, the next big leap is sending the map to the phone!


4/5/21: I got an image to return to the phone from the server so that’s a plus. I’m unsure of how to return the map to the phone as an image but we’re working on it 🙂


4/12/21: After some careful deliberation, I’ve decided to switch from an ImageView to a WebView. This will allow me to return the webpage where the actual map is instead of returning the whole page as an image. This is much simpler and easier to use. I also implemented 2 dropdown menus on the backend to allow the user to select time constraints. I also added a calendar to allow the user to pick a specific day they want for the data.


4/22/21: I got the WebView working and the map is displaying correctly. Now just to fix the SQL side and get the fields to be correct on the phone when they’re sent as well.

Changing the SQL data type meant I had to truncate all my data so I’ll have to go grab some fresh data this weekend to input into the database for me to use.


4/24/21: Some great progress was made today. I got the SQL changed in my database so now it’s actually outputting the correct SQL in datetime format. I also did some work on the backend to match up the input value from the WebView to output the correct data on the next screen. I’m currently working on finding a way to only update the home screen instead of going to another screen.

This is the result of me applying my constraints on the data I gathered the day of. As we can see, the IDs are different so there should be more data up above 25.

As a result of getting the time, I was able to redo my SQL query so that it’d be able to get the correct points on the heatmap. It actually works and the data is being output correctly.


4/26/21: Made some more good progress today. I migrated the GPS pinging over to a Service that will run in the background as long as the app is running somewhere on the phone. It took me a while and the code isn’t really pretty but I made it work and it works fine. Even though it says there’s an error, it still runs fine. The error is throwing when I try to create my notification channel which I need to make my service run async. There is now a button to get the time for right now as well. I also got a ton of data today!

Button for right now
Data

As we can see, there are roughly about 180 entries from the time between 11:00 AM and 7:00 PM. I’ll let the service continue to run on my phone as I walk around campus.