Docsity

Tree Census Project - Wireless Networks - Lecture Slides, Slides of Wireless Networking

Partial preview of the text

Download Tree Census Project - Wireless Networks - Lecture Slides and more Slides Wireless Networking in PDF only on Docsity!

The Tree Census Project

What it is

  • We are counting the number of trees and taking pictures of them and their GPS location
  • We store the information in MySQL and display markers for the trees on a Google map.
  • Naturalists and cities can use this information to track diseases in trees. Also damage from wind storms.

Fancy Phone

  • The Droid
  • 5 Megapixel Camera
  • GPS sensor
  • Wifi and 3G
  • Android 2.

What our software does

  • It displays the GPS information in a readable format on the phone
  • It captures a picture taken with the phone and stores it on the server.
  • Then when Add Tree is clicked it displays a marker on the map and adds GPS information and picture to the database.

Used ASP.Net and Java

  • Used ASP.Net for the web pages
  • Used Java for Android and to send picture from phone to server
  • Use JavaScript for Google Map API
  • Problem! Communicating between JavaScript and ASP.NET.
  • ASP.NET provides a way called callbacks.

Solutions

ASP.NET provides several solutions:

  • client-side click methods โ€“ used for Add Tree
  • JavaScript callbacks โ€“ used for database access and adding pictures
  • Asynchronous Postbacks of a region โ€“ used so
  • Used all of these to solve problems we encountered

Camera View

  • Adapted CameraPreview sample from the samples provided
  • Instantiated GUI on the fly
  • To activate CameraPreview sent an intent to launch new activity:

Intent startCamera= new Intent(); startCamera.setClassName("com.codingzebra.TreeCensus2" , "com.codingzebra.TreeCensus2.TakePicture"); startActivity(startCamera);

  • To take and send picture used following code:

Code to take picture and send picture

mCamera.takePicture(null, null, new Camera.PictureCallback(){

public void onPictureTaken(byte[] jpegData, Camera camera) { create Socket get its output stream send number of bytes in jpegData send picture in jpegData }

View Trees

  • Can view all trees or selected type of tree
  • Use ODBC to connect to MySQL
  • OdbcDataReader reader = getAlltrees.ExecuteReader();
  • while (reader.Read())
  • {
  • Get latitude from reader
  • Get longitude from reade
  • Get treeType from reader
  • coordinate = coordinate +treeType+";"+ latitude
    • "," + longitude +";";
  • } Docsity.com

View Trees Client Side

  • function AddMarkers(args)
  • {
  • Clear map by creating a new map
  • var splitExpression = /[;]/; //used to split by ;
  • var urlStrings= args.split(splitExpression);
  • for( var i=0;i<urlStrings.length-1;i+=2)
  • {
  • // first parameter is type of tree second parameter is
  • location
  • addMarker(urlStrings[i],urlStrings[i+1]);
  • }
  • }

Future Plans

  • Allow for more than one phone at a time to take picture.
  • Ability to display more than one picture at a time
  • Speed up transmission of picture
  • Clean up GUI