It has been a while since I have put up a new blog post about my project, and in that time I have actually accomplished a lot. Currently I have now put all of my little test projects into one so that now the program actually works like a program should. I also have full functionality with my map and have tested location data with other peoples phones. Now the rest just seems to be a lot of little things such as notification data as well as hiding ones self from the map if they don't want to be looked at. With the little time we have left I don't think that I will be getting to messaging one another through the app or photo transfer stuff. But who knows if I can get the main stuff working soon then I will take a shot at it.
As of right now I have finally figured out full communication with the compsci02 server. currently I am using files that I have on the server and need to read and write to them from my mobile app to gain the data that I need.
Reading was fairly easy because i could direct connect to my file from the application and read it in line by line. However writing to the file was a different story. Due to the nature of servers, I was not able to write through a stream that connected my app to the server, so what I did instead was create a php script on the server that writes to the file that I want it to by executing that script from my application. Because of this breakthrough, I have finally been able to start testing my application on multiple phones since I am reading and writing phone location data. I am happy to say that the map portion of my application is running smoothly. My next step is to figure out exactly how I am going to do "groups" or "friends" in my app and then start connecting the parts of my programs into one application. After figuring out how to connect my mobile app to a server, I now feel like I can really start to fly on the project. So far I have now created a login page where a user with an account can sign in based off of their email and password. Currently to test this I just having the program pull back the user from the server based off of the email entered. This week I hope to get my map working correctly where it can at least grab lat and long locations from the server and place them on the map.
After a couple of weeks of being stuck on the same problem, I have finally found a solution! I have been trying to grab data from a text file on a server and pull it back on my mobile application. I was trying so many things that just were not working correctly until I finally figured out that with Android mobile applications, one has to create a background thread different from the main thread that an application runs on to do any sort of networking. The main thread of these mobile applications controls all of the things connected to the user interface where the background thread does the rest of the network connection stuff. So now after using a background thread and testing with a file on a server that works, I have finally pulled back data from the internet to my application.
I have not gotten that much further on my project since my last post. I plan on working on it more starting today now that I have the time. The one thing that I did figure out was exactly how I was going to use my web service. There is this object in Java called HttpURLConnection which allows for me to open a URL connection from my application to the compsci02 server where I have placed some data files. I will be playing around with this and trying to establish a connection.
At this point in the project I have looked at a lot of things to get my project started. I have installed all of the software that I will need and have created a few sample programs to get a little understanding on how android studio works.
Now that I have got some of these test programs out, I have also started to develop a layout for how I am going to go about locating phones. For now I have come up with trying to figure out how to create a client/server program where there is a web server and each phone is a client. Through this each phone will not have to talk to each other but rather just having to talk to the server or go to the server to get the information needed. After getting assigned this project, I am actually really excited to get working on it. I have always wanted to try and write a mobile application and this now gives me the opportunity to do that. Up until this point all I have really done is research the different applications and tools that I might need to properly publish a mobile application to an android phone. This include finding a mobile android template as well as an android emulator to debug my application with, etc. I have also starting looking into google maps and how to incorporate it into my application.
|
AuthorSenior Computer Science major at St. Norbert College Archives
April 2016
Categories |