diff --git a/.gitignore b/.gitignore index c2d35eed44..62415322e0 100644 --- a/.gitignore +++ b/.gitignore @@ -30,4 +30,7 @@ PublishProfiles/ /tests/Microsoft.AspNet.SignalR.FunctionalTests/artifacts/ /samples/Microsoft.AspNet.SignalR.Client.WindowsStoreJavaScript.Samples/bld/ jquery.signalR.js -jquery.signalR.min.js \ No newline at end of file +jquery.signalR.min.js +xamarin/SignalRPackage/component/lib/mobile/Microsoft.AspNet.SignalR.Client.dll +xamarin/SignalRPackage/component/lib/mobile/Newtonsoft.Json.dll +xamarin/SignalRPackage/component/lib/mobile/System.Net.Http.Extensions.dll diff --git a/build/Build.proj b/build/Build.proj index 7569a32650..17cb82e6af 100644 --- a/build/Build.proj +++ b/build/Build.proj @@ -1,9 +1,9 @@ - - + + Debug true @@ -43,6 +43,10 @@ KeyFile=$(KeyFile) + + XamarinClientPath=$(XamarinClientPath) + + -$(BuildQuality) -$(ScaleoutBuildQuality) @@ -435,15 +439,22 @@ + Condition=" '$(XamarinClientPath)' == '' "/> + + + + + + + + - + - + diff --git a/xamarin/SignalRPackage/component/lib/mobile/Microsoft.AspNet.SignalR.Client.XML b/xamarin/SignalRPackage/component/lib/mobile/Microsoft.AspNet.SignalR.Client.XML deleted file mode 100644 index 483a75cad9..0000000000 --- a/xamarin/SignalRPackage/component/lib/mobile/Microsoft.AspNet.SignalR.Client.XML +++ /dev/null @@ -1,852 +0,0 @@ - - - - Microsoft.AspNet.SignalR.Client - - - - - The default implementation. - - - - - A client that can make http request. - - - - - Initializes the Http Clients - - Connection - - - - Makes an asynchronous http GET request to the specified url. - - The url to send the request to. - A callback that initializes the request with default values. - Indicates whether it is a long running request - A . - - - - Makes an asynchronous http POST request to the specified url. - - The url to send the request to. - A callback that initializes the request with default values. - form url encoded data. - Indicates whether it is a long running request - A . - - - - Initialize the Http Clients - - Connection - - - - Makes an asynchronous http GET request to the specified url. - - The url to send the request to. - A callback that initializes the request with default values. - Indicates whether the request is long running - A . - - - - Makes an asynchronous http POST request to the specified url. - - The url to send the request to. - A callback that initializes the request with default values. - form url encoded data. - Indicates whether the request is long running - A . - - - - Returns the appropriate client based on whether it is a long running request - - Indicates whether the request is long running - - - - - The http request - - - - - Aborts the request. - - - - - Set Request Headers - - request headers - - - - The user agent for this request. - - - - - The accept header for this request. - - - - - The http response. - - - - - Gets the steam that represents the response body. - - - - - - Provides client connections for SignalR services. - - - - - Initializes a new instance of the class. - - The url to connect to. - - - - Initializes a new instance of the class. - - The url to connect to. - The query string data to pass to the server. - - - - Initializes a new instance of the class. - - The url to connect to. - The query string data to pass to the server. - - - - Starts the . - - A task that represents when the connection has started. - - - - Starts the . - - The http client - A task that represents when the connection has started. - - - - Starts the . - - The transport to use. - A task that represents when the connection has started. - - - - Stops the and sends an abort message to the server. - - - - - Stops the and sends an abort message to the server. - The timeout - - - - - Stops the without sending an abort message to the server. - This function is called after we receive a disconnect message from the server. - - - - - Sends data asynchronously over the connection. - - The data to send. - A task that represents when the data has been sent. - - - - Sends an object that will be JSON serialized asynchronously over the connection. - - The value to serialize. - A task that represents when the data has been sent. - - - - Sets LastKeepAlive to the current time - - - - - Stop the connection, equivalent to calling connection.stop - - - - - Stop the connection, equivalent to calling connection.stop - - Set this to true to perform the dispose, false to do nothing - - - - Occurs when the has received data from the server. - - - - - Occurs when the has encountered an error. - - - - - Occurs when the is stopped. - - - - - Occurs when the starts reconnecting after an error. - - - - - Occurs when the successfully reconnects after a timeout. - - - - - Occurs when the state changes. - - - - - Occurs when the is about to timeout - - - - - The amount of time a transport will wait (while connecting) before failing. - This value is modified by adding the server's TransportConnectTimeout configuration value. - - - - - Object to store the various keep alive timeout values - - - - - Gets or sets the serializer used by the connection - - - - - Gets or sets the cookies associated with the connection. - - - - - Gets or sets authentication information for the connection. - - - - - Gets and sets headers for the requests - - - - - Gets the url for the connection. - - - - - Gets or sets the last message id for the connection. - - - - - Gets or sets the connection id for the connection. - - - - - Gets or sets the connection token for the connection. - - - - - Gets or sets the groups token for the connection. - - - - - Gets a dictionary for storing state for a the connection. - - - - - Gets the querystring specified in the ctor. - - - - - Gets the current of the connection. - - - - - Default text writer - - - - - Initializes a new instance of the HeartBeatMonitor Class - - - - - - - Updates LastKeepAlive and starts the timer - - - - - Callback function for the timer which determines if we need to notify the user or attempt to reconnect - - - - - Logic to determine if we need to notify the user or attempt to reconnect - - - - - - Dispose off the timer - - - - - Dispose off the timer - - - - - - A for interacting with Hubs. - - - - - Initializes a new instance of the class. - - The url to connect to. - - - - Initializes a new instance of the class. - - The url to connect to. - Determines if the default "/signalr" path should be appended to the specified url. - - - - Initializes a new instance of the class. - - The url to connect to. - The query string data to pass to the server. - - - - Initializes a new instance of the class. - - The url to connect to. - The query string data to pass to the server. - Determines if the default "/signalr" path should be appended to the specified url. - - - - Initializes a new instance of the class. - - The url to connect to. - The query string data to pass to the server. - - - - Initializes a new instance of the class. - - The url to connect to. - The query string data to pass to the server. - Determines if the default "/signalr" path should be appended to the specified url. - - - - Creates an for the hub with the specified name. - - The name of the hub. - A - - - - Extensions to the . - - - - - Gets the value of a state variable. - - The type of the state variable - The . - The name of the state variable. - The value of the state variable. - - - - Registers for an event with the specified name and callback - - The . - The name of the event. - The callback - An that represents this subscription. - - - - Registers for an event with the specified name and callback - - The . - The name of the event. - The callback - An that represents this subscription. - - - - Registers for an event with the specified name and callback - - The . - The name of the event. - The callback - An that represents this subscription. - - - - Registers for an event with the specified name and callback - - The . - The name of the event. - The callback - An that represents this subscription. - - - - Registers for an event with the specified name and callback - - The . - The name of the event. - The callback - An that represents this subscription. - - - - A client side proxy for a server side hub. - - - - - Executes a method on the server side hub asynchronously. - - The name of the method. - The arguments - A task that represents when invocation returned. - - - - Executes a method on the server side hub asynchronously. - - The type of result returned from the hub - The name of the method. - The arguments - A task that represents when invocation returned. - - - - Registers an event for the hub. - - The name of the event - A . - - - - Gets or sets state on the hub. - - The name of the field. - The value of the field - - - - Gets the serializer used by the connection. - - - - - Represents the result of a hub invocation. - - - - - The callback identifier - - - - - The return value of the hub - - - - - Indicates whether the Error is a . - - - - - The error message returned from the hub invocation. - - - - - Extra error data - - - - - The caller state from this hub. - - - - - Represents a subscription to a hub method. - - - - - Simplifies error recognition by unwrapping complex exceptions. - - The thrown exception. - An unwrapped exception in the form of a SignalRError. - - - - Represents errors that are thrown by the SignalR client - - - - - Create custom SignalR based error. - - The exception to unwrap - - - - Allow a SignalRError to be directly written to an output stream - - Exception error - - - - Dispose of the response - - - - - The status code of the error (if it was a WebException) - - - - - The response body of the error, if it was a WebException and the response is readable - - - - - The unwrapped underlying exception - - - - - Allows for thread safe invocation of a delegate. - - - - - Class to store all the Keep Alive properties - - - - - A strongly-typed resource class, for looking up localized strings, etc. - - - - - Returns the cached ResourceManager instance used by this class. - - - - - Overrides the current thread's CurrentUICulture property for all - resource lookups using this strongly typed resource class. - - - - - Looks up a localized string similar to Client Certificates cannot be added after the connection has started.. - - - - - Looks up a localized string similar to A client callback for event {0} with {1} argument(s) was found, however an error occurred because {2}. - - - - - Looks up a localized string similar to A client callback for event {0} with {1} argument(s) could not be found. - - - - - Looks up a localized string similar to The connection was stopped before it could be started.. - - - - - Looks up a localized string similar to The connection has not been established.. - - - - - Looks up a localized string similar to Data cannot be sent as connection is disconnected. Call start before sending any data.. - - - - - Looks up a localized string similar to You are using a version of the client that isn't compatible with the server. Client version {0}, server version {1}.. - - - - - Looks up a localized string similar to A HubProxy cannot be added after the connection has been started.. - - - - - Looks up a localized string similar to Server negotiation failed.. - - - - - Looks up a localized string similar to Request failed - task cancelled.. - - - - - Looks up a localized string similar to Transport failed trying to connect.. - - - - - Looks up a localized string similar to Transport timed out trying to connect. - - - - - Looks up a localized string similar to Url cannot contain query string directly. Pass query string values in using available overload.. - - - - - Looks up a localized string similar to Connection was disconnected before invocation result was received.. - - - - - Looks up a localized string similar to Connection started reconnecting before invocation result was received.. - - - - - Represents a change in the connection state. - - - - - Creates a new stance of . - - The old state of the connection. - The new state of the connection. - - - - Gets the old state of the connection. - - - - - Gets the new state of the connection. - - - - - Initializes a new instance of the class. - - The stream to read asynchronously payloads from. - - - - Starts the reader. - - - - - Closes the connection and the underlying stream. - - - - - Invoked when the stream is open. - - - - - Invoked when the reader is closed while in the Processing state. - - - - - Invoked when there's a message if received in the stream. - - - - - Indicates whether or not the active transport supports keep alive - - - - - Indicates whether or not the transport supports keep alive - - - - - The time to wait after a connection drops to try reconnecting. - - - - - The time to wait after an error happens to continue polling. - - - - - Indicates whether or not the transport supports keep alive - - - - - Starts the Polling Request Handler. - - - - - Fully stops the Polling Request Handlers. - - - - - Aborts the currently active polling request, does not stop the Polling Request Handler. - - - - - Used to generate the Url that is posted to for the poll. - - - - - Allows modification of the IRequest parameter before using it in a poll. - - - - - Sends the string based message to the callback. - - - - - If the poll errors OnError gets triggered and passes the exception. - - - - - Triggers when the polling request is in flight - - - - - Triggers before a new polling request is attempted. - Passes in an exception if the Poll errored, null otherwise. - Expects the return as a task in order to allow modification of timing for subsequent polls. - - - - - Fired when the current poll request was aborted, passing in the soon to be aborted request. - - - - - Indicates whether or not the transport supports keep alive - - - - - The time to wait after a connection drops to try reconnecting. - - - - - Event source implementation for .NET. This isn't to the spec but it's enough to support SignalR's - server. - - - - - Initializes a new instance of the class. - - The connection associated with this event source - The stream to read event source payloads from. - - - - Invoked when there's a message if received in the stream. - - - - - Helper class to manage disposing a resource at an arbirtary time - - - - diff --git a/xamarin/SignalRPackage/component/lib/mobile/Microsoft.AspNet.SignalR.Client.dll b/xamarin/SignalRPackage/component/lib/mobile/Microsoft.AspNet.SignalR.Client.dll deleted file mode 100644 index 5c1778dfdc..0000000000 Binary files a/xamarin/SignalRPackage/component/lib/mobile/Microsoft.AspNet.SignalR.Client.dll and /dev/null differ diff --git a/xamarin/SignalRPackage/component/lib/mobile/Newtonsoft.Json.dll b/xamarin/SignalRPackage/component/lib/mobile/Newtonsoft.Json.dll deleted file mode 100644 index 1080d27a38..0000000000 Binary files a/xamarin/SignalRPackage/component/lib/mobile/Newtonsoft.Json.dll and /dev/null differ diff --git a/xamarin/SignalRPackage/component/lib/mobile/System.Net.Http.Extensions.dll b/xamarin/SignalRPackage/component/lib/mobile/System.Net.Http.Extensions.dll deleted file mode 100644 index 85fd3b4de6..0000000000 Binary files a/xamarin/SignalRPackage/component/lib/mobile/System.Net.Http.Extensions.dll and /dev/null differ diff --git a/xamarin/SignalRPackage/component/samples/SignalRSample.sln b/xamarin/SignalRPackage/component/samples/SignalRSample.sln new file mode 100644 index 0000000000..1549ce9fa8 --- /dev/null +++ b/xamarin/SignalRPackage/component/samples/SignalRSample.sln @@ -0,0 +1,20 @@ + +Microsoft Visual Studio Solution File, Format Version 11.00 +# Visual Studio 2010 +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SignalRSample", "SignalRSample\SignalRSample.csproj", "{5501C06F-03B8-4B78-998A-75E843178473}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Any CPU = Debug|Any CPU + Release|Any CPU = Release|Any CPU + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {5501C06F-03B8-4B78-998A-75E843178473}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {5501C06F-03B8-4B78-998A-75E843178473}.Debug|Any CPU.Build.0 = Debug|Any CPU + {5501C06F-03B8-4B78-998A-75E843178473}.Release|Any CPU.ActiveCfg = Release|Any CPU + {5501C06F-03B8-4B78-998A-75E843178473}.Release|Any CPU.Build.0 = Release|Any CPU + EndGlobalSection + GlobalSection(MonoDevelopProperties) = preSolution + StartupItem = SignalRSample\SignalRSample.csproj + EndGlobalSection +EndGlobal diff --git a/xamarin/SignalRPackage/component/samples/SignalRSample/Assets/AboutAssets.txt b/xamarin/SignalRPackage/component/samples/SignalRSample/Assets/AboutAssets.txt new file mode 100644 index 0000000000..a9b0638eb1 --- /dev/null +++ b/xamarin/SignalRPackage/component/samples/SignalRSample/Assets/AboutAssets.txt @@ -0,0 +1,19 @@ +Any raw assets you want to be deployed with your application can be placed in +this directory (and child directories) and given a Build Action of "AndroidAsset". + +These files will be deployed with your package and will be accessible using Android's +AssetManager, like this: + +public class ReadAsset : Activity +{ + protected override void OnCreate (Bundle bundle) + { + base.OnCreate (bundle); + + InputStream input = Assets.Open ("my_asset.txt"); + } +} + +Additionally, some Android functions will automatically load asset files: + +Typeface tf = Typeface.CreateFromAsset (Context.Assets, "fonts/samplefont.ttf"); diff --git a/xamarin/SignalRPackage/component/samples/SignalRSample/MainActivity.cs b/xamarin/SignalRPackage/component/samples/SignalRSample/MainActivity.cs new file mode 100644 index 0000000000..03c468a030 --- /dev/null +++ b/xamarin/SignalRPackage/component/samples/SignalRSample/MainActivity.cs @@ -0,0 +1,14 @@ +using System; +using Android.App; +using Android.Content; +using Android.Runtime; +using Android.Views; +using Android.Widget; +using Android.OS; + +namespace SignalRSample +{ + // Please refer to github.com/signalr/signalr for iOS and Android samples +} + + diff --git a/xamarin/SignalRPackage/component/samples/SignalRSample/Properties/AndroidManifest.xml b/xamarin/SignalRPackage/component/samples/SignalRSample/Properties/AndroidManifest.xml new file mode 100644 index 0000000000..1a913a095f --- /dev/null +++ b/xamarin/SignalRPackage/component/samples/SignalRSample/Properties/AndroidManifest.xml @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/xamarin/SignalRPackage/component/samples/SignalRSample/Properties/AssemblyInfo.cs b/xamarin/SignalRPackage/component/samples/SignalRSample/Properties/AssemblyInfo.cs new file mode 100644 index 0000000000..ea55572db2 --- /dev/null +++ b/xamarin/SignalRPackage/component/samples/SignalRSample/Properties/AssemblyInfo.cs @@ -0,0 +1,23 @@ +using System.Reflection; +using System.Runtime.CompilerServices; +using Android.App; + +// Information about this assembly is defined by the following attributes. +// Change them to the values specific to your project. +[assembly: AssemblyTitle ("SignalRSample")] +[assembly: AssemblyDescription ("")] +[assembly: AssemblyConfiguration ("")] +[assembly: AssemblyCompany ("")] +[assembly: AssemblyProduct ("")] +[assembly: AssemblyCopyright ("abhisheknanda")] +[assembly: AssemblyTrademark ("")] +[assembly: AssemblyCulture ("")] +// The assembly version has the format "{Major}.{Minor}.{Build}.{Revision}". +// The form "{Major}.{Minor}.*" will automatically update the build and revision, +// and "{Major}.{Minor}.{Build}.*" will update just the revision. +[assembly: AssemblyVersion ("1.0.0")] +// The following attributes are used to specify the signing key for the assembly, +// if desired. See the Mono documentation for more information about signing. +//[assembly: AssemblyDelaySign(false)] +//[assembly: AssemblyKeyFile("")] + diff --git a/xamarin/SignalRPackage/component/samples/SignalRSample/Resources/AboutResources.txt b/xamarin/SignalRPackage/component/samples/SignalRSample/Resources/AboutResources.txt new file mode 100644 index 0000000000..10f52d4602 --- /dev/null +++ b/xamarin/SignalRPackage/component/samples/SignalRSample/Resources/AboutResources.txt @@ -0,0 +1,44 @@ +Images, layout descriptions, binary blobs and string dictionaries can be included +in your application as resource files. Various Android APIs are designed to +operate on the resource IDs instead of dealing with images, strings or binary blobs +directly. + +For example, a sample Android app that contains a user interface layout (main.axml), +an internationalization string table (strings.xml) and some icons (drawable-XXX/icon.png) +would keep its resources in the "Resources" directory of the application: + +Resources/ + drawable/ + icon.png + + layout/ + main.axml + + values/ + strings.xml + +In order to get the build system to recognize Android resources, set the build action to +"AndroidResource". The native Android APIs do not operate directly with filenames, but +instead operate on resource IDs. When you compile an Android application that uses resources, +the build system will package the resources for distribution and generate a class called "R" +(this is an Android convention) that contains the tokens for each one of the resources +included. For example, for the above Resources layout, this is what the R class would expose: + +public class R { + public class drawable { + public const int icon = 0x123; + } + + public class layout { + public const int main = 0x456; + } + + public class strings { + public const int first_string = 0xabc; + public const int second_string = 0xbcd; + } +} + +You would then use R.drawable.icon to reference the drawable/icon.png file, or R.layout.main +to reference the layout/main.axml file, or R.strings.first_string to reference the first +string in the dictionary file values/strings.xml. diff --git a/xamarin/SignalRPackage/component/samples/SignalRSample/Resources/Resource.designer.cs b/xamarin/SignalRPackage/component/samples/SignalRSample/Resources/Resource.designer.cs new file mode 100644 index 0000000000..c8370a4ddc --- /dev/null +++ b/xamarin/SignalRPackage/component/samples/SignalRSample/Resources/Resource.designer.cs @@ -0,0 +1,112 @@ +#pragma warning disable 1591 +// ------------------------------------------------------------------------------ +// +// 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: Android.Runtime.ResourceDesignerAttribute("SignalRSample.Resource", IsApplication=true)] + +namespace SignalRSample +{ + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("Xamarin.Android.Build.Tasks", "1.0.0.0")] + public partial class Resource + { + + static Resource() + { + global::Android.Runtime.ResourceIdManager.UpdateIdValues(); + } + + public static void UpdateIdValues() + { + } + + public partial class Attribute + { + + static Attribute() + { + global::Android.Runtime.ResourceIdManager.UpdateIdValues(); + } + + private Attribute() + { + } + } + + public partial class Drawable + { + + // aapt resource value: 0x7f020000 + public const int Icon = 2130837504; + + static Drawable() + { + global::Android.Runtime.ResourceIdManager.UpdateIdValues(); + } + + private Drawable() + { + } + } + + public partial class Id + { + + // aapt resource value: 0x7f050000 + public const int myButton = 2131034112; + + static Id() + { + global::Android.Runtime.ResourceIdManager.UpdateIdValues(); + } + + private Id() + { + } + } + + public partial class Layout + { + + // aapt resource value: 0x7f030000 + public const int Main = 2130903040; + + static Layout() + { + global::Android.Runtime.ResourceIdManager.UpdateIdValues(); + } + + private Layout() + { + } + } + + public partial class String + { + + // aapt resource value: 0x7f040001 + public const int app_name = 2130968577; + + // aapt resource value: 0x7f040000 + public const int hello = 2130968576; + + static String() + { + global::Android.Runtime.ResourceIdManager.UpdateIdValues(); + } + + private String() + { + } + } + } +} +#pragma warning restore 1591 diff --git a/xamarin/SignalRPackage/component/samples/SignalRSample/Resources/drawable/Icon.png b/xamarin/SignalRPackage/component/samples/SignalRSample/Resources/drawable/Icon.png new file mode 100644 index 0000000000..a07c69fa5a Binary files /dev/null and b/xamarin/SignalRPackage/component/samples/SignalRSample/Resources/drawable/Icon.png differ diff --git a/xamarin/SignalRPackage/component/samples/SignalRSample/Resources/layout/Main.axml b/xamarin/SignalRPackage/component/samples/SignalRSample/Resources/layout/Main.axml new file mode 100644 index 0000000000..d3fbffc655 --- /dev/null +++ b/xamarin/SignalRPackage/component/samples/SignalRSample/Resources/layout/Main.axml @@ -0,0 +1,14 @@ + + +