Archive for the 'Programming' Category

Android in a pre 1.0 version available


Google recently released a pre 1.0 beta version of the Android SDK.

“This is the first release of the Android SDK that is formally on the path to Android 1.0.”

This let assume at first handset devices are comming soon.
As Google clarifies this is the first serious version of on the way to Android 1.0. Previous releases were considered very early looks at the SDK. This release should be fully compatible with Android 1.0 and all applications build with this release should run on final Android 1.0 devices.
The differences between this release an the final release are expected to be small and no major API changes are planned.

This beta SDK contains a large number of bug fixes and improvements form the early SDKs.

Some important changes include:

* new standard applications like arlam, calculator, camera, music, photo and messages where added.
* inprovements of the developer tools, e.g., preview of the XML layout.
* changes and impreovements withing the API
* new “Home” screen.

The relase notes, change overview and API Delta Report give a complete overview about all changes and extenstion of the SDK.

Now some issues from these documents related to “GEO”:

Location (Geo)

* The android.hardware.Sensors class has been replaced by android.hardware.SensorManager and android.hardware.SensorListener.
* The SensorManager class now notifies SensorListener objects of sensor changes, rather than firing Intents. The registerListener and unregisterListener methods are used to add and remove listeners.
* There is a new constant SensorManager.STANDARD_GRAVITY that may be useful to interpret accelerometer values.
* A method LocationManager.getProviderNames() has been added that
* returns the names of all providers, including ones for which the caller lacks permissions.
* The LocationManager class now notifies LocationListener objects of location and status changes, rather than firing Intents.
* The requestUpdates method has been renamed to requestLocationUpdates and now takes a LocationListener object rather than an Intent.
* A new requestStatusUpdates method has been added, also taking a LocationListener object.
* The removeUpdates method now takes a LocationListener object.
* The LocationManager.request*Updates methods must be called from a Looper thread, such as the main thread of an Activity. Additional method variants have been added that take an explicit Looper argument to allow for use outside of a main thread.
* A number of constants have been added to the LocationManager class.
* The LocationProviderImpl class has been removed.
* The Address class has several addtional fields and accessors in or order to better describe real locations.  Several incorrectly named methods have been renamed.
* The Geocoder class contructor now requires a Context parameter.
* The Location class now includes information on the estimated accuracy of a fix. It has new reset() and set() methods.

MapView

* New required MapView attribute: android:apiKey. Just like the traditional Google Maps API, you will be required to provide an authentic API key for your Android application. For now, the value of this can be an arbitrary string, like “myapikey,” but will need to be changed in order to work on actual devices. A process for acquiring a key is coming soon.
* MapView.toggle* replaced with set*. DeviceType removed from all Overlay methods.
* OverlayController removed, replaced with direct access to the Overlay List, with MapView.getOverlays(). The recommended practice is to use the new ItemizedOverlay class to manage map Overlays.
* Adds support for “map pin” child view that marks a given geo-location on the map. Such a view would stay in the correct place as the map is scrolled and zoomed:
* MapView child views can now be positioned relative to the Map or to the View.
* MapView child views can now be aligned relative to their position point.
* MapView no longer has a showMyLocation attribute; all methods referring to location are removed from MapActivity, MapView, and MapController. The new way to display location on the map is by creating a new MyLocationOverlay, enabling it, and adding it through the OverlayController.OverlayController.doZoom() is removed.
* MapController.setFollowMyLocation() no longer accepts a zoom.
* MapView.PixelCalculator was moved out into its own class PixelConverter, and its methods were renamed and changed to
* use android.graphics.Point objects instead of int arrays.
* Point renamed to GeoPoint

Google Maps

* New Maps menu alphabetic shortcuts This adds four invisible menu items:
menu+I - zoom in
menu+O - zoom out
menu+J - previous result
menu+K - next result
* Add a new style attribute to enable/disable MapView’s My Location feature. By default it’s disable meaning no extra location based permissions are required for developers wanting to write a Maps based app.
* Move Overlay.PixelCalculator -> MapView.PixelCalculator and added a MapView.getPixelCalculator.
* A new GestureDetector to help detect common gestures.
* The OverlayController, MyLocationOverlay and MapController classes are changed to final

Release Notes
http://code.google.com/android/RELEASENOTES.html

Overview of Changes, m5 to Android 0.9 SDK
http://code.google.com/android/migrating/m5-0.9/changes-overview.html

ESRI ArcGIS 9.3 JavaScript API and Google Maps


Since ArcGIS 9.3 ESRI provides a JavaScript API of ArcGIS Server.

The video shows how to build powerful business applications by dynamically querying information contained in map layers.To query geometry properties you can use the esri.arcgis.gmaps.Query class.

