Thursday, June 17, 2010
Weekly Report 9
Weekly Report 9
Weekly Report 8
Weekly Report 7
- using java native api
- calling the c++ program as a process
Weekly Report 8
This week I worked on implementing the camera functionality of our product. Simulating the camera was a bit hard, but in the end I was able to do it in a proper way successfully.
First we have to make things clear. Android does not use the web cam to simulate the camera but when you correctly implemented it, you will get a default image from the platform and this will prove us that we are on the right way. First we have to give permission to the application to use camera functionality. We do it by adding “
Then we will get a camera from the system.
mCamera = Camera.open();
We will set the parameters of the camera:
Camera.Parameters params = mCamera.getParameters();
mSize = params.getPictureSize();
params.setPictureFormat(PixelFormat.JPEG);
mCamera.setParameters(params);
Then, we have to implement the callback function of the camera:
Camera.PictureCallback photoCallback = new Camera.PictureCallback() {
public void onPictureTaken(byte[] data, Camera camera) {
writeTextOnPicture(data);
}
};
With the above function we will get the default picture as a byte array. We will convert it to Bitmap object then will set the view to that image and we are done.
Weekly Report 7
Uri mmsUri = Uri.parse("file://"+"/sdcard" + IMAGE_FOLDER + this.pictureName + EXTENTION);
Intent intent = new Intent(Intent.ACTION_SEND);
intent.putExtra("sms_body", "Hi how are you");
intent.putExtra(Intent.EXTRA_STREAM, mmsUri);
intent.setType("image/png");
startActivity(intent);
We will add the picture we want to send as MMS and for that we need the content URI of the file. After that we will add a text to the MMS. However, Android emulator does not support sending MMS option. Normally, we were to type the port number of another emulator inside the “to” part of our emulator and the message would be sent immediately to the other emulator. I tested it and saw that it really doesn't work. However I was able to send SMS message to the other emulator when I deleted the image from the MMS message. This proved that the code I implemented is correct.
Weekly Report 6
public void extractGPS() {
LocationManager lm = (LocationManager) getSystemService(Context.LOCATION_SERVICE);
Location location = lm
.getLastKnownLocation(LocationManager.GPS_PROVIDER);
if (location != null) {
latitude = location.getLatitude();
longitude = location.getLongitude();
}
lm.requestLocationUpdates(LocationManager.GPS_PROVIDER, 1000L, 500.0f,
this);
}
With that code, we will get the GPS information from the emulator. After that we can get the name of the landmark. We start with giving permission to our application to use the Google Maps API by adding those lines to the android manifest:
First we get a geocoder object.
Geocoder geocoder = new Geocoder(this, Locale.getDefault());
Then, we will extract the address for our current location by using the geocode object.
List addresses = geocoder.getFromLocation(latitude,longitude, 1);
We will get the first line of the address, the rest will be discarded.
Address address = addresses.get(0);
Finally, we will extract the most meaningful part of that adress.
address.getFeatureName();
That's it. That way, we will get the name of the landmark.
Weekly Report 5
The methods we tried together with Çiğdem were not successful at all. However this week, we discovered that the solution is to add the image as an entity to the HttpPost object. After that longitude and latitude values will be added as a header to this object and execute method will be run.
Thursday, May 6, 2010
Weekly Report 6
Geocoder is the class for handling geocoding and reverse geocoding in android. Geocoding is the process of transforming a street address or other description of a location into a (latitude, longitude) coordinate. Reverse geocoding is the process of transforming a (latitude, longitude) coordinate into a (partial) address.
We mainly used:
List adress
getFromLocation(double latitude, double longitude, int maxResults)
Returns an array of Addresses that are known to describe the area immediately surrounding the given latitude and longitude.
and
the addres class which represents an Address, i.e, a set of Strings describing a location.
and the functions we used were:
String getFeatureName()
Returns the feature name of the address, for example, "Golden Gate Bridge", or null if it is unknown
After we implemented google maps module, we integrated it into the system which looks into the system for the the picture's future name. Now, the system first uses GoogleMaps to get future name of a point if it is unsuccessfull, it searches the database.
Hüseyin and Tolga also completed their tasks.
Thursday, April 15, 2010
Weekly Report 5
Friday, April 2, 2010
Weekly Report 4
telnet localhost 5554
then after we connect to android terminal we sent the swap event:
send event EV_SW:0:0
and
send event EV_SW:0:1
to make a 90 degrees rotation and a rotation in reverse direction. But we could not be able to handle any event using android sensor listener.
Lastly, I helped Tolga during his server-side work which consists of image information retrieving from image database according to the GPS location.
Finally, for this week's demo we achieved sending meeningful information (name of the place) from server to client using gps information.
Weekly Report 4
Thursday, April 1, 2010
Database Connection - Weekly Report
Firstly, I compiled some data about some famous landmarks including Anıtkabir, the Sheraton Hotel and the Eiffel Tower. In accordance with the entity relationship diagram we presented in the detailed design report, I populated some tables in the database which had already been created before. Now, the Location table holds GPS and compass information, the Imageinfo table contains information about the images and the images themselves, and Has_location table maps the locations with image infos. The SendPicture servlet is now capable of receiving latitude and longitude info of the image from the client and after querying the database using these values, responding to the client successfully with the image description found.
Department of Computer Engineering
Middle East Technical University
Weekly Report 4
For enhancing the communication between the client and the server, I can say that Cigdem and I are close to finding a solution to the file size problem. We enhanced the communication a bit, that is we are now able to send bigger images, but this is still not enough. In the code that we presented in the first demo, we had used String and StringBuffer objects to keep the image, now we realized that these objects have size limitation which prevents us from keeping the image properly.
In order to obtain compass data, we should be able to simulate the behavior of a magnetic compass. That's why we have to find a way to change the direction of the emulator. An application named SensorSimulator simulates this behavior. We have to first install an apk file to the android emulator, then run the Java application of the simulator. After that, we run the apk and connect the emulator and the running Java application. Now we are able to change the sensor values of the emulator. However, when we close the android application, that connection vanishes making it impossible for us to update the compass sensor value.
I also worked on obtaining the GPS information and sending it to the server. Now, depending on the GPS information, server will return a meaningful response to the android client.
Friday, March 26, 2010
Weekly Report 3
Thursday, March 25, 2010
Configuration Management Report - Weekly Report 3
Weekly Report 3
The purpose of this Configuration Management (CM) Plan is to provide an overview of the organization, activities, overall tasks, and objectives of Configuration Management for our application. It addresses configuration item (CI) identification, change control and configuration audits at a high level; additional details regarding CM activities, techniques, and tools should be provided in the CM-related procedures.
We specified the tools we are using, and explained the workload further.
Weekly Report 2
Friday, March 19, 2010
GoogleMaps Api problem and alternatives
"For most applications we recommend that you simply register your domain name. Your key will be valid for that domain, its subdomains, all URLs on hosts in those domains, and all ports on those hosts.
For example, if you sign up for a key using http://www.mygooglemapssite.com/
, your key is valid for:
http://www.mygooglemapssite.com/
http://www.mygooglemapssite.com/mysite/
However this key will not be valid for:
http://mygooglemapssite.com/
http://host1.mygooglemapssite.com/
http://host2.mygooglemapssite.com/mysite
If as recommended you request a key for http://mygooglemapssite.com/
your key will be valid for all of the URLs listed above.
http://www.mygooglemapssite.com/
will only be accepted when the site is accessed using this address. It will not be accepted if the site is accessed by IP address (eg. http://10.1.2.3/
) or by a hostname that is aliased to www.mygooglemapssite.com
using a DNS CNAME record"Therefore, we need to search other alternatives to Google map or find a solution to that authorization problem. JXMapViewer can be an alternative to Google Maps API. The JXMapViewer is an open source (LGPL) Swing component created by the developers at SwingLab. It is used for displaying maps on swing panels. On the other hand, Google Earth application already uses Google Maps API as a native PC program, so there should be a way to use it without a domain. This fact encourages us to search more about this problem.
Thursday, March 18, 2010
First Demo Contents
Entering the image names as command line input:
Most similar container image to the given image of an object - Weekly Report 2
What Does This Program Actually Do?
This week I had the opportunity of examining and improving that sample. The code begins with specifying parameters for extracting Speeded Up Robust Features using the line
Monday, March 15, 2010
Solution of file size problem in Demo
Friday, March 12, 2010
1st Demo
Thursday, March 11, 2010
Weekly Report - Project Website
On our website, there are pages that show the uploaded documents, tasks and actions to perform, a project timeline, our contact information and so on. It has all the features to coordinate and maintain the process of our project development. The site is located at https://sites.google.com/site/zephyrmetu/. Since we are given some disk space at the department to host our site, I redirected http://senior.ceng.metu.edu.tr/2010/zephyr/ to our website.
Finally, I thought of writing a piece of PHP code to maintain a log of the visitors of our page. Turns out, Google does not allow embedding PHP into web pages. So, I wrote the code to keep track of the visitors in PHP and uploaded it to our disk space at our department. Every time our page on Google Sites is requested, this script runs on the department's machine and returns the result. Google Sites allows this kind of "embedding" through a facility named "Embed Gadget". So, we have a log of visitors now.
Department of Computer Engineering
Middle East Technical University
SVN -Weekly Report 1
This week, before starting to implement core functions of our project, I started to work on how to use Subversion in eclipse in order to control our source codes in a better way. As far as I see, using SVN via Eclipse is much more easier than using it from the command line.
First, we have to prepare our environment to use SVN in eclipse.
From Help->Install New Software tab, we will use “http://download.eclipse.org/technology/subversive/0.7/update-site/” site for downloading SVN.
OpenCV and SURF -Weekly Report 1
Server Side of the project
Wednesday, March 10, 2010
Server Side of the Project (Admin Console)
Client Side of the Project (Android Application)
During graphical user interface design, we took simplicity into account. Since functionality is the main purpose of the GUI design (the KISS principle), developing simple functions for user is what has been done so far.
Now, we will explain the details of the user interface of the Android application.
Application Entrance Point
The application will start by double clicking the icon presented to the user on the main menu and “Conqi” will be the user friendly abbreviation of the application name “Conqueror”.
Main Window
This is the menu of our application. The user will be able to take a picture, view the gallery consisting of the pictures she had taken via Conqi and see her location on the satellite view of the map.
Take Picture Window
This is the screen the user will encounter, when she has already chosen the “Take Picture” option. After taking the picture, she will see the still image of the landmark with information given below it. Additionally, she will be supplied with more options with menu button of the phone.
More Options Menu
If the user wishes to see other options and she has already pressed menu button, she will encounter with this screen. Through this screen, she will be able to get more information about the landmark that she has previously viewed. Furthermore, she may send the tagged picture to other mobile phone users. Additionally she may save the picture to her phone if she chooses “Save” option.
View Gallery Window
When user chooses to view the gallery, she will be able to see the pictures in the SD card of the phone which are taken by Conqi itself. The user will be able to display them and send a picture via MMS if she chooses an individual picture.
View Gallery Window Displaying an Individual Picture
While the user is displaying the gallery, if she selects an individual picture, she will face this screen. She will be provided with “Send as MMS” option which enables her to send the picture to someone else via MMS.
Locate Me Window
If the user chooses “Locate Me” option in the main menu, she will be able to see her location on the satellite view of the map. She will be able to wander around and and zoom in or zoom out in the map.