commit 09b555d29694dac042b71fd81d2ea7621244b23b Author: Tommy Parnell Date: Fri Jan 22 22:28:01 2016 -0500 init diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..6527bbc --- /dev/null +++ b/.gitignore @@ -0,0 +1,40 @@ +#Autosave files +*~ + +#build +[Oo]bj/ +[Bb]in/ +packages/ +TestResults/ + +# globs +Makefile.in +*.DS_Store +*.sln.cache +*.suo +*.cache +*.pidb +*.userprefs +*.usertasks +config.log +config.make +config.status +aclocal.m4 +install-sh +autom4te.cache/ +*.user +*.tar.gz +tarballs/ +test-results/ +Thumbs.db + +#Mac bundle stuff +*.dmg +*.app + +#resharper +*_Resharper.* +*.Resharper + +#dotCover +*.dotCover diff --git a/Components/xamarin.mobile-0.7.7.info b/Components/xamarin.mobile-0.7.7.info new file mode 100644 index 0000000..030786a --- /dev/null +++ b/Components/xamarin.mobile-0.7.7.info @@ -0,0 +1 @@ +{"Name":"Xamarin.Mobile","Id":2138,"Alias":"xamarin.mobile","Description":"Xamarin.Mobile is an API for accessing common platform features, such as\r\nreading the user\u0027s address book and using the camera, across iOS,\r\nAndroid, and Windows Phone.\r\n\r\nThe goal of Xamarin.Mobile is to decrease the amount of\r\nplatform-specific code needed to perform common tasks in multiplatform\r\napps, making development simpler and faster.\r\n\r\nXamarin.Mobile is currently a preview release and is subject to API\r\nchanges.\r\n\r\n**Note:** The Windows Phone 7.1 version of the library requires the\r\nMicrosoft.Bcl.Async NuGet package. You\u0027ll need to restore this package\r\nto use the samples or download this package to any WP7 app using\r\nXamarin.Mobile.\r\n\r\n## Examples\r\n\r\nTo access the address book (requires `READ_CONTACTS` permissions\r\non Android):\r\n\r\n```csharp\r\nusing Xamarin.Contacts;\r\n// ...\r\n\r\nvar book = new Xamarin.Contacts.AddressBook ();\r\n// new AddressBook (this); on Android\r\nif (!await book.RequestPermission()) {\r\n\tConsole.WriteLine (\"Permission denied by user or manifest\");\r\n\treturn;\r\n}\r\n\r\nforeach (Contact contact in book.OrderBy (c =\u003e c.LastName)) {\r\n\tConsole.WriteLine (\"{0} {1}\", contact.FirstName, contact.LastName);\r\n}\r\n```\r\n\r\nTo get the user\u0027s location (requires `ACCESS_COARSE_LOCATION` and\r\n`ACCESS_FINE_LOCATION` permissions on Android):\r\n\r\n```csharp\r\nusing Xamarin.Geolocation;\r\n// ...\r\n\r\nvar locator = new Geolocator { DesiredAccuracy = 50 };\r\n// new Geolocator (this) { ... }; on Android\r\n\r\nPosition position = await locator.GetPositionAsync (timeout: 10000);\r\n\r\nConsole.WriteLine (\"Position Status: {0}\", position.Timestamp);\r\nConsole.WriteLine (\"Position Latitude: {0}\", position.Latitude);\r\nConsole.WriteLine (\"Position Longitude: {0}\", position.Longitude);\r\n```\r\n\r\nTo take a photo:\r\n\r\n```csharp\r\nusing Xamarin.Media;\r\n// ...\r\n\r\nvar picker = new MediaPicker ();\r\nif (!picker.IsCameraAvailable)\r\n\tConsole.WriteLine (\"No camera!\");\r\nelse {\r\n\ttry {\r\n\t\tMediaFile file = await picker.TakePhotoAsync (new StoreCameraMediaOptions {\r\n\t\t\tName = \"test.jpg\",\r\n\t\t\tDirectory = \"MediaPickerSample\"\r\n\t\t});\r\n\r\n\t\tConsole.WriteLine (file.Path);\r\n\t} catch (OperationCanceledException) {\r\n\t\tConsole.WriteLine (\"Canceled\");\r\n\t}\r\n}\r\n```\r\n\r\nOn Android (requires `WRITE_EXTERNAL_STORAGE` permissions):\r\n\r\n```csharp\r\nusing Xamarin.Media;\r\n// ...\r\n\r\nprotected override void OnCreate (Bundle bundle)\r\n{\r\n\tvar picker = new MediaPicker (this);\r\n\tif (!picker.IsCameraAvailable)\r\n\t\tConsole.WriteLine (\"No camera!\");\r\n\telse {\r\n\t\tvar intent = picker.GetTakePhotoUI (new StoreCameraMediaOptions {\r\n\t\t\tName = \"test.jpg\",\r\n\t\t\tDirectory = \"MediaPickerSample\"\r\n\t\t});\r\n\t\tStartActivityForResult (intent, 1);\r\n\t}\r\n}\r\n\r\nprotected override async void OnActivityResult (int requestCode, Result resultCode, Intent data)\r\n{\r\n\t// User canceled\r\n\tif (resultCode == Result.Canceled)\r\n\t\treturn;\r\n\r\n\tMediaFile file = await data.GetMediaFileExtraAsync (this);\r\n\tConsole.WriteLine (file.Path);\r\n}\r\n```","Version":"0.7.7","Summary":"Xamarin.Mobile is a library that exposes a single set of APIs for accessing common mobile device functionality across iOS, Android and Windows platforms.","QuickStart":"## Examples\n\n### Contacts\nTo access the address book (requires `READ_CONTACTS` permissions\non Android):\n\n```csharp\nusing Xamarin.Contacts;\n// ...\n\nvar book = new Xamarin.Contacts.AddressBook ();\nbook.RequestPermission().ContinueWith (t =\u003e {\n\tif (!t.Result) {\n\t\tConsole.WriteLine (\"Permission denied by user or manifest\");\n\t\treturn;\n\t}\n\n\tforeach (Contact contact in book.OrderBy (c =\u003e c.LastName)) {\n\t\tConsole.WriteLine (\"{0} {1}\", contact.FirstName, contact.LastName);\n\t}\n}, TaskScheduler.FromCurrentSynchronizationContext());\n```\n\n### Geolocation\n\nTo get the user\u0027s location (requires `ACCESS_COARSE_LOCATION` and\n`ACCESS_FINE_LOCATION` permissions on Android):\n\n```csharp\nusing Xamarin.Geolocation;\n// ...\n\nvar locator = new Geolocator { DesiredAccuracy = 50 };\n// new Geolocator (this) { ... }; on Android\nlocator.GetPositionAsync (timeout: 10000).ContinueWith (t =\u003e {\n\tConsole.WriteLine (\"Position Status: {0}\", t.Result.Timestamp);\n\tConsole.WriteLine (\"Position Latitude: {0}\", t.Result.Latitude);\n\tConsole.WriteLine (\"Position Longitude: {0}\", t.Result.Longitude);\n}, TaskScheduler.FromCurrentSynchronizationContext());\n```\n\nNOTE: On iOS 8.0+ you must set either `NSLocationWhenInUseUsageDescription` or `NSLocationAlwaysUsageDescription` in your `Info.plist` file so that Xamarin.Mobile will request the appropriate permission from the user.\n\n### Media\n\n`MediaPicker` allows you to invoke the native UI to take or select photos or video. Given\nthat there is this UI interaction, the code (while simpler than doing it manually) will not\nbe completely cross-platform.\n\nTo take a photo on iOS, Windows Phone or WinRT:\n\n```csharp\nusing Xamarin.Media;\n// ...\n\nvar picker = new MediaPicker();\npicker.PickPhotoAsync().ContinueWith (t =\u003e {\n\tMediaFile file = t.Result;\n\tConsole.WriteLine (file.Path);\n}, TaskScheduler.FromCurrentSynchronizationContext());\n```\n\nOn Android and optionally on iOS, you control the UI.\n\nTo take a photo on Android (requires `WRITE_EXTERNAL_STORAGE` permissions):\n\n```csharp\nusing Xamarin.Media;\n// ...\n\nprotected override void OnCreate (Bundle bundle)\n{\n\tvar picker = new MediaPicker (this);\n\tif (!picker.IsCameraAvailable)\n\t\tConsole.WriteLine (\"No camera!\");\n\telse {\n\t\tvar intent = picker.GetTakePhotoUI (new StoreCameraMediaOptions {\n\t\t\tName = \"test.jpg\",\n\t\t\tDirectory = \"MediaPickerSample\"\n\t\t});\n\t\tStartActivityForResult (intent, 1);\n\t}\n}\n\nprotected override void OnActivityResult (int requestCode, Result resultCode, Intent data)\n{\n\t// User canceled\n\tif (resultCode == Result.Canceled)\n\t\treturn;\n\n\tdata.GetMediaFileExtraAsync (this).ContinueWith (t =\u003e {\n\t\tConsole.WriteLine (t.Result.Path);\n\t}, TaskScheduler.FromCurrentSynchronizationContext());\n}\n```\n\nTo take a photo on iOS controlling the UI:\n\n```csharp\nusing Xamarin.Media;\n// ...\n\nvar picker = new MediaPicker();\nMediaPickerController controller = picker.GetTakePhotoUI (new StoreCameraMediaOptions {\n\tName = \"test.jpg\",\n\tDirectory = \"MediaPickerSample\"\n});\n\n// On iPad, you\u0027ll use UIPopoverController to present the controller\nPresentViewController (controller, true, null);\n\ncontroller.GetResultAsync().ContinueWith (t =\u003e {\n\t// Dismiss the UI yourself\n\tcontroller.DismissViewController (true, () =\u003e {\n\t\tMediaFile file = t.Result;\n\t});\n\t\n}, TaskScheduler.FromCurrentSynchronizationContext());\n```\n#####Note to iOS 8 Developers\nShowing a `MediaPicker` in response to a `UIActionSheet.Clicked` event will cause unexpected behavior on iOS 8. Apps should be updated to conditionally use an `UIAlertController` with a style of `UIAlertControllerStyle.ActionSheet.` See the iOS sample for more info. \n\n\n","Hash":"e43b605338b1b263d954ba604905aa53","TargetPlatforms":["ios","android"],"TrialHash":null} \ No newline at end of file diff --git a/Components/xamarin.mobile-0.7.7.png b/Components/xamarin.mobile-0.7.7.png new file mode 100644 index 0000000..2a5ecfe Binary files /dev/null and b/Components/xamarin.mobile-0.7.7.png differ diff --git a/Components/xamarin.mobile-0.7.7/component/Details.md b/Components/xamarin.mobile-0.7.7/component/Details.md new file mode 100644 index 0000000..89f9427 --- /dev/null +++ b/Components/xamarin.mobile-0.7.7/component/Details.md @@ -0,0 +1,107 @@ +Xamarin.Mobile is an API for accessing common platform features, such as +reading the user's address book and using the camera, across iOS, +Android, and Windows Phone. + +The goal of Xamarin.Mobile is to decrease the amount of +platform-specific code needed to perform common tasks in multiplatform +apps, making development simpler and faster. + +Xamarin.Mobile is currently a preview release and is subject to API +changes. + +**Note:** The Windows Phone 7.1 version of the library requires the +Microsoft.Bcl.Async NuGet package. You'll need to restore this package +to use the samples or download this package to any WP7 app using +Xamarin.Mobile. + +## Examples + +To access the address book (requires `READ_CONTACTS` permissions +on Android): + +```csharp +using Xamarin.Contacts; +// ... + +var book = new Xamarin.Contacts.AddressBook (); +// new AddressBook (this); on Android +if (!await book.RequestPermission()) { + Console.WriteLine ("Permission denied by user or manifest"); + return; +} + +foreach (Contact contact in book.OrderBy (c => c.LastName)) { + Console.WriteLine ("{0} {1}", contact.FirstName, contact.LastName); +} +``` + +To get the user's location (requires `ACCESS_COARSE_LOCATION` and +`ACCESS_FINE_LOCATION` permissions on Android): + +```csharp +using Xamarin.Geolocation; +// ... + +var locator = new Geolocator { DesiredAccuracy = 50 }; +// new Geolocator (this) { ... }; on Android + +Position position = await locator.GetPositionAsync (timeout: 10000); + +Console.WriteLine ("Position Status: {0}", position.Timestamp); +Console.WriteLine ("Position Latitude: {0}", position.Latitude); +Console.WriteLine ("Position Longitude: {0}", position.Longitude); +``` + +To take a photo: + +```csharp +using Xamarin.Media; +// ... + +var picker = new MediaPicker (); +if (!picker.IsCameraAvailable) + Console.WriteLine ("No camera!"); +else { + try { + MediaFile file = await picker.TakePhotoAsync (new StoreCameraMediaOptions { + Name = "test.jpg", + Directory = "MediaPickerSample" + }); + + Console.WriteLine (file.Path); + } catch (OperationCanceledException) { + Console.WriteLine ("Canceled"); + } +} +``` + +On Android (requires `WRITE_EXTERNAL_STORAGE` permissions): + +```csharp +using Xamarin.Media; +// ... + +protected override void OnCreate (Bundle bundle) +{ + var picker = new MediaPicker (this); + if (!picker.IsCameraAvailable) + Console.WriteLine ("No camera!"); + else { + var intent = picker.GetTakePhotoUI (new StoreCameraMediaOptions { + Name = "test.jpg", + Directory = "MediaPickerSample" + }); + StartActivityForResult (intent, 1); + } +} + +protected override async void OnActivityResult (int requestCode, Result resultCode, Intent data) +{ + // User canceled + if (resultCode == Result.Canceled) + return; + + MediaFile file = await data.GetMediaFileExtraAsync (this); + Console.WriteLine (file.Path); +} +``` \ No newline at end of file diff --git a/Components/xamarin.mobile-0.7.7/component/GettingStarted.md b/Components/xamarin.mobile-0.7.7/component/GettingStarted.md new file mode 100644 index 0000000..fe7d845 --- /dev/null +++ b/Components/xamarin.mobile-0.7.7/component/GettingStarted.md @@ -0,0 +1,123 @@ +## Examples + +### Contacts +To access the address book (requires `READ_CONTACTS` permissions +on Android): + +```csharp +using Xamarin.Contacts; +// ... + +var book = new Xamarin.Contacts.AddressBook (); +book.RequestPermission().ContinueWith (t => { + if (!t.Result) { + Console.WriteLine ("Permission denied by user or manifest"); + return; + } + + foreach (Contact contact in book.OrderBy (c => c.LastName)) { + Console.WriteLine ("{0} {1}", contact.FirstName, contact.LastName); + } +}, TaskScheduler.FromCurrentSynchronizationContext()); +``` + +### Geolocation + +To get the user's location (requires `ACCESS_COARSE_LOCATION` and +`ACCESS_FINE_LOCATION` permissions on Android): + +```csharp +using Xamarin.Geolocation; +// ... + +var locator = new Geolocator { DesiredAccuracy = 50 }; +// new Geolocator (this) { ... }; on Android +locator.GetPositionAsync (timeout: 10000).ContinueWith (t => { + Console.WriteLine ("Position Status: {0}", t.Result.Timestamp); + Console.WriteLine ("Position Latitude: {0}", t.Result.Latitude); + Console.WriteLine ("Position Longitude: {0}", t.Result.Longitude); +}, TaskScheduler.FromCurrentSynchronizationContext()); +``` + +NOTE: On iOS 8.0+ you must set either `NSLocationWhenInUseUsageDescription` or `NSLocationAlwaysUsageDescription` in your `Info.plist` file so that Xamarin.Mobile will request the appropriate permission from the user. + +### Media + +`MediaPicker` allows you to invoke the native UI to take or select photos or video. Given +that there is this UI interaction, the code (while simpler than doing it manually) will not +be completely cross-platform. + +To take a photo on iOS, Windows Phone or WinRT: + +```csharp +using Xamarin.Media; +// ... + +var picker = new MediaPicker(); +picker.PickPhotoAsync().ContinueWith (t => { + MediaFile file = t.Result; + Console.WriteLine (file.Path); +}, TaskScheduler.FromCurrentSynchronizationContext()); +``` + +On Android and optionally on iOS, you control the UI. + +To take a photo on Android (requires `WRITE_EXTERNAL_STORAGE` permissions): + +```csharp +using Xamarin.Media; +// ... + +protected override void OnCreate (Bundle bundle) +{ + var picker = new MediaPicker (this); + if (!picker.IsCameraAvailable) + Console.WriteLine ("No camera!"); + else { + var intent = picker.GetTakePhotoUI (new StoreCameraMediaOptions { + Name = "test.jpg", + Directory = "MediaPickerSample" + }); + StartActivityForResult (intent, 1); + } +} + +protected override void OnActivityResult (int requestCode, Result resultCode, Intent data) +{ + // User canceled + if (resultCode == Result.Canceled) + return; + + data.GetMediaFileExtraAsync (this).ContinueWith (t => { + Console.WriteLine (t.Result.Path); + }, TaskScheduler.FromCurrentSynchronizationContext()); +} +``` + +To take a photo on iOS controlling the UI: + +```csharp +using Xamarin.Media; +// ... + +var picker = new MediaPicker(); +MediaPickerController controller = picker.GetTakePhotoUI (new StoreCameraMediaOptions { + Name = "test.jpg", + Directory = "MediaPickerSample" +}); + +// On iPad, you'll use UIPopoverController to present the controller +PresentViewController (controller, true, null); + +controller.GetResultAsync().ContinueWith (t => { + // Dismiss the UI yourself + controller.DismissViewController (true, () => { + MediaFile file = t.Result; + }); + +}, TaskScheduler.FromCurrentSynchronizationContext()); +``` +#####Note to iOS 8 Developers +Showing a `MediaPicker` in response to a `UIActionSheet.Clicked` event will cause unexpected behavior on iOS 8. Apps should be updated to conditionally use an `UIAlertController` with a style of `UIAlertControllerStyle.ActionSheet.` See the iOS sample for more info. + + diff --git a/Components/xamarin.mobile-0.7.7/component/License.md b/Components/xamarin.mobile-0.7.7/component/License.md new file mode 100644 index 0000000..b778464 --- /dev/null +++ b/Components/xamarin.mobile-0.7.7/component/License.md @@ -0,0 +1,174 @@ +# Apache License +Version 2.0, January 2004
+[http://www.apache.org/licenses/](http://www.apache.org/licenses/) + +TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + +1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + +2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + +3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + +4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + +5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + +6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + +7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + +8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + +9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. \ No newline at end of file diff --git a/Components/xamarin.mobile-0.7.7/component/Manifest.xml b/Components/xamarin.mobile-0.7.7/component/Manifest.xml new file mode 100644 index 0000000..35933de --- /dev/null +++ b/Components/xamarin.mobile-0.7.7/component/Manifest.xml @@ -0,0 +1,25 @@ + + + Xamarin.Mobile + Xamarin Inc. + http://xamarin.com/ + 0.7.7 + Xamarin.Mobile is a library that exposes a single set of APIs for accessing common mobile device functionality across iOS, Android and Windows platforms. + + + + + + Android Samples + Android Samples + + + iOS Classic API Samples + iOS Classic API Samples + + + iOS Unified API Samples + iOS Unified API Samples + + + \ No newline at end of file diff --git a/Components/xamarin.mobile-0.7.7/component/icons/xamarin.mobile_128x128.png b/Components/xamarin.mobile-0.7.7/component/icons/xamarin.mobile_128x128.png new file mode 100644 index 0000000..2a5ecfe Binary files /dev/null and b/Components/xamarin.mobile-0.7.7/component/icons/xamarin.mobile_128x128.png differ diff --git a/Components/xamarin.mobile-0.7.7/component/icons/xamarin.mobile_512x512.png b/Components/xamarin.mobile-0.7.7/component/icons/xamarin.mobile_512x512.png new file mode 100644 index 0000000..0400acd Binary files /dev/null and b/Components/xamarin.mobile-0.7.7/component/icons/xamarin.mobile_512x512.png differ diff --git a/Components/xamarin.mobile-0.7.7/component/screenshots/screenshot1.jpg b/Components/xamarin.mobile-0.7.7/component/screenshots/screenshot1.jpg new file mode 100644 index 0000000..36a271b Binary files /dev/null and b/Components/xamarin.mobile-0.7.7/component/screenshots/screenshot1.jpg differ diff --git a/Components/xamarin.mobile-0.7.7/lib/android/Xamarin.Mobile.dll b/Components/xamarin.mobile-0.7.7/lib/android/Xamarin.Mobile.dll new file mode 100644 index 0000000..505ef41 Binary files /dev/null and b/Components/xamarin.mobile-0.7.7/lib/android/Xamarin.Mobile.dll differ diff --git a/Components/xamarin.mobile-0.7.7/lib/ios-unified/Xamarin.Mobile.dll b/Components/xamarin.mobile-0.7.7/lib/ios-unified/Xamarin.Mobile.dll new file mode 100644 index 0000000..04522ba Binary files /dev/null and b/Components/xamarin.mobile-0.7.7/lib/ios-unified/Xamarin.Mobile.dll differ diff --git a/Components/xamarin.mobile-0.7.7/lib/ios/Xamarin.Mobile.dll b/Components/xamarin.mobile-0.7.7/lib/ios/Xamarin.Mobile.dll new file mode 100644 index 0000000..beecd2d Binary files /dev/null and b/Components/xamarin.mobile-0.7.7/lib/ios/Xamarin.Mobile.dll differ diff --git a/Components/xamarin.mobile-0.7.7/lib/winrt/Xamarin.Mobile.dll b/Components/xamarin.mobile-0.7.7/lib/winrt/Xamarin.Mobile.dll new file mode 100644 index 0000000..66c68fc Binary files /dev/null and b/Components/xamarin.mobile-0.7.7/lib/winrt/Xamarin.Mobile.dll differ diff --git a/Components/xamarin.mobile-0.7.7/lib/wp8/Xamarin.Mobile.dll b/Components/xamarin.mobile-0.7.7/lib/wp8/Xamarin.Mobile.dll new file mode 100644 index 0000000..9a0dfee Binary files /dev/null and b/Components/xamarin.mobile-0.7.7/lib/wp8/Xamarin.Mobile.dll differ diff --git a/Components/xamarin.mobile-0.7.7/samples/Xamarin.Mobile.Android.Samples/ContactsSample/Assets/AboutAssets.txt b/Components/xamarin.mobile-0.7.7/samples/Xamarin.Mobile.Android.Samples/ContactsSample/Assets/AboutAssets.txt new file mode 100644 index 0000000..ee39886 --- /dev/null +++ b/Components/xamarin.mobile-0.7.7/samples/Xamarin.Mobile.Android.Samples/ContactsSample/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 you 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"); \ No newline at end of file diff --git a/Components/xamarin.mobile-0.7.7/samples/Xamarin.Mobile.Android.Samples/ContactsSample/ContactActivity.cs b/Components/xamarin.mobile-0.7.7/samples/Xamarin.Mobile.Android.Samples/ContactsSample/ContactActivity.cs new file mode 100644 index 0000000..998dac0 --- /dev/null +++ b/Components/xamarin.mobile-0.7.7/samples/Xamarin.Mobile.Android.Samples/ContactsSample/ContactActivity.cs @@ -0,0 +1,72 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; + +using Android.App; +using Android.Content; +using Android.OS; +using Android.Runtime; +using Android.Views; +using Android.Widget; +using Xamarin.Contacts; + +namespace ContactsSample +{ + [Activity (Label = "ContactActivity")] + public class ContactActivity : Activity + { + protected override void OnCreate (Bundle bundle) + { + base.OnCreate (bundle); + + // + // Get the contact ID that is passed in + // from the main activity + // + String contactID = String.Empty; + if(bundle != null) + { + contactID = bundle.GetString("contactID"); + } + else + { + contactID = Intent.GetStringExtra("contactID"); + } + + Contact contact = MainActivity.AddressBook.Load (contactID); + + // + // If the contact is empty, we'll + // display a 'not found' error + // + String displayName = "Contact Not Found"; + String mobilePhone = String.Empty; + + // + // Set the displayName variable to the contact's + // DisplayName property + // + if(contact != null) + { + displayName = contact.DisplayName; + var phone = contact.Phones.FirstOrDefault (p => p.Type == PhoneType.Mobile); + if(phone != null) + { + mobilePhone = phone.Number; + } + } + + // + // Show the contacts display name and mobile phone + // + SetContentView (Resource.Layout.contact_view); + var fullNameTextView = FindViewById (Resource.Id.full_name); + fullNameTextView.Text = displayName; + var mobilePhoneTextView = FindViewById (Resource.Id.mobile_phone); + mobilePhoneTextView.Text = mobilePhone; + + } + } +} + diff --git a/Components/xamarin.mobile-0.7.7/samples/Xamarin.Mobile.Android.Samples/ContactsSample/Contacts Sample.csproj b/Components/xamarin.mobile-0.7.7/samples/Xamarin.Mobile.Android.Samples/ContactsSample/Contacts Sample.csproj new file mode 100644 index 0000000..7badca8 --- /dev/null +++ b/Components/xamarin.mobile-0.7.7/samples/Xamarin.Mobile.Android.Samples/ContactsSample/Contacts Sample.csproj @@ -0,0 +1,85 @@ + + + + Debug + AnyCPU + 8.0.30703 + 2.0 + {32E5FA7A-4754-49C6-BA09-2E262BEDC4CE} + {EFBA0AD7-5A72-4C68-AF49-83D382785DCF};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} + Library + Properties + ContactsSample + ContactsSample + 512 + true + Resources\Resource.Designer.cs + Off + Properties\AndroidManifest.xml + v2.3 + + + True + full + False + bin\Debug\ + DEBUG;TRACE + prompt + 4 + None + armeabi;armeabi-v7a;x86 + + + pdbonly + True + bin\Release\ + TRACE + prompt + 4 + False + armeabi;armeabi-v7a;x86 + + + + + + + + + + ../../../lib\/android/Xamarin.Mobile.dll + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/Components/xamarin.mobile-0.7.7/samples/Xamarin.Mobile.Android.Samples/ContactsSample/MainActivity.cs b/Components/xamarin.mobile-0.7.7/samples/Xamarin.Mobile.Android.Samples/ContactsSample/MainActivity.cs new file mode 100644 index 0000000..f194121 --- /dev/null +++ b/Components/xamarin.mobile-0.7.7/samples/Xamarin.Mobile.Android.Samples/ContactsSample/MainActivity.cs @@ -0,0 +1,68 @@ +using System; +using System.Text; +using System.Threading.Tasks; +using Android.App; +using Android.Content; +using Android.Database; +using Android.Net; +using Android.OS; +using Android.Provider; +using Android.Widget; +using Xamarin.Contacts; +using System.Linq; +using System.Collections.Generic; + +namespace ContactsSample +{ + [Activity(Label = "ContactsSample", MainLauncher = true, Icon = "@drawable/icon")] + public class MainActivity : ListActivity + { + List contacts = new List(); + List contactIDs = new List(); + + public static readonly AddressBook AddressBook = new AddressBook (Application.Context) { PreferContactAggregation = true }; + + protected override void OnCreate(Bundle bundle) + { + base.OnCreate(bundle); + + // We must request permission to access the user's address book + // This will prompt the user on platforms that ask, or it will validate + // manifest permissions on platforms that declare their required permissions. + AddressBook.RequestPermission().ContinueWith (t => + { + if (!t.Result) { + Toast.MakeText (this, "Permission denied, check your manifest", ToastLength.Long).Show(); + return; + } + + // Contacts can be selected and sorted using LINQ! + // + // In this sample, we'll just use LINQ to sort contacts by + // their last name in reverse order. + foreach (Contact contact in AddressBook.Where (c => c.FirstName != null).OrderBy (c => c.FirstName)) { + contacts.Add (contact.DisplayName); + contactIDs.Add (contact.Id); // Save the ID in a parallel list + } + + ListAdapter = new ArrayAdapter (this, Resource.Layout.list_item, contacts.ToArray()); + ListView.TextFilterEnabled = true; + + // When clicked, start a new activity to display more contact details + ListView.ItemClick += delegate (object sender, AdapterView.ItemClickEventArgs args) { + + // To show the contact on the details activity, we + // need to send that activity the contacts ID + string contactId = contactIDs[args.Position]; + Intent showContactDetails = new Intent (this, typeof(ContactActivity)); + showContactDetails.PutExtra ("contactID", contactId); + StartActivity (showContactDetails); + + // Alternatively, show a toast with the name of the contact selected + // + //Toast.MakeText (Application, ((TextView)args.View).Text, ToastLength.Short).Show (); + }; + }, TaskScheduler.FromCurrentSynchronizationContext()); + } + } +} \ No newline at end of file diff --git a/Components/xamarin.mobile-0.7.7/samples/Xamarin.Mobile.Android.Samples/ContactsSample/Properties/AndroidManifest.xml b/Components/xamarin.mobile-0.7.7/samples/Xamarin.Mobile.Android.Samples/ContactsSample/Properties/AndroidManifest.xml new file mode 100644 index 0000000..33f6f94 --- /dev/null +++ b/Components/xamarin.mobile-0.7.7/samples/Xamarin.Mobile.Android.Samples/ContactsSample/Properties/AndroidManifest.xml @@ -0,0 +1,7 @@ + + + + + + + \ No newline at end of file diff --git a/Components/xamarin.mobile-0.7.7/samples/Xamarin.Mobile.Android.Samples/ContactsSample/Properties/AssemblyInfo.cs b/Components/xamarin.mobile-0.7.7/samples/Xamarin.Mobile.Android.Samples/ContactsSample/Properties/AssemblyInfo.cs new file mode 100644 index 0000000..8739c90 --- /dev/null +++ b/Components/xamarin.mobile-0.7.7/samples/Xamarin.Mobile.Android.Samples/ContactsSample/Properties/AssemblyInfo.cs @@ -0,0 +1,40 @@ +using System.Reflection; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; +using Android.App; + +// General Information about an assembly is controlled through the following +// set of attributes. Change these attribute values to modify the information +// associated with an assembly. +[assembly: AssemblyTitle("ContactsSample")] +[assembly: AssemblyDescription("")] +[assembly: AssemblyConfiguration("")] +[assembly: AssemblyCompany("Xamarin Inc.")] +[assembly: AssemblyProduct("ContactsSample")] +[assembly: AssemblyCopyright("Copyright © 2011-2012 Xamarin Inc.")] +[assembly: AssemblyTrademark("")] +[assembly: AssemblyCulture("")] + +// Setting ComVisible to false makes the types in this assembly not visible +// to COM components. If you need to access a type in this assembly from +// COM, set the ComVisible attribute to true on that type. +[assembly: ComVisible(false)] + +// The following GUID is for the ID of the typelib if this project is exposed to COM +[assembly: Guid("a557ce8c-9dbe-4b93-8fc4-95ffc126cf14")] + +// Version information for an assembly consists of the following four values: +// +// Major Version +// Minor Version +// Build Number +// Revision +// +// You can specify all the values or you can default the Build and Revision Numbers +// by using the '*' as shown below: +// [assembly: AssemblyVersion("1.0.*")] +[assembly: AssemblyVersion("1.0.0.0")] +[assembly: AssemblyFileVersion("1.0.0.0")] + +// This app uses the internet, this can be removed if not needed +[assembly: UsesPermission("android.permission.INTERNET")] \ No newline at end of file diff --git a/Components/xamarin.mobile-0.7.7/samples/Xamarin.Mobile.Android.Samples/ContactsSample/Resources/Drawable/Icon.png b/Components/xamarin.mobile-0.7.7/samples/Xamarin.Mobile.Android.Samples/ContactsSample/Resources/Drawable/Icon.png new file mode 100644 index 0000000..8074c4c Binary files /dev/null and b/Components/xamarin.mobile-0.7.7/samples/Xamarin.Mobile.Android.Samples/ContactsSample/Resources/Drawable/Icon.png differ diff --git a/Components/xamarin.mobile-0.7.7/samples/Xamarin.Mobile.Android.Samples/ContactsSample/Resources/Layout/contact_view.xml b/Components/xamarin.mobile-0.7.7/samples/Xamarin.Mobile.Android.Samples/ContactsSample/Resources/Layout/contact_view.xml new file mode 100644 index 0000000..9cc411e --- /dev/null +++ b/Components/xamarin.mobile-0.7.7/samples/Xamarin.Mobile.Android.Samples/ContactsSample/Resources/Layout/contact_view.xml @@ -0,0 +1,20 @@ + + + + + + + \ No newline at end of file diff --git a/Components/xamarin.mobile-0.7.7/samples/Xamarin.Mobile.Android.Samples/ContactsSample/Resources/Layout/list_item.xml b/Components/xamarin.mobile-0.7.7/samples/Xamarin.Mobile.Android.Samples/ContactsSample/Resources/Layout/list_item.xml new file mode 100644 index 0000000..64c8f13 --- /dev/null +++ b/Components/xamarin.mobile-0.7.7/samples/Xamarin.Mobile.Android.Samples/ContactsSample/Resources/Layout/list_item.xml @@ -0,0 +1,7 @@ + + + diff --git a/Components/xamarin.mobile-0.7.7/samples/Xamarin.Mobile.Android.Samples/ContactsSample/Resources/Resource.Designer.cs b/Components/xamarin.mobile-0.7.7/samples/Xamarin.Mobile.Android.Samples/ContactsSample/Resources/Resource.Designer.cs new file mode 100644 index 0000000..256b860 --- /dev/null +++ b/Components/xamarin.mobile-0.7.7/samples/Xamarin.Mobile.Android.Samples/ContactsSample/Resources/Resource.Designer.cs @@ -0,0 +1,118 @@ +#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("ContactsSample.Resource", IsApplication=true)] + +namespace ContactsSample +{ + + + [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 full_name = 2131034112; + + // aapt resource value: 0x7f050001 + public const int mobile_phone = 2131034113; + + static Id() + { + global::Android.Runtime.ResourceIdManager.UpdateIdValues(); + } + + private Id() + { + } + } + + public partial class Layout + { + + // aapt resource value: 0x7f030000 + public const int contact_view = 2130903040; + + // aapt resource value: 0x7f030001 + public const int list_item = 2130903041; + + static Layout() + { + global::Android.Runtime.ResourceIdManager.UpdateIdValues(); + } + + private Layout() + { + } + } + + public partial class String + { + + // aapt resource value: 0x7f040001 + public const int ApplicationName = 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/Components/xamarin.mobile-0.7.7/samples/Xamarin.Mobile.Android.Samples/ContactsSample/Resources/Values/Strings.xml b/Components/xamarin.mobile-0.7.7/samples/Xamarin.Mobile.Android.Samples/ContactsSample/Resources/Values/Strings.xml new file mode 100644 index 0000000..b231544 --- /dev/null +++ b/Components/xamarin.mobile-0.7.7/samples/Xamarin.Mobile.Android.Samples/ContactsSample/Resources/Values/Strings.xml @@ -0,0 +1,5 @@ + + + Hello World, Click Me! + ContactsSample + diff --git a/Components/xamarin.mobile-0.7.7/samples/Xamarin.Mobile.Android.Samples/GeolocationSample/Assets/AboutAssets.txt b/Components/xamarin.mobile-0.7.7/samples/Xamarin.Mobile.Android.Samples/GeolocationSample/Assets/AboutAssets.txt new file mode 100644 index 0000000..ee39886 --- /dev/null +++ b/Components/xamarin.mobile-0.7.7/samples/Xamarin.Mobile.Android.Samples/GeolocationSample/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 you 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"); \ No newline at end of file diff --git a/Components/xamarin.mobile-0.7.7/samples/Xamarin.Mobile.Android.Samples/GeolocationSample/Geolocation Sample.csproj b/Components/xamarin.mobile-0.7.7/samples/Xamarin.Mobile.Android.Samples/GeolocationSample/Geolocation Sample.csproj new file mode 100644 index 0000000..8591346 --- /dev/null +++ b/Components/xamarin.mobile-0.7.7/samples/Xamarin.Mobile.Android.Samples/GeolocationSample/Geolocation Sample.csproj @@ -0,0 +1,75 @@ + + + + Debug + AnyCPU + 8.0.30703 + 2.0 + {82254F3E-647E-4F4A-AA4F-008A614C4B02} + {EFBA0AD7-5A72-4C68-AF49-83D382785DCF};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} + Library + GeolocationSample + Resources + Assets + Resource + True + Resources\Resource.designer.cs + GeolocationSample + Properties\AndroidManifest.xml + False + armeabi + + + v2.3 + + + True + full + False + bin\Debug + DEBUG; + prompt + 4 + False + None + True + armeabi;armeabi-v7a;x86 + + + none + False + bin\Release + prompt + 4 + False + False + armeabi;armeabi-v7a;x86 + + + + + + + + ../../../lib\/android/Xamarin.Mobile.dll + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/Components/xamarin.mobile-0.7.7/samples/Xamarin.Mobile.Android.Samples/GeolocationSample/MainActivity.cs b/Components/xamarin.mobile-0.7.7/samples/Xamarin.Mobile.Android.Samples/GeolocationSample/MainActivity.cs new file mode 100644 index 0000000..469e07d --- /dev/null +++ b/Components/xamarin.mobile-0.7.7/samples/Xamarin.Mobile.Android.Samples/GeolocationSample/MainActivity.cs @@ -0,0 +1,140 @@ +using System; +using Android.App; +using Android.Widget; +using Android.OS; +using System.Threading; +using Xamarin.Geolocation; + +namespace GeolocationSample +{ + [Activity (Label = "GeolocationSample", MainLauncher = true)] + public class MainActivity : Activity + { + private Button toggleListenButton, cancelPositionButton; + + private TextView positionStatus, positionLatitude, positionLongitude, positionAccuracy, + listenStatus, listenLatitude, listenLongitude, listenAccuracy; + + protected override void OnCreate (Bundle bundle) + { + base.OnCreate (bundle); + + // Set our view from the "main" layout resource + SetContentView (Resource.Layout.Main); + + FindViewById