├── .gitattributes
├── .gitignore
├── README.md
├── XamarinRest.Android
├── Assets
│ └── AboutAssets.txt
├── MainActivity.cs
├── Properties
│ ├── AndroidManifest.xml
│ └── AssemblyInfo.cs
├── Resources
│ ├── AboutResources.txt
│ ├── Resource.designer.cs
│ ├── layout
│ │ ├── Tabbar.xml
│ │ └── Toolbar.xml
│ ├── mipmap-anydpi-v26
│ │ ├── icon.xml
│ │ └── icon_round.xml
│ ├── mipmap-hdpi
│ │ ├── icon.png
│ │ └── launcher_foreground.png
│ ├── mipmap-mdpi
│ │ ├── icon.png
│ │ └── launcher_foreground.png
│ ├── mipmap-xhdpi
│ │ ├── icon.png
│ │ └── launcher_foreground.png
│ ├── mipmap-xxhdpi
│ │ ├── icon.png
│ │ └── launcher_foreground.png
│ ├── mipmap-xxxhdpi
│ │ ├── icon.png
│ │ └── launcher_foreground.png
│ └── values
│ │ ├── colors.xml
│ │ └── styles.xml
└── XamarinRest.Android.csproj
├── XamarinRest.iOS
├── AppDelegate.cs
├── Assets.xcassets
│ └── AppIcon.appiconset
│ │ ├── Contents.json
│ │ ├── Icon1024.png
│ │ ├── Icon120.png
│ │ ├── Icon152.png
│ │ ├── Icon167.png
│ │ ├── Icon180.png
│ │ ├── Icon20.png
│ │ ├── Icon29.png
│ │ ├── Icon40.png
│ │ ├── Icon58.png
│ │ ├── Icon60.png
│ │ ├── Icon76.png
│ │ ├── Icon80.png
│ │ └── Icon87.png
├── Entitlements.plist
├── Info.plist
├── Main.cs
├── Properties
│ └── AssemblyInfo.cs
├── Resources
│ ├── Default-568h@2x.png
│ ├── Default-Portrait.png
│ ├── Default-Portrait@2x.png
│ ├── Default.png
│ ├── Default@2x.png
│ └── LaunchScreen.storyboard
└── XamarinRest.iOS.csproj
├── XamarinRest.sln
└── XamarinRest
├── App.xaml
├── App.xaml.cs
├── AssemblyInfo.cs
├── MainPage.xaml
├── MainPage.xaml.cs
├── Post.cs
└── XamarinRest.csproj
/.gitattributes:
--------------------------------------------------------------------------------
1 | ###############################################################################
2 | # Set default behavior to automatically normalize line endings.
3 | ###############################################################################
4 | * text=auto
5 |
6 | ###############################################################################
7 | # Set default behavior for command prompt diff.
8 | #
9 | # This is need for earlier builds of msysgit that does not have it on by
10 | # default for csharp files.
11 | # Note: This is only used by command line
12 | ###############################################################################
13 | #*.cs diff=csharp
14 |
15 | ###############################################################################
16 | # Set the merge driver for project and solution files
17 | #
18 | # Merging from the command prompt will add diff markers to the files if there
19 | # are conflicts (Merging from VS is not affected by the settings below, in VS
20 | # the diff markers are never inserted). Diff markers may cause the following
21 | # file extensions to fail to load in VS. An alternative would be to treat
22 | # these files as binary and thus will always conflict and require user
23 | # intervention with every merge. To do so, just uncomment the entries below
24 | ###############################################################################
25 | #*.sln merge=binary
26 | #*.csproj merge=binary
27 | #*.vbproj merge=binary
28 | #*.vcxproj merge=binary
29 | #*.vcproj merge=binary
30 | #*.dbproj merge=binary
31 | #*.fsproj merge=binary
32 | #*.lsproj merge=binary
33 | #*.wixproj merge=binary
34 | #*.modelproj merge=binary
35 | #*.sqlproj merge=binary
36 | #*.wwaproj merge=binary
37 |
38 | ###############################################################################
39 | # behavior for image files
40 | #
41 | # image files are treated as binary by default.
42 | ###############################################################################
43 | #*.jpg binary
44 | #*.png binary
45 | #*.gif binary
46 |
47 | ###############################################################################
48 | # diff behavior for common document formats
49 | #
50 | # Convert binary document formats to text before diffing them. This feature
51 | # is only available from the command line. Turn it on by uncommenting the
52 | # entries below.
53 | ###############################################################################
54 | #*.doc diff=astextplain
55 | #*.DOC diff=astextplain
56 | #*.docx diff=astextplain
57 | #*.DOCX diff=astextplain
58 | #*.dot diff=astextplain
59 | #*.DOT diff=astextplain
60 | #*.pdf diff=astextplain
61 | #*.PDF diff=astextplain
62 | #*.rtf diff=astextplain
63 | #*.RTF diff=astextplain
64 |
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | ## Ignore Visual Studio temporary files, build results, and
2 | ## files generated by popular Visual Studio add-ons.
3 |
4 | # User-specific files
5 | *.suo
6 | *.user
7 | *.userosscache
8 | *.sln.docstates
9 |
10 | # User-specific files (MonoDevelop/Xamarin Studio)
11 | *.userprefs
12 |
13 | # Build results
14 | [Dd]ebug/
15 | [Dd]ebugPublic/
16 | [Rr]elease/
17 | [Rr]eleases/
18 | x64/
19 | x86/
20 | bld/
21 | [Bb]in/
22 | [Oo]bj/
23 | [Ll]og/
24 |
25 | # Visual Studio 2015 cache/options directory
26 | .vs/
27 | # Uncomment if you have tasks that create the project's static files in wwwroot
28 | #wwwroot/
29 |
30 | # MSTest test Results
31 | [Tt]est[Rr]esult*/
32 | [Bb]uild[Ll]og.*
33 |
34 | # NUNIT
35 | *.VisualState.xml
36 | TestResult.xml
37 |
38 | # Build Results of an ATL Project
39 | [Dd]ebugPS/
40 | [Rr]eleasePS/
41 | dlldata.c
42 |
43 | # DNX
44 | project.lock.json
45 | project.fragment.lock.json
46 | artifacts/
47 |
48 | *_i.c
49 | *_p.c
50 | *_i.h
51 | *.ilk
52 | *.meta
53 | *.obj
54 | *.pch
55 | *.pdb
56 | *.pgc
57 | *.pgd
58 | *.rsp
59 | *.sbr
60 | *.tlb
61 | *.tli
62 | *.tlh
63 | *.tmp
64 | *.tmp_proj
65 | *.log
66 | *.vspscc
67 | *.vssscc
68 | .builds
69 | *.pidb
70 | *.svclog
71 | *.scc
72 |
73 | # Chutzpah Test files
74 | _Chutzpah*
75 |
76 | # Visual C++ cache files
77 | ipch/
78 | *.aps
79 | *.ncb
80 | *.opendb
81 | *.opensdf
82 | *.sdf
83 | *.cachefile
84 | *.VC.db
85 | *.VC.VC.opendb
86 |
87 | # Visual Studio profiler
88 | *.psess
89 | *.vsp
90 | *.vspx
91 | *.sap
92 |
93 | # TFS 2012 Local Workspace
94 | $tf/
95 |
96 | # Guidance Automation Toolkit
97 | *.gpState
98 |
99 | # ReSharper is a .NET coding add-in
100 | _ReSharper*/
101 | *.[Rr]e[Ss]harper
102 | *.DotSettings.user
103 |
104 | # JustCode is a .NET coding add-in
105 | .JustCode
106 |
107 | # TeamCity is a build add-in
108 | _TeamCity*
109 |
110 | # DotCover is a Code Coverage Tool
111 | *.dotCover
112 |
113 | # NCrunch
114 | _NCrunch_*
115 | .*crunch*.local.xml
116 | nCrunchTemp_*
117 |
118 | # MightyMoose
119 | *.mm.*
120 | AutoTest.Net/
121 |
122 | # Web workbench (sass)
123 | .sass-cache/
124 |
125 | # Installshield output folder
126 | [Ee]xpress/
127 |
128 | # DocProject is a documentation generator add-in
129 | DocProject/buildhelp/
130 | DocProject/Help/*.HxT
131 | DocProject/Help/*.HxC
132 | DocProject/Help/*.hhc
133 | DocProject/Help/*.hhk
134 | DocProject/Help/*.hhp
135 | DocProject/Help/Html2
136 | DocProject/Help/html
137 |
138 | # Click-Once directory
139 | publish/
140 |
141 | # Publish Web Output
142 | *.[Pp]ublish.xml
143 | *.azurePubxml
144 | # TODO: Comment the next line if you want to checkin your web deploy settings
145 | # but database connection strings (with potential passwords) will be unencrypted
146 | #*.pubxml
147 | *.publishproj
148 |
149 | # Microsoft Azure Web App publish settings. Comment the next line if you want to
150 | # checkin your Azure Web App publish settings, but sensitive information contained
151 | # in these scripts will be unencrypted
152 | PublishScripts/
153 |
154 | # NuGet Packages
155 | *.nupkg
156 | # The packages folder can be ignored because of Package Restore
157 | **/packages/*
158 | # except build/, which is used as an MSBuild target.
159 | !**/packages/build/
160 | # Uncomment if necessary however generally it will be regenerated when needed
161 | #!**/packages/repositories.config
162 | # NuGet v3's project.json files produces more ignoreable files
163 | *.nuget.props
164 | *.nuget.targets
165 |
166 | # Microsoft Azure Build Output
167 | csx/
168 | *.build.csdef
169 |
170 | # Microsoft Azure Emulator
171 | ecf/
172 | rcf/
173 |
174 | # Windows Store app package directories and files
175 | AppPackages/
176 | BundleArtifacts/
177 | Package.StoreAssociation.xml
178 | _pkginfo.txt
179 |
180 | # Visual Studio cache files
181 | # files ending in .cache can be ignored
182 | *.[Cc]ache
183 | # but keep track of directories ending in .cache
184 | !*.[Cc]ache/
185 |
186 | # Others
187 | ClientBin/
188 | ~$*
189 | *~
190 | *.dbmdl
191 | *.dbproj.schemaview
192 | *.jfm
193 | *.pfx
194 | *.publishsettings
195 | node_modules/
196 | orleans.codegen.cs
197 |
198 | # Since there are multiple workflows, uncomment next line to ignore bower_components
199 | # (https://github.com/github/gitignore/pull/1529#issuecomment-104372622)
200 | #bower_components/
201 |
202 | # RIA/Silverlight projects
203 | Generated_Code/
204 |
205 | # Backup & report files from converting an old project file
206 | # to a newer Visual Studio version. Backup files are not needed,
207 | # because we have git ;-)
208 | _UpgradeReport_Files/
209 | Backup*/
210 | UpgradeLog*.XML
211 | UpgradeLog*.htm
212 |
213 | # SQL Server files
214 | *.mdf
215 | *.ldf
216 |
217 | # Business Intelligence projects
218 | *.rdl.data
219 | *.bim.layout
220 | *.bim_*.settings
221 |
222 | # Microsoft Fakes
223 | FakesAssemblies/
224 |
225 | # GhostDoc plugin setting file
226 | *.GhostDoc.xml
227 |
228 | # Node.js Tools for Visual Studio
229 | .ntvs_analysis.dat
230 |
231 | # Visual Studio 6 build log
232 | *.plg
233 |
234 | # Visual Studio 6 workspace options file
235 | *.opt
236 |
237 | # Visual Studio LightSwitch build output
238 | **/*.HTMLClient/GeneratedArtifacts
239 | **/*.DesktopClient/GeneratedArtifacts
240 | **/*.DesktopClient/ModelManifest.xml
241 | **/*.Server/GeneratedArtifacts
242 | **/*.Server/ModelManifest.xml
243 | _Pvt_Extensions
244 |
245 | # Paket dependency manager
246 | .paket/paket.exe
247 | paket-files/
248 |
249 | # FAKE - F# Make
250 | .fake/
251 |
252 | # JetBrains Rider
253 | .idea/
254 | *.sln.iml
255 |
256 | # CodeRush
257 | .cr/
258 |
259 | # Python Tools for Visual Studio (PTVS)
260 | __pycache__/
261 | *.pyc
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # xamarinforms-rest-api-app
2 | A quick implementation of REST API in Xamarin Forms 5
3 |
4 | This Xamarin Forms version 5
5 |
--------------------------------------------------------------------------------
/XamarinRest.Android/Assets/AboutAssets.txt:
--------------------------------------------------------------------------------
1 | Any raw assets you want to be deployed with your application can be placed in
2 | this directory (and child directories) and given a Build Action of "AndroidAsset".
3 |
4 | These files will be deployed with your package and will be accessible using Android's
5 | AssetManager, like this:
6 |
7 | public class ReadAsset : Activity
8 | {
9 | protected override void OnCreate (Bundle bundle)
10 | {
11 | base.OnCreate (bundle);
12 |
13 | InputStream input = Assets.Open ("my_asset.txt");
14 | }
15 | }
16 |
17 | Additionally, some Android functions will automatically load asset files:
18 |
19 | Typeface tf = Typeface.CreateFromAsset (Context.Assets, "fonts/samplefont.ttf");
20 |
--------------------------------------------------------------------------------
/XamarinRest.Android/MainActivity.cs:
--------------------------------------------------------------------------------
1 | using System;
2 |
3 | using Android.App;
4 | using Android.Content.PM;
5 | using Android.Runtime;
6 | using Android.Views;
7 | using Android.Widget;
8 | using Android.OS;
9 |
10 | namespace XamarinRest.Droid
11 | {
12 | [Activity(Label = "XamarinRest", Icon = "@mipmap/icon", Theme = "@style/MainTheme", MainLauncher = true, ConfigurationChanges = ConfigChanges.ScreenSize | ConfigChanges.Orientation | ConfigChanges.UiMode | ConfigChanges.ScreenLayout | ConfigChanges.SmallestScreenSize)]
13 | public class MainActivity : global::Xamarin.Forms.Platform.Android.FormsAppCompatActivity
14 | {
15 | protected override void OnCreate(Bundle savedInstanceState)
16 | {
17 | TabLayoutResource = Resource.Layout.Tabbar;
18 | ToolbarResource = Resource.Layout.Toolbar;
19 |
20 | base.OnCreate(savedInstanceState);
21 |
22 | Xamarin.Essentials.Platform.Init(this, savedInstanceState);
23 | global::Xamarin.Forms.Forms.Init(this, savedInstanceState);
24 | LoadApplication(new App());
25 | }
26 | public override void OnRequestPermissionsResult(int requestCode, string[] permissions, [GeneratedEnum] Android.Content.PM.Permission[] grantResults)
27 | {
28 | Xamarin.Essentials.Platform.OnRequestPermissionsResult(requestCode, permissions, grantResults);
29 |
30 | base.OnRequestPermissionsResult(requestCode, permissions, grantResults);
31 | }
32 | }
33 | }
--------------------------------------------------------------------------------
/XamarinRest.Android/Properties/AndroidManifest.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/XamarinRest.Android/Properties/AssemblyInfo.cs:
--------------------------------------------------------------------------------
1 | using System.Reflection;
2 | using System.Runtime.CompilerServices;
3 | using System.Runtime.InteropServices;
4 | using Android.App;
5 |
6 | // General Information about an assembly is controlled through the following
7 | // set of attributes. Change these attribute values to modify the information
8 | // associated with an assembly.
9 | [assembly: AssemblyTitle("XamarinRest.Android")]
10 | [assembly: AssemblyDescription("")]
11 | [assembly: AssemblyConfiguration("")]
12 | [assembly: AssemblyCompany("")]
13 | [assembly: AssemblyProduct("XamarinRest.Android")]
14 | [assembly: AssemblyCopyright("Copyright © 2014")]
15 | [assembly: AssemblyTrademark("")]
16 | [assembly: AssemblyCulture("")]
17 | [assembly: ComVisible(false)]
18 |
19 | // Version information for an assembly consists of the following four values:
20 | //
21 | // Major Version
22 | // Minor Version
23 | // Build Number
24 | // Revision
25 | [assembly: AssemblyVersion("1.0.0.0")]
26 | [assembly: AssemblyFileVersion("1.0.0.0")]
27 |
28 | // Add some common permissions, these can be removed if not needed
29 | [assembly: UsesPermission(Android.Manifest.Permission.Internet)]
30 | [assembly: UsesPermission(Android.Manifest.Permission.WriteExternalStorage)]
31 |
--------------------------------------------------------------------------------
/XamarinRest.Android/Resources/AboutResources.txt:
--------------------------------------------------------------------------------
1 | Images, layout descriptions, binary blobs and string dictionaries can be included
2 | in your application as resource files. Various Android APIs are designed to
3 | operate on the resource IDs instead of dealing with images, strings or binary blobs
4 | directly.
5 |
6 | For example, a sample Android app that contains a user interface layout (main.xml),
7 | an internationalization string table (strings.xml) and some icons (drawable-XXX/icon.png)
8 | would keep its resources in the "Resources" directory of the application:
9 |
10 | Resources/
11 | drawable-hdpi/
12 | icon.png
13 |
14 | drawable-ldpi/
15 | icon.png
16 |
17 | drawable-mdpi/
18 | icon.png
19 |
20 | layout/
21 | main.xml
22 |
23 | values/
24 | strings.xml
25 |
26 | In order to get the build system to recognize Android resources, set the build action to
27 | "AndroidResource". The native Android APIs do not operate directly with filenames, but
28 | instead operate on resource IDs. When you compile an Android application that uses resources,
29 | the build system will package the resources for distribution and generate a class called
30 | "Resource" that contains the tokens for each one of the resources included. For example,
31 | for the above Resources layout, this is what the Resource class would expose:
32 |
33 | public class Resource {
34 | public class drawable {
35 | public const int icon = 0x123;
36 | }
37 |
38 | public class layout {
39 | public const int main = 0x456;
40 | }
41 |
42 | public class strings {
43 | public const int first_string = 0xabc;
44 | public const int second_string = 0xbcd;
45 | }
46 | }
47 |
48 | You would then use R.drawable.icon to reference the drawable/icon.png file, or Resource.layout.main
49 | to reference the layout/main.xml file, or Resource.strings.first_string to reference the first
50 | string in the dictionary file values/strings.xml.
51 |
--------------------------------------------------------------------------------
/XamarinRest.Android/Resources/layout/Tabbar.xml:
--------------------------------------------------------------------------------
1 |
2 |
--------------------------------------------------------------------------------
/XamarinRest.Android/Resources/layout/Toolbar.xml:
--------------------------------------------------------------------------------
1 |
2 |
--------------------------------------------------------------------------------
/XamarinRest.Android/Resources/mipmap-anydpi-v26/icon.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
--------------------------------------------------------------------------------
/XamarinRest.Android/Resources/mipmap-anydpi-v26/icon_round.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
--------------------------------------------------------------------------------
/XamarinRest.Android/Resources/mipmap-hdpi/icon.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/webmasterdevlin/xamarinforms-rest-api-app/52f2c4a896946c4ceabab1ba50605cc5648da7c1/XamarinRest.Android/Resources/mipmap-hdpi/icon.png
--------------------------------------------------------------------------------
/XamarinRest.Android/Resources/mipmap-hdpi/launcher_foreground.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/webmasterdevlin/xamarinforms-rest-api-app/52f2c4a896946c4ceabab1ba50605cc5648da7c1/XamarinRest.Android/Resources/mipmap-hdpi/launcher_foreground.png
--------------------------------------------------------------------------------
/XamarinRest.Android/Resources/mipmap-mdpi/icon.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/webmasterdevlin/xamarinforms-rest-api-app/52f2c4a896946c4ceabab1ba50605cc5648da7c1/XamarinRest.Android/Resources/mipmap-mdpi/icon.png
--------------------------------------------------------------------------------
/XamarinRest.Android/Resources/mipmap-mdpi/launcher_foreground.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/webmasterdevlin/xamarinforms-rest-api-app/52f2c4a896946c4ceabab1ba50605cc5648da7c1/XamarinRest.Android/Resources/mipmap-mdpi/launcher_foreground.png
--------------------------------------------------------------------------------
/XamarinRest.Android/Resources/mipmap-xhdpi/icon.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/webmasterdevlin/xamarinforms-rest-api-app/52f2c4a896946c4ceabab1ba50605cc5648da7c1/XamarinRest.Android/Resources/mipmap-xhdpi/icon.png
--------------------------------------------------------------------------------
/XamarinRest.Android/Resources/mipmap-xhdpi/launcher_foreground.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/webmasterdevlin/xamarinforms-rest-api-app/52f2c4a896946c4ceabab1ba50605cc5648da7c1/XamarinRest.Android/Resources/mipmap-xhdpi/launcher_foreground.png
--------------------------------------------------------------------------------
/XamarinRest.Android/Resources/mipmap-xxhdpi/icon.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/webmasterdevlin/xamarinforms-rest-api-app/52f2c4a896946c4ceabab1ba50605cc5648da7c1/XamarinRest.Android/Resources/mipmap-xxhdpi/icon.png
--------------------------------------------------------------------------------
/XamarinRest.Android/Resources/mipmap-xxhdpi/launcher_foreground.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/webmasterdevlin/xamarinforms-rest-api-app/52f2c4a896946c4ceabab1ba50605cc5648da7c1/XamarinRest.Android/Resources/mipmap-xxhdpi/launcher_foreground.png
--------------------------------------------------------------------------------
/XamarinRest.Android/Resources/mipmap-xxxhdpi/icon.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/webmasterdevlin/xamarinforms-rest-api-app/52f2c4a896946c4ceabab1ba50605cc5648da7c1/XamarinRest.Android/Resources/mipmap-xxxhdpi/icon.png
--------------------------------------------------------------------------------
/XamarinRest.Android/Resources/mipmap-xxxhdpi/launcher_foreground.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/webmasterdevlin/xamarinforms-rest-api-app/52f2c4a896946c4ceabab1ba50605cc5648da7c1/XamarinRest.Android/Resources/mipmap-xxxhdpi/launcher_foreground.png
--------------------------------------------------------------------------------
/XamarinRest.Android/Resources/values/colors.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | #FFFFFF
4 | #3F51B5
5 | #303F9F
6 | #FF4081
7 |
--------------------------------------------------------------------------------
/XamarinRest.Android/Resources/values/styles.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
16 |
--------------------------------------------------------------------------------
/XamarinRest.Android/XamarinRest.Android.csproj:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | Debug
5 | AnyCPU
6 | {65A5D6C1-88BE-4095-8C2E-82392760CECB}
7 | {EFBA0AD7-5A72-4C68-AF49-83D382785DCF};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}
8 | {c9e5eea5-ca05-42a1-839b-61506e0a37df}
9 | Library
10 | XamarinRest.Droid
11 | XamarinRest.Android
12 | True
13 | True
14 | Resources\Resource.designer.cs
15 | Resource
16 | Properties\AndroidManifest.xml
17 | Resources
18 | Assets
19 | v10.0
20 | true
21 | true
22 | Xamarin.Android.Net.AndroidClientHandler
23 |
24 |
25 |
26 |
27 | true
28 | portable
29 | false
30 | bin\Debug
31 | DEBUG;
32 | prompt
33 | 4
34 | None
35 | true
36 |
37 |
38 | true
39 | portable
40 | true
41 | bin\Release
42 | prompt
43 | 4
44 | true
45 | false
46 |
47 |
48 |
49 |
50 |
51 |
52 |
53 |
54 |
55 |
56 |
57 |
58 |
59 |
60 |
61 |
62 |
63 |
64 |
65 |
66 |
67 |
68 |
69 |
70 |
71 |
72 |
73 |
74 |
75 |
76 |
77 |
78 |
79 |
80 |
81 |
82 |
83 |
84 |
85 |
86 |
87 |
88 |
89 |
90 |
91 |
92 |
93 | {27B1E766-EEC0-4358-ACA2-596FB87B3EB9}
94 | XamarinRest
95 |
96 |
97 |
98 |
99 |
--------------------------------------------------------------------------------
/XamarinRest.iOS/AppDelegate.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 |
5 | using Foundation;
6 | using UIKit;
7 |
8 | namespace XamarinRest.iOS
9 | {
10 | // The UIApplicationDelegate for the application. This class is responsible for launching the
11 | // User Interface of the application, as well as listening (and optionally responding) to
12 | // application events from iOS.
13 | [Register("AppDelegate")]
14 | public partial class AppDelegate : global::Xamarin.Forms.Platform.iOS.FormsApplicationDelegate
15 | {
16 | //
17 | // This method is invoked when the application has loaded and is ready to run. In this
18 | // method you should instantiate the window, load the UI into it and then make the window
19 | // visible.
20 | //
21 | // You have 17 seconds to return from this method, or iOS will terminate your application.
22 | //
23 | public override bool FinishedLaunching(UIApplication app, NSDictionary options)
24 | {
25 | global::Xamarin.Forms.Forms.Init();
26 | LoadApplication(new App());
27 |
28 | return base.FinishedLaunching(app, options);
29 | }
30 | }
31 | }
32 |
--------------------------------------------------------------------------------
/XamarinRest.iOS/Assets.xcassets/AppIcon.appiconset/Contents.json:
--------------------------------------------------------------------------------
1 | {
2 | "images": [
3 | {
4 | "scale": "2x",
5 | "size": "20x20",
6 | "idiom": "iphone",
7 | "filename": "Icon40.png"
8 | },
9 | {
10 | "scale": "3x",
11 | "size": "20x20",
12 | "idiom": "iphone",
13 | "filename": "Icon60.png"
14 | },
15 | {
16 | "scale": "2x",
17 | "size": "29x29",
18 | "idiom": "iphone",
19 | "filename": "Icon58.png"
20 | },
21 | {
22 | "scale": "3x",
23 | "size": "29x29",
24 | "idiom": "iphone",
25 | "filename": "Icon87.png"
26 | },
27 | {
28 | "scale": "2x",
29 | "size": "40x40",
30 | "idiom": "iphone",
31 | "filename": "Icon80.png"
32 | },
33 | {
34 | "scale": "3x",
35 | "size": "40x40",
36 | "idiom": "iphone",
37 | "filename": "Icon120.png"
38 | },
39 | {
40 | "scale": "2x",
41 | "size": "60x60",
42 | "idiom": "iphone",
43 | "filename": "Icon120.png"
44 | },
45 | {
46 | "scale": "3x",
47 | "size": "60x60",
48 | "idiom": "iphone",
49 | "filename": "Icon180.png"
50 | },
51 | {
52 | "scale": "1x",
53 | "size": "20x20",
54 | "idiom": "ipad",
55 | "filename": "Icon20.png"
56 | },
57 | {
58 | "scale": "2x",
59 | "size": "20x20",
60 | "idiom": "ipad",
61 | "filename": "Icon40.png"
62 | },
63 | {
64 | "scale": "1x",
65 | "size": "29x29",
66 | "idiom": "ipad",
67 | "filename": "Icon29.png"
68 | },
69 | {
70 | "scale": "2x",
71 | "size": "29x29",
72 | "idiom": "ipad",
73 | "filename": "Icon58.png"
74 | },
75 | {
76 | "scale": "1x",
77 | "size": "40x40",
78 | "idiom": "ipad",
79 | "filename": "Icon40.png"
80 | },
81 | {
82 | "scale": "2x",
83 | "size": "40x40",
84 | "idiom": "ipad",
85 | "filename": "Icon80.png"
86 | },
87 | {
88 | "scale": "1x",
89 | "size": "76x76",
90 | "idiom": "ipad",
91 | "filename": "Icon76.png"
92 | },
93 | {
94 | "scale": "2x",
95 | "size": "76x76",
96 | "idiom": "ipad",
97 | "filename": "Icon152.png"
98 | },
99 | {
100 | "scale": "2x",
101 | "size": "83.5x83.5",
102 | "idiom": "ipad",
103 | "filename": "Icon167.png"
104 | },
105 | {
106 | "scale": "1x",
107 | "size": "1024x1024",
108 | "idiom": "ios-marketing",
109 | "filename": "Icon1024.png"
110 | }
111 | ],
112 | "properties": {},
113 | "info": {
114 | "version": 1,
115 | "author": "xcode"
116 | }
117 | }
--------------------------------------------------------------------------------
/XamarinRest.iOS/Assets.xcassets/AppIcon.appiconset/Icon1024.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/webmasterdevlin/xamarinforms-rest-api-app/52f2c4a896946c4ceabab1ba50605cc5648da7c1/XamarinRest.iOS/Assets.xcassets/AppIcon.appiconset/Icon1024.png
--------------------------------------------------------------------------------
/XamarinRest.iOS/Assets.xcassets/AppIcon.appiconset/Icon120.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/webmasterdevlin/xamarinforms-rest-api-app/52f2c4a896946c4ceabab1ba50605cc5648da7c1/XamarinRest.iOS/Assets.xcassets/AppIcon.appiconset/Icon120.png
--------------------------------------------------------------------------------
/XamarinRest.iOS/Assets.xcassets/AppIcon.appiconset/Icon152.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/webmasterdevlin/xamarinforms-rest-api-app/52f2c4a896946c4ceabab1ba50605cc5648da7c1/XamarinRest.iOS/Assets.xcassets/AppIcon.appiconset/Icon152.png
--------------------------------------------------------------------------------
/XamarinRest.iOS/Assets.xcassets/AppIcon.appiconset/Icon167.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/webmasterdevlin/xamarinforms-rest-api-app/52f2c4a896946c4ceabab1ba50605cc5648da7c1/XamarinRest.iOS/Assets.xcassets/AppIcon.appiconset/Icon167.png
--------------------------------------------------------------------------------
/XamarinRest.iOS/Assets.xcassets/AppIcon.appiconset/Icon180.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/webmasterdevlin/xamarinforms-rest-api-app/52f2c4a896946c4ceabab1ba50605cc5648da7c1/XamarinRest.iOS/Assets.xcassets/AppIcon.appiconset/Icon180.png
--------------------------------------------------------------------------------
/XamarinRest.iOS/Assets.xcassets/AppIcon.appiconset/Icon20.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/webmasterdevlin/xamarinforms-rest-api-app/52f2c4a896946c4ceabab1ba50605cc5648da7c1/XamarinRest.iOS/Assets.xcassets/AppIcon.appiconset/Icon20.png
--------------------------------------------------------------------------------
/XamarinRest.iOS/Assets.xcassets/AppIcon.appiconset/Icon29.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/webmasterdevlin/xamarinforms-rest-api-app/52f2c4a896946c4ceabab1ba50605cc5648da7c1/XamarinRest.iOS/Assets.xcassets/AppIcon.appiconset/Icon29.png
--------------------------------------------------------------------------------
/XamarinRest.iOS/Assets.xcassets/AppIcon.appiconset/Icon40.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/webmasterdevlin/xamarinforms-rest-api-app/52f2c4a896946c4ceabab1ba50605cc5648da7c1/XamarinRest.iOS/Assets.xcassets/AppIcon.appiconset/Icon40.png
--------------------------------------------------------------------------------
/XamarinRest.iOS/Assets.xcassets/AppIcon.appiconset/Icon58.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/webmasterdevlin/xamarinforms-rest-api-app/52f2c4a896946c4ceabab1ba50605cc5648da7c1/XamarinRest.iOS/Assets.xcassets/AppIcon.appiconset/Icon58.png
--------------------------------------------------------------------------------
/XamarinRest.iOS/Assets.xcassets/AppIcon.appiconset/Icon60.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/webmasterdevlin/xamarinforms-rest-api-app/52f2c4a896946c4ceabab1ba50605cc5648da7c1/XamarinRest.iOS/Assets.xcassets/AppIcon.appiconset/Icon60.png
--------------------------------------------------------------------------------
/XamarinRest.iOS/Assets.xcassets/AppIcon.appiconset/Icon76.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/webmasterdevlin/xamarinforms-rest-api-app/52f2c4a896946c4ceabab1ba50605cc5648da7c1/XamarinRest.iOS/Assets.xcassets/AppIcon.appiconset/Icon76.png
--------------------------------------------------------------------------------
/XamarinRest.iOS/Assets.xcassets/AppIcon.appiconset/Icon80.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/webmasterdevlin/xamarinforms-rest-api-app/52f2c4a896946c4ceabab1ba50605cc5648da7c1/XamarinRest.iOS/Assets.xcassets/AppIcon.appiconset/Icon80.png
--------------------------------------------------------------------------------
/XamarinRest.iOS/Assets.xcassets/AppIcon.appiconset/Icon87.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/webmasterdevlin/xamarinforms-rest-api-app/52f2c4a896946c4ceabab1ba50605cc5648da7c1/XamarinRest.iOS/Assets.xcassets/AppIcon.appiconset/Icon87.png
--------------------------------------------------------------------------------
/XamarinRest.iOS/Entitlements.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/XamarinRest.iOS/Info.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | UIDeviceFamily
6 |
7 | 1
8 | 2
9 |
10 | UISupportedInterfaceOrientations
11 |
12 | UIInterfaceOrientationPortrait
13 | UIInterfaceOrientationLandscapeLeft
14 | UIInterfaceOrientationLandscapeRight
15 |
16 | UISupportedInterfaceOrientations~ipad
17 |
18 | UIInterfaceOrientationPortrait
19 | UIInterfaceOrientationPortraitUpsideDown
20 | UIInterfaceOrientationLandscapeLeft
21 | UIInterfaceOrientationLandscapeRight
22 |
23 | MinimumOSVersion
24 | 8.0
25 | CFBundleDisplayName
26 | XamarinRest
27 | CFBundleIdentifier
28 | pro.devlinduldulao.XamarinRest
29 | CFBundleVersion
30 | 1.0
31 | UILaunchStoryboardName
32 | LaunchScreen
33 | CFBundleName
34 | XamarinRest
35 | XSAppIconAssets
36 | Assets.xcassets/AppIcon.appiconset
37 | NSAppTransportSecurity
38 |
39 | NSAllowsArbitraryLoads
40 |
41 |
42 |
43 |
44 |
--------------------------------------------------------------------------------
/XamarinRest.iOS/Main.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 |
5 | using Foundation;
6 | using UIKit;
7 |
8 | namespace XamarinRest.iOS
9 | {
10 | public class Application
11 | {
12 | // This is the main entry point of the application.
13 | static void Main(string[] args)
14 | {
15 | // if you want to use a different Application Delegate class from "AppDelegate"
16 | // you can specify it here.
17 | UIApplication.Main(args, null, "AppDelegate");
18 | }
19 | }
20 | }
21 |
--------------------------------------------------------------------------------
/XamarinRest.iOS/Properties/AssemblyInfo.cs:
--------------------------------------------------------------------------------
1 | using System.Reflection;
2 | using System.Runtime.CompilerServices;
3 | using System.Runtime.InteropServices;
4 |
5 | // General Information about an assembly is controlled through the following
6 | // set of attributes. Change these attribute values to modify the information
7 | // associated with an assembly.
8 | [assembly: AssemblyTitle("XamarinRest.iOS")]
9 | [assembly: AssemblyDescription("")]
10 | [assembly: AssemblyConfiguration("")]
11 | [assembly: AssemblyCompany("")]
12 | [assembly: AssemblyProduct("XamarinRest.iOS")]
13 | [assembly: AssemblyCopyright("Copyright © 2014")]
14 | [assembly: AssemblyTrademark("")]
15 | [assembly: AssemblyCulture("")]
16 |
17 | // Setting ComVisible to false makes the types in this assembly not visible
18 | // to COM components. If you need to access a type in this assembly from
19 | // COM, set the ComVisible attribute to true on that type.
20 | [assembly: ComVisible(false)]
21 |
22 | // The following GUID is for the ID of the typelib if this project is exposed to COM
23 | [assembly: Guid("72bdc44f-c588-44f3-b6df-9aace7daafdd")]
24 |
25 | // Version information for an assembly consists of the following four values:
26 | //
27 | // Major Version
28 | // Minor Version
29 | // Build Number
30 | // Revision
31 | //
32 | // You can specify all the values or you can default the Build and Revision Numbers
33 | // by using the '*' as shown below:
34 | // [assembly: AssemblyVersion("1.0.*")]
35 | [assembly: AssemblyVersion("1.0.0.0")]
36 | [assembly: AssemblyFileVersion("1.0.0.0")]
37 |
--------------------------------------------------------------------------------
/XamarinRest.iOS/Resources/Default-568h@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/webmasterdevlin/xamarinforms-rest-api-app/52f2c4a896946c4ceabab1ba50605cc5648da7c1/XamarinRest.iOS/Resources/Default-568h@2x.png
--------------------------------------------------------------------------------
/XamarinRest.iOS/Resources/Default-Portrait.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/webmasterdevlin/xamarinforms-rest-api-app/52f2c4a896946c4ceabab1ba50605cc5648da7c1/XamarinRest.iOS/Resources/Default-Portrait.png
--------------------------------------------------------------------------------
/XamarinRest.iOS/Resources/Default-Portrait@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/webmasterdevlin/xamarinforms-rest-api-app/52f2c4a896946c4ceabab1ba50605cc5648da7c1/XamarinRest.iOS/Resources/Default-Portrait@2x.png
--------------------------------------------------------------------------------
/XamarinRest.iOS/Resources/Default.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/webmasterdevlin/xamarinforms-rest-api-app/52f2c4a896946c4ceabab1ba50605cc5648da7c1/XamarinRest.iOS/Resources/Default.png
--------------------------------------------------------------------------------
/XamarinRest.iOS/Resources/Default@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/webmasterdevlin/xamarinforms-rest-api-app/52f2c4a896946c4ceabab1ba50605cc5648da7c1/XamarinRest.iOS/Resources/Default@2x.png
--------------------------------------------------------------------------------
/XamarinRest.iOS/Resources/LaunchScreen.storyboard:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
38 |
39 |
--------------------------------------------------------------------------------
/XamarinRest.iOS/XamarinRest.iOS.csproj:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | Debug
5 | iPhoneSimulator
6 | 8.0.30703
7 | 2.0
8 | {C093F70C-99C7-4BF9-BC84-A9EC4510A51F}
9 | {FEACFBD2-3405-455C-9665-78FE426C6842};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}
10 | {6143fdea-f3c2-4a09-aafa-6e230626515e}
11 | Exe
12 | XamarinRest.iOS
13 | Resources
14 | XamarinRest.iOS
15 | true
16 | NSUrlSessionHandler
17 | automatic
18 |
19 |
20 | true
21 | full
22 | false
23 | bin\iPhoneSimulator\Debug
24 | DEBUG
25 | prompt
26 | 4
27 | x86_64
28 | None
29 | true
30 |
31 |
32 | none
33 | true
34 | bin\iPhoneSimulator\Release
35 | prompt
36 | 4
37 | None
38 | x86_64
39 |
40 |
41 | true
42 | full
43 | false
44 | bin\iPhone\Debug
45 | DEBUG
46 | prompt
47 | 4
48 | ARM64
49 | iPhone Developer
50 | true
51 | Entitlements.plist
52 | None
53 | -all
54 |
55 |
56 | none
57 | true
58 | bin\iPhone\Release
59 | prompt
60 | 4
61 | ARM64
62 | iPhone Developer
63 | Entitlements.plist
64 |
65 |
66 |
67 |
68 |
69 |
70 |
71 |
72 |
73 |
74 |
75 | false
76 |
77 |
78 | false
79 |
80 |
81 | false
82 |
83 |
84 | false
85 |
86 |
87 | false
88 |
89 |
90 | false
91 |
92 |
93 | false
94 |
95 |
96 | false
97 |
98 |
99 | false
100 |
101 |
102 | false
103 |
104 |
105 | false
106 |
107 |
108 | false
109 |
110 |
111 | false
112 |
113 |
114 | false
115 |
116 |
117 |
118 |
119 |
120 |
121 |
122 |
123 |
124 |
125 |
126 |
127 |
128 |
129 |
130 |
131 |
132 | {27B1E766-EEC0-4358-ACA2-596FB87B3EB9}
133 | XamarinRest
134 |
135 |
136 |
--------------------------------------------------------------------------------
/XamarinRest.sln:
--------------------------------------------------------------------------------
1 |
2 | Microsoft Visual Studio Solution File, Format Version 12.00
3 | # Visual Studio Version 16
4 | VisualStudioVersion = 16.0.808.4
5 | MinimumVisualStudioVersion = 10.0.40219.1
6 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "XamarinRest.Android", "XamarinRest.Android\XamarinRest.Android.csproj", "{65A5D6C1-88BE-4095-8C2E-82392760CECB}"
7 | EndProject
8 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "XamarinRest.iOS", "XamarinRest.iOS\XamarinRest.iOS.csproj", "{C093F70C-99C7-4BF9-BC84-A9EC4510A51F}"
9 | EndProject
10 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "XamarinRest", "XamarinRest\XamarinRest.csproj", "{27B1E766-EEC0-4358-ACA2-596FB87B3EB9}"
11 | EndProject
12 | Global
13 | GlobalSection(SolutionConfigurationPlatforms) = preSolution
14 | Debug|Any CPU = Debug|Any CPU
15 | Release|Any CPU = Release|Any CPU
16 | Debug|iPhoneSimulator = Debug|iPhoneSimulator
17 | Release|iPhoneSimulator = Release|iPhoneSimulator
18 | Debug|iPhone = Debug|iPhone
19 | Release|iPhone = Release|iPhone
20 | EndGlobalSection
21 | GlobalSection(ProjectConfigurationPlatforms) = postSolution
22 | {65A5D6C1-88BE-4095-8C2E-82392760CECB}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
23 | {65A5D6C1-88BE-4095-8C2E-82392760CECB}.Debug|Any CPU.Build.0 = Debug|Any CPU
24 | {65A5D6C1-88BE-4095-8C2E-82392760CECB}.Release|Any CPU.ActiveCfg = Release|Any CPU
25 | {65A5D6C1-88BE-4095-8C2E-82392760CECB}.Release|Any CPU.Build.0 = Release|Any CPU
26 | {65A5D6C1-88BE-4095-8C2E-82392760CECB}.Debug|iPhoneSimulator.ActiveCfg = Debug|Any CPU
27 | {65A5D6C1-88BE-4095-8C2E-82392760CECB}.Debug|iPhoneSimulator.Build.0 = Debug|Any CPU
28 | {65A5D6C1-88BE-4095-8C2E-82392760CECB}.Release|iPhoneSimulator.ActiveCfg = Release|Any CPU
29 | {65A5D6C1-88BE-4095-8C2E-82392760CECB}.Release|iPhoneSimulator.Build.0 = Release|Any CPU
30 | {65A5D6C1-88BE-4095-8C2E-82392760CECB}.Debug|iPhone.ActiveCfg = Debug|Any CPU
31 | {65A5D6C1-88BE-4095-8C2E-82392760CECB}.Debug|iPhone.Build.0 = Debug|Any CPU
32 | {65A5D6C1-88BE-4095-8C2E-82392760CECB}.Release|iPhone.ActiveCfg = Release|Any CPU
33 | {65A5D6C1-88BE-4095-8C2E-82392760CECB}.Release|iPhone.Build.0 = Release|Any CPU
34 | {C093F70C-99C7-4BF9-BC84-A9EC4510A51F}.Debug|Any CPU.ActiveCfg = Debug|iPhoneSimulator
35 | {C093F70C-99C7-4BF9-BC84-A9EC4510A51F}.Debug|Any CPU.Build.0 = Debug|iPhoneSimulator
36 | {C093F70C-99C7-4BF9-BC84-A9EC4510A51F}.Release|Any CPU.ActiveCfg = Release|iPhoneSimulator
37 | {C093F70C-99C7-4BF9-BC84-A9EC4510A51F}.Release|Any CPU.Build.0 = Release|iPhoneSimulator
38 | {C093F70C-99C7-4BF9-BC84-A9EC4510A51F}.Debug|iPhoneSimulator.ActiveCfg = Debug|iPhoneSimulator
39 | {C093F70C-99C7-4BF9-BC84-A9EC4510A51F}.Debug|iPhoneSimulator.Build.0 = Debug|iPhoneSimulator
40 | {C093F70C-99C7-4BF9-BC84-A9EC4510A51F}.Release|iPhoneSimulator.ActiveCfg = Release|iPhoneSimulator
41 | {C093F70C-99C7-4BF9-BC84-A9EC4510A51F}.Release|iPhoneSimulator.Build.0 = Release|iPhoneSimulator
42 | {C093F70C-99C7-4BF9-BC84-A9EC4510A51F}.Debug|iPhone.ActiveCfg = Debug|iPhone
43 | {C093F70C-99C7-4BF9-BC84-A9EC4510A51F}.Debug|iPhone.Build.0 = Debug|iPhone
44 | {C093F70C-99C7-4BF9-BC84-A9EC4510A51F}.Release|iPhone.ActiveCfg = Release|iPhone
45 | {C093F70C-99C7-4BF9-BC84-A9EC4510A51F}.Release|iPhone.Build.0 = Release|iPhone
46 | {27B1E766-EEC0-4358-ACA2-596FB87B3EB9}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
47 | {27B1E766-EEC0-4358-ACA2-596FB87B3EB9}.Debug|Any CPU.Build.0 = Debug|Any CPU
48 | {27B1E766-EEC0-4358-ACA2-596FB87B3EB9}.Release|Any CPU.ActiveCfg = Release|Any CPU
49 | {27B1E766-EEC0-4358-ACA2-596FB87B3EB9}.Release|Any CPU.Build.0 = Release|Any CPU
50 | {27B1E766-EEC0-4358-ACA2-596FB87B3EB9}.Debug|iPhoneSimulator.ActiveCfg = Debug|Any CPU
51 | {27B1E766-EEC0-4358-ACA2-596FB87B3EB9}.Debug|iPhoneSimulator.Build.0 = Debug|Any CPU
52 | {27B1E766-EEC0-4358-ACA2-596FB87B3EB9}.Release|iPhoneSimulator.ActiveCfg = Release|Any CPU
53 | {27B1E766-EEC0-4358-ACA2-596FB87B3EB9}.Release|iPhoneSimulator.Build.0 = Release|Any CPU
54 | {27B1E766-EEC0-4358-ACA2-596FB87B3EB9}.Debug|iPhone.ActiveCfg = Debug|Any CPU
55 | {27B1E766-EEC0-4358-ACA2-596FB87B3EB9}.Debug|iPhone.Build.0 = Debug|Any CPU
56 | {27B1E766-EEC0-4358-ACA2-596FB87B3EB9}.Release|iPhone.ActiveCfg = Release|Any CPU
57 | {27B1E766-EEC0-4358-ACA2-596FB87B3EB9}.Release|iPhone.Build.0 = Release|Any CPU
58 | EndGlobalSection
59 | GlobalSection(SolutionProperties) = preSolution
60 | HideSolutionNode = FALSE
61 | EndGlobalSection
62 | GlobalSection(ExtensibilityGlobals) = postSolution
63 | SolutionGuid = {E43BFED1-05C0-4E48-B70E-7DAC4AF55992}
64 | EndGlobalSection
65 | EndGlobal
66 |
--------------------------------------------------------------------------------
/XamarinRest/App.xaml:
--------------------------------------------------------------------------------
1 |
2 |
5 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/XamarinRest/App.xaml.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using Xamarin.Forms;
3 | using Xamarin.Forms.Xaml;
4 |
5 | namespace XamarinRest
6 | {
7 | public partial class App : Application
8 | {
9 | public App()
10 | {
11 | InitializeComponent();
12 |
13 | MainPage = new MainPage();
14 | }
15 |
16 | protected override void OnStart()
17 | {
18 | }
19 |
20 | protected override void OnSleep()
21 | {
22 | }
23 |
24 | protected override void OnResume()
25 | {
26 | }
27 | }
28 | }
29 |
--------------------------------------------------------------------------------
/XamarinRest/AssemblyInfo.cs:
--------------------------------------------------------------------------------
1 | using Xamarin.Forms.Xaml;
2 |
3 | [assembly: XamlCompilation(XamlCompilationOptions.Compile)]
--------------------------------------------------------------------------------
/XamarinRest/MainPage.xaml:
--------------------------------------------------------------------------------
1 |
2 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
20 |
25 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
--------------------------------------------------------------------------------
/XamarinRest/MainPage.xaml.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Collections.ObjectModel;
4 | using System.Net.Http;
5 | using System.Net.Http.Json;
6 | using System.Text;
7 | using Newtonsoft.Json;
8 | using Xamarin.Forms;
9 |
10 | namespace XamarinRest
11 | {
12 | public partial class MainPage : ContentPage
13 | {
14 |
15 | private const string Url = "https://jsonplaceholder.typicode.com/posts"; //This url is a free public api intended for demos
16 | private readonly HttpClient _client = new HttpClient(); //Creating a new instance of HttpClient. (Microsoft.Net.Http)
17 | private ObservableCollection _posts; //Refreshing the state of the UI in realtime when updating the ListView's Collection
18 |
19 | ///
20 | /// Constructor
21 | ///
22 | public MainPage()
23 | {
24 | InitializeComponent();
25 | }
26 | ///
27 | ///
28 | /// This method gets called before the UI appears.
29 | /// Async and await to get the value of the Task and for user experience
30 | ///
31 | protected override async void OnAppearing()
32 | {
33 | try
34 | {
35 | var content = await _client.GetStringAsync(Url); //Sends a GET request to the specified Uri and returns the response body as a string in an asynchronous operation
36 | var deserializedPosts = JsonConvert.DeserializeObject>(content); //Deserializes or converts JSON String into a collection of Post
37 | _posts = new ObservableCollection(deserializedPosts); //Converting the List to ObservableCollection of Post
38 | MyListView.ItemsSource = _posts; //Assigning the ObservableCollection to MyListView in the XAML of this file
39 | }
40 | catch (Exception e)
41 | {
42 | Console.WriteLine(e);
43 | throw;
44 | }
45 | /*
46 | * * Using the new SYSTEM.NET.HTTP.JSON
47 | * */
48 | // var response = await _client.SendAsync(new HttpRequestMessage(HttpMethod.Get, Url));
49 | // if (response.IsSuccessStatusCode)
50 | // {
51 | // var posts = await response.Content.ReadFromJsonAsync>();
52 | // _posts = new ObservableCollection(posts);
53 | // MyListView.ItemsSource = _posts;
54 | // }
55 |
56 | base.OnAppearing();
57 | }
58 |
59 | ///
60 | /// Click event of the Add Button. It sends a POST request adding a Post object in the server and in the collection
61 | ///
62 | ///
63 | ///
64 | private async void OnAdd(object sender, EventArgs e)
65 | {
66 | try
67 | {
68 | var post = new Post { Title = $"Title: Timestamp {DateTime.UtcNow.Ticks}" }; //Creating a new instane of Post with a Title Property and its value in a Timestamp format
69 | var serializedPost = JsonConvert.SerializeObject(post); //Serializes or convert the created Post into a JSON String
70 | var response = await _client.PostAsync(Url, new StringContent(serializedPost, Encoding.UTF8, "application/json")); //Send a POST request to the specified Uri as an asynchronous operation and with correct character encoding (utf9) and contenct type (application/json).
71 | var content = await response.Content.ReadAsStringAsync();
72 | var deserializedPost = JsonConvert.DeserializeObject(content); // deserializing
73 | _posts.Insert(0, deserializedPost); //Updating the UI by inserting an element into the first index of the collection
74 | }
75 | catch (Exception exception)
76 | {
77 | Console.WriteLine(exception);
78 | throw;
79 | }
80 | /*
81 | * Using the new SYSTEM.NET.HTTP.JSON
82 | */
83 | // var post = new Post { Title = $"Title: Timestamp {DateTime.UtcNow.Ticks}" };
84 | // var request = new HttpRequestMessage(HttpMethod.Post, Url)
85 | // {
86 | // Content = JsonContent.Create(post)
87 | // };
88 | // var response = await _client.SendAsync(request);
89 | // var createdPost = await response.Content.ReadFromJsonAsync(); // the created post will have an ID
90 | // _posts.Insert(0, createdPost);
91 | }
92 |
93 | ///
94 | /// Click event of the Update Button. It sends a PUT request updating the first Post object in the server and in the collection
95 | ///
96 | ///
97 | ///
98 | private async void OnUpdate(object sender, EventArgs e)
99 | {
100 | var post = _posts[0]; //Assigning the first Post object of the Post Collection to a new instance of Post
101 | post.Title += " [updated]"; //Appending an [updated] string to the current value of the Title property
102 | var serializedPost = JsonConvert.SerializeObject(post); //Serializes or convert the created Post into a JSON String
103 | await _client.PutAsync(Url + "/" + post.Id, new StringContent(serializedPost, Encoding.UTF8, "application/json")); //Send a PUT request to the specified Uri as an asynchronous operation.
104 | }
105 |
106 | ///
107 | /// Click event of the Delete Button. It sends a DELETE request removing the first Post object in the server and in the
108 | ///
109 | ///
110 | ///
111 | private async void OnDelete(object sender, EventArgs e)
112 | {
113 | var post = _posts[0]; //Assigning the first Post object of the Post Collection to a new instance of Post
114 | var response = await _client.DeleteAsync(Url + "/" + post.Id); //Send a DELETE request to the specified Uri as an asynchronous
115 |
116 | if (response.IsSuccessStatusCode == false) return;
117 |
118 | _posts.Remove(post); //Removes the first occurrence of a specific object from the Post collection. This will be visible on the UI instantly
119 | }
120 | }
121 | }
122 |
--------------------------------------------------------------------------------
/XamarinRest/Post.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.ComponentModel;
4 | using System.Runtime.CompilerServices;
5 | using System.Text;
6 | using Newtonsoft.Json;
7 |
8 | namespace XamarinRest
9 | {
10 | public class Post : INotifyPropertyChanged
11 | {
12 | public int Id { get; set; }
13 |
14 | private string _title;
15 |
16 | [JsonProperty("title")] //This maps the element title of your web service to your model
17 | public string Title
18 | {
19 | get => _title;
20 | set
21 | {
22 | _title = value;
23 | OnPropertyChanged(); //This notifies the View or ViewModel that the value that a property in the Model has changed and the View needs to be updated.
24 | }
25 | }
26 |
27 | //This is how you create your OnPropertyChanged() method
28 | public event PropertyChangedEventHandler PropertyChanged;
29 |
30 | protected virtual void OnPropertyChanged([CallerMemberName] string propertyName = null)
31 | {
32 | PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(propertyName));
33 | }
34 | }
35 | }
36 |
--------------------------------------------------------------------------------
/XamarinRest/XamarinRest.csproj:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | netstandard2.0
5 | true
6 |
7 |
8 |
9 | portable
10 | true
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
--------------------------------------------------------------------------------