diff --git a/OsmSharp.Android.UI/IO/Web/NativeHttpWebRequest.cs b/OsmSharp.Android.UI/IO/Web/NativeHttpWebRequest.cs index 1d6577a3..6c775f02 100644 --- a/OsmSharp.Android.UI/IO/Web/NativeHttpWebRequest.cs +++ b/OsmSharp.Android.UI/IO/Web/NativeHttpWebRequest.cs @@ -23,7 +23,7 @@ namespace OsmSharp.Android.UI.IO.Web /// /// A native implementation the HttpWebRequest. /// - internal class NativeHttpWebRequest : OsmSharp.IO.Web.HttpWebRequest + internal class NativeHttpWebRequest : OsmSharp.IO.Web.HttpWebRequest { /// /// Holds the http webrequest. @@ -97,5 +97,13 @@ public override OsmSharp.IO.Web.HttpWebResponse EndGetResponse(IAsyncResult iar) { return new NativeHttpWebResponse((System.Net.HttpWebResponse)_httpWebRequest.EndGetResponse(iar)); } + + /// + /// Abort this instance. + /// + public override void Abort () + { + _httpWebRequest.Abort (); + } } } diff --git a/OsmSharp.Android.UI/IO/Web/NativeHttpWebResponse.cs b/OsmSharp.Android.UI/IO/Web/NativeHttpWebResponse.cs index d6c23801..3e2ad83d 100644 --- a/OsmSharp.Android.UI/IO/Web/NativeHttpWebResponse.cs +++ b/OsmSharp.Android.UI/IO/Web/NativeHttpWebResponse.cs @@ -23,7 +23,7 @@ namespace OsmSharp.Android.UI.IO.Web /// /// A native implementation the HttpWebResponse. /// - internal class NativeHttpWebResponse : OsmSharp.IO.Web.HttpWebResponse + internal class NativeHttpWebResponse : OsmSharp.IO.Web.HttpWebResponse { /// /// Holds the http webresponse. @@ -66,5 +66,13 @@ public override Stream GetResponseStream() { return _httpWebResponse.GetResponseStream(); } + + /// + /// Close this instance. + /// + public override void Close () + { + _httpWebResponse.Close (); + } } } \ No newline at end of file diff --git a/OsmSharp.Android.UI/OsmSharp.Android.UI.csproj b/OsmSharp.Android.UI/OsmSharp.Android.UI.csproj index 0e36f400..946904bd 100644 --- a/OsmSharp.Android.UI/OsmSharp.Android.UI.csproj +++ b/OsmSharp.Android.UI/OsmSharp.Android.UI.csproj @@ -12,9 +12,7 @@ Resources Assets OsmSharp.Android.UI - v4.2 - - + v4.4 true @@ -40,30 +38,25 @@ ..\OutputAndroid\OsmSharp.Android.UI.XML - - ..\packages\OsmSharp.Core.0.0.0.6-beta\lib\MonoAndroid\OsmSharp.dll - True - - - ..\packages\OsmSharp.Core.0.0.0.6-beta\lib\MonoAndroid\OsmSharp.Osm.dll - True - - - ..\packages\OsmSharp.Routing.0.0.0.11-beta\lib\MonoAndroid\OsmSharp.Routing.dll - True - - - ..\packages\protobuf-net.2.0.0.668\lib\portable-sl4+net40+wp7+windows8\protobuf-net.dll - True - - + + ..\packages\protobuf-net.2.0.0.668\lib\portable-sl4+net40+wp7+windows8\protobuf-net.dll + + ..\packages\Zlib.Portable.1.9.2\lib\portable-net4+sl4+wp71+win8\Zlib.Portable.dll - True + + + ..\packages\OsmSharp.Core.0.0.0.35-beta\lib\MonoAndroid\OsmSharp.dll + + + ..\packages\OsmSharp.Core.0.0.0.35-beta\lib\MonoAndroid\OsmSharp.Osm.dll + + + ..\packages\OsmSharp.Routing.0.0.0.17-beta\lib\MonoAndroid\OsmSharp.Routing.dll diff --git a/OsmSharp.Android.UI/Resources/Resource.designer.cs b/OsmSharp.Android.UI/Resources/Resource.designer.cs index ded6de21..c0896f9e 100644 --- a/OsmSharp.Android.UI/Resources/Resource.designer.cs +++ b/OsmSharp.Android.UI/Resources/Resource.designer.cs @@ -1,15 +1,15 @@ #pragma warning disable 1591 -//------------------------------------------------------------------------------ -// -// This code was generated by a tool. -// Runtime Version:4.0.30319.34209 -// -// Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. -// -//------------------------------------------------------------------------------ +// ------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// Mono Runtime Version: 4.0.30319.17020 +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// +// ------------------------------------------------------------------------------ -[assembly: global::Android.Runtime.ResourceDesignerAttribute("OsmSharp.Android.UI.Resource", IsApplication=false)] +[assembly: Android.Runtime.ResourceDesignerAttribute("OsmSharp.Android.UI.Resource", IsApplication=false)] namespace OsmSharp.Android.UI { diff --git a/OsmSharp.Android.UI/packages.config b/OsmSharp.Android.UI/packages.config index e4ad3df0..a7801370 100644 --- a/OsmSharp.Android.UI/packages.config +++ b/OsmSharp.Android.UI/packages.config @@ -1,8 +1,8 @@ - - - - - - - + + + + + + + \ No newline at end of file diff --git a/OsmSharp.UI/Map/Layers/LayerTile.cs b/OsmSharp.UI/Map/Layers/LayerTile.cs index 5a3ab1fe..7c4c836f 100644 --- a/OsmSharp.UI/Map/Layers/LayerTile.cs +++ b/OsmSharp.UI/Map/Layers/LayerTile.cs @@ -221,20 +221,14 @@ private void LoadTile(object state) OsmSharp.Logging.Log.TraceEvent("LayerTile", Logging.TraceEventType.Information, "Request tile@" + url); - Action responseAction = ((HttpWebResponse obj) => - { - this.Response(obj, tile); - - _loading.Remove(tile); - }); - Action wrapperAction = () => - { request.BeginGetResponse(new AsyncCallback((iar) => { + var response = (HttpWebResponse)((HttpWebRequest)iar.AsyncState).EndGetResponse(iar); try { - var response = (HttpWebResponse)((HttpWebRequest)iar.AsyncState).EndGetResponse(iar); - responseAction(response); + this.Response(response, tile); + + _loading.Remove(tile); } catch (WebException ex) { // catch webexceptions. @@ -279,14 +273,12 @@ private void LoadTile(object state) { // oops, exceptions that are not webexceptions!? OsmSharp.Logging.Log.TraceEvent("LayerTile", Logging.TraceEventType.Error, ex.Message); } + finally + { + response.Close(); + } }), request); - }; - wrapperAction.BeginInvoke(new AsyncCallback((iar) => - { - var action = (Action)iar.AsyncState; - action.EndInvoke(iar); - }), wrapperAction); - } + } catch (Exception ex) { // don't worry about exceptions here. OsmSharp.Logging.Log.TraceEvent("LayerTile", Logging.TraceEventType.Error, ex.Message); diff --git a/OsmSharp.UI/OsmSharp.UI.csproj b/OsmSharp.UI/OsmSharp.UI.csproj index d602fe1d..81a94d11 100644 --- a/OsmSharp.UI/OsmSharp.UI.csproj +++ b/OsmSharp.UI/OsmSharp.UI.csproj @@ -176,18 +176,6 @@ ..\packages\Antlr3.Runtime.PCL.3.5.0.3\lib\portable-win+net40+sl40+wp\Antlr3.Runtime.dll - - ..\packages\OsmSharp.Core.0.0.0.6-beta\lib\portable-net40+sl4+win8+wp7\OsmSharp.dll - True - - - ..\packages\OsmSharp.Core.0.0.0.6-beta\lib\portable-net40+sl4+win8+wp7\OsmSharp.Osm.dll - True - - - ..\packages\OsmSharp.Routing.0.0.0.11-beta\lib\portable-net40+sl4+win8+wp7\OsmSharp.Routing.dll - True - ..\packages\protobuf-net.2.0.0.668\lib\portable-sl4+net40+wp7+windows8\protobuf-net.dll @@ -195,6 +183,15 @@ ..\packages\Zlib.Portable.1.9.2\lib\portable-net4+sl4+wp71+win8\Zlib.Portable.dll + + ..\packages\OsmSharp.Core.0.0.0.35-beta\lib\portable-net40+sl4+win8+wp7\OsmSharp.Osm.dll + + + ..\packages\OsmSharp.Core.0.0.0.35-beta\lib\portable-net40+sl4+win8+wp7\OsmSharp.dll + + + ..\packages\OsmSharp.Routing.0.0.0.17-beta\lib\portable-net40+sl4+win8+wp7\OsmSharp.Routing.dll +