More information for developers can be found at: http://resources.esri.com/arcgisserver/index.cfm?fa=jsapis

Written and submitted from Home, using my 802.11g WiFi network.

ArcGIS for AutoCAD


ArcGIS for AutoCAD is a free application that provides access to ArcGIS Server map services and allows CAD users to visualize and query GIS data without conversion in AutoCAD. As a CAD user, you can work directly with ArcGIS map services to add GIS context to your AutoCAD session.

This introductory video demonstrates how ArcGIS for AutoCAD leverages the spatial data management and cartographic capabilities of ArcGIS Server.

With ArcGIS for AutoCAD, you can (according to ESRI)

  • View live GIS maps, displaying GIS symbology of all underlying GIS data structures in CAD.
  • Include the results of GIS analysis in your CAD designs.
  • Include GIS basemaps in your CAD products.
  • Access feature attributes in CAD directly from the underlying GIS databases using the Identify tool.
  • Define the coordinate system within AutoCAD to automatically project maps on the fly without transforming CAD drawings or converting GIS data.

Link: http://www.esri.com/autocadapp

Writing KML from my C# Application


geKML is a project allowing to generate KML/KMZ documents from a C#.NET application.  geKML consists of .NET classes that will generate a properly formatted KML document that the Google Earth and Google Maps application can understand.  The purpose of these objects are to help the developer to easily construct their desired KML document hierarchy.  These objects will not help the developer decide what hierarchy is best for their application.  Unfortunately you’ll will still need to know how to structure your KML. geKML is hosted on SourceForge and is available for free.

How you can getting started

(original excerpt form the homepage)

The most important class you’ll need to use every time, is the geKML class.  This class will be the one responsible for writing the proper KML header information, and it will also kick off the generation of the rest of the KML objects.

To instantiate the geKML object, you will first need to decide what your “root” KML object will be.  It can be any object that Google Earth will recognize as a root object.  Popular choices are the Feature classes (NetworkLink, Placemark, ScreenOverlay, GroundOverlay, Folder, Document).  For simplicity sake, I recommend starting with the geDocument or geFolder object.

Since most of the Google Earth classes are optional, you’ll have to instantiate most of these objects as you want to use them and then add them to any properties or collections.

Once you have added all of the objects into your geKML.kmlRoot property, you will want to call the geKML.ToKML() method which will return a properly formatted KML byte array, which you can then save to a file or stream from a web server.

Below is a simple example of a basic document (root) and a placemark that exists within that document.  For simplicity sake this example uses hard coded values for properties, but in practice you will probably use values from some dynamic data source.

Welcome to the Google Earth KML API .NET 2.0 Website.  This website will host the official current documentation for the ge-kml project that is hosted on SourceForge.net.  Text versions of the documentation will also be hosted there, but due to scripting and formatting limitations I have chosen to host the official documentation here.  All menu items other than “Home” will take you to the project on SourceForge.

Click on the image to see the class diagramm in full size.

One simple Example from the Homepage:

using System; using System.Collections.Generic; using System.Text; using System.IO; using Google.KML; namespace Examples { public static class Example1{ public static void RunExample(string FileName) { // Use a Document as the root of the KML geDocument doc = new geDocument();  doc.Name = "My Root Document"; //Create a Placemark to put in the document //This placemark is going to be a point //but it could be anything in the Geometry class gePlacemark pm = new gePlacemark(); //Create some coordinates for the point at which //this placemark will sit. (Lat / Lon) geCoordinates coords = new geCoordinates(new geAngle90(37.422067), new geAngle180(-122.084437)); //Create a point with these new coordinates gePoint point = new gePoint(coords); //Assign the point to the Geometry property of the placemark. pm.Geometry = point; //Now lets add some other properties to our placemark pm.Name = "My Placemark"; pm.Snippet = "This is where I put my Placemark"; pm.Description = "I wonder where this is..."; //Finally, add the placemark to the document doc.Features.Add(pm); //Now that we have our document, lets create our KML geKML kml = new geKML(doc); //And our results... File.WriteAllBytes(FileName, kml.ToKML()); } } }

[via: http://gekml.boseefus.com/]

Written and submitted from Home, using my 802.11g WiFi network.

ByteOfPython e-Book


Script languages are becomming extreamly popular for solving tasks in GIS Environments. ArcGIS for example is using Python.

1129819772_77804dda7f.jpg

as scripting language, together with the ArcGIS ModelBuilder this could be very powerful for many task and an alternative to the (more difficult) ArcObject programming.

If you want to start with python here you can find a free e-book.

[via Stefan2904]
Written and submitted from Home, using my 802.11g WiFi network.