17
17
font-weight : 300 ;
18
18
}
19
19
</ style >
20
-
21
20
< h3 > Introduction</ h3 >
22
21
< p > Xamarin is a cross-platform UI toolkit that allows developers to efficiently
23
22
create native cross platform user interface layouts.< br >
@@ -66,8 +65,8 @@ <h4>Android</h4>
66
65
< img class ="img-thumbnail " alt ="Xamarin Android Options " src ="images/options-android-vs-sml.png " />
67
66
< h4 > Mac System Requirements</ h4 >
68
67
< p > You can use Visual Studio for Mac to develop Xamarin.Forms apps on OS X El Capitan
69
- (10.11) or newer. To develop iOS apps, it is < span lang =" EN-US " > recommended</ span > < span lang =" EN-US " style =" font-size: 10.5pt; line-height: 107%; font-family: open_sans,serif; color: #4E4E4E; letter-spacing: .75pt " >
70
- </ span > having at least the iOS 10 SDK and Xcode latest installed.</ p >
68
+ (10.11) or newer. To develop iOS apps, it is recommended Having at least the iOS
69
+ 10 SDK and Xcode latest installed.</ p >
71
70
< h4 > Windows System Requirements</ h4 >
72
71
< p > Xamarin.Forms apps for iOS and Android can be built on any Windows installation
73
72
that supports Xamarin development. A networked Mac is required for iOS development.
@@ -81,21 +80,18 @@ <h4>Solution Structure (Layers)</h4>
81
80
< li > < strong > .All</ strong > All the projects included.</ li >
82
81
</ ul >
83
82
< p > For Xamarin development, you can open < b > .Mobile.sln</ b > .</ p >
84
-
85
83
< div class ="image-container ">
86
- < img class ="img-thumbnail " alt ="ASP.NET Zero Xamarin Architecture " src ="images/xamarin-architecture.png " />
87
- < p > Xamarin Architecture</ p >
84
+ < img class ="img-thumbnail " alt ="ASP.NET Zero Xamarin Architecture " src ="images/xamarin-architecture.png " />
85
+ < p > Xamarin Architecture</ p >
88
86
</ div >
89
-
90
87
< div class ="image-container ">
91
88
< img class ="img-thumbnail " alt ="ASP.NET Zero Mobile Solution " src ="images/mobile-solution-overview.png " />
92
89
< p > Mobile Solution</ p >
93
90
</ div >
94
-
95
91
< p > There are 6 projects in the mobile solution:</ p >
96
92
< ul >
97
- < li > < strong > Core.Shared</ strong > project basic < span lang =" EN-US " > primitive</ span > < span lang =" EN-US " style =" font-size: 12.0pt; line-height: 107%; font-family: 'Times New Roman',serif " >
98
- </ span > types as consts, enums used in all layers of the solution.</ li >
93
+ < li > < strong > Core.Shared</ strong > project basic primitive types as consts, enums
94
+ used in all layers of the solution.</ li >
99
95
< li > < strong > Application.Shared</ strong > project contains data transfer objects
100
96
(DTOs) and interfaces of application services shared with application layer
101
97
of the backend.</ li >
@@ -106,6 +102,7 @@ <h4>Solution Structure (Layers)</h4>
106
102
< li > < strong > Mobile.iOS</ strong > project contains IOS specific classes.</ li >
107
103
< li > < strong > Mobile.Droid</ strong > project contains Android specific classes.</ li >
108
104
</ ul >
105
+ < h3 > Debugging</ h3 >
109
106
< h4 > Host</ h4 >
110
107
< p > To start debugging Xamarin app you need to configure host settings. You can use
111
108
either < b > Web.Mvc</ b > or < b > Web.Host </ b > to feed the Xamarin app.< br >
@@ -137,7 +134,7 @@ <h4>Host</h4>
137
134
Do not start Web.Mvc or Web.Host project via Visual Studio. Default settings
138
135
of Visual Studio does not allow connections except localhost.</ div >
139
136
</ div >
140
- < p > < font color ="#339933 "> < i class ="fa fa-info-circle "> </ i > We have successfully started
137
+ < p > < font color ="#339933 "> < i class ="fa fa-info-circle "> </ i > We have successfully started
141
138
host. Now we can configure Xamarin app to connect this host.</ font > </ p >
142
139
< h4 > Debugging Xamarin App</ h4 >
143
140
< p > To start debugging you need to change the IP address in < b > DebugServerIpAddresses</ b >
@@ -164,8 +161,7 @@ <h4>Debugging Android</h4>
164
161
< p > To start debugging Android app, you have to install Xamarin.Android. It's
165
162
highly recommended you to read the
166
163
< a href ="https://developer.xamarin.com/guides/android/getting_started/installation/ ">
167
- Xamarin Android Setup and Deployment document</ a > for < span lang ="EN-US "> necessary</ span > < span lang ="EN-US " style ="font-size: 10.5pt; line-height: 107%; font-family: open_sans,serif; color: #4E4E4E; letter-spacing: .75pt ">
168
- </ span > setups.< br >
164
+ Xamarin Android Setup and Deployment document</ a > for necessary setups.< br >
169
165
</ p >
170
166
</ div >
171
167
< p > After successful setup, set < strong > Mobile.Droid</ strong > as startup project.
@@ -193,28 +189,27 @@ <h4>Debugging IOS</h4>
193
189
< br >
194
190
< br >
195
191
< div class ="bs-callout bs-callout-warning ">
196
- < p > < i class ="fa fa-warning "> </ i > < a href ="https://www.xamarin.com/live/ "> Xamarin
192
+ < p > < i class ="fa fa-warning "> </ i > < a href ="https://www.xamarin.com/live/ "> Xamarin
197
193
Live Player</ a > currently does not support some of the key features. Thus Asp.Net
198
194
Zero Xamarin application cannot be debugged on Xamarin Live Player. Further
199
195
information read
200
196
< a href ="https://developer.xamarin.com/guides/cross-platform/live/limitations/ ">
201
197
Xamarin Live Player limitations.</ a > </ p >
202
198
</ div >
203
199
< div class ="bs-callout bs-callout-info ">
204
- < p > < i class ="fa fa-info-circle "> </ i > < a href ="https://www.livexaml.com/ "> LiveXAML</ a >
205
- is a Xaml previewer runs while you are debugging your application inside
206
- an emulator. Whenever you save any XAML file, it automatically updates the running
200
+ < p > < i class ="fa fa-info-circle "> </ i > < a href ="https://www.livexaml.com/ "> LiveXAML</ a >
201
+ is a Xaml previewer runs while you are debugging your application inside an
202
+ emulator. Whenever you save any XAML file, it automatically updates the running
207
203
application. If you want to purchase LiveXAML, Asp.Net Zero customers get %30
208
204
discount. </ p >
209
205
</ div >
210
206
< h3 > Xamarin.Forms</ h3 >
211
207
< p > A key component of building cross-platform applications is being able to share
212
208
code across various platform-specific projects. Asp.Net Zero Xamarin is using Xamarin.Forms
213
- to maximize code sharing between two end platforms (IOS & Android). It is
214
- < span lang ="EN-US "> expected</ span > < span lang ="EN-US " style ="font-size: 10.5pt; line-height: 107%; font-family: open_sans,serif; color: #4E4E4E; letter-spacing: .75pt ">
215
- </ span > to write shared codes in Mobile.Shared project so that it will be used in
216
- both IOS and Android. If you need platform specific development then try to use
217
- class abstractions in shared project and implement/extend in end platforms. </ p >
209
+ to maximize code sharing between two end platforms (IOS & Android). It is expected
210
+ to write shared codes in Mobile.Shared project so that it will be used in both IOS
211
+ and Android. If you need platform specific development then try to use class abstractions
212
+ in shared project and implement/extend in end platforms. </ p >
218
213
< h4 > Mobile.Droid</ h4 >
219
214
< p > Xamarin Android project has a very basic structure. Asp.Net Zero adds or modifies
220
215
these files in the default project; </ p >
@@ -330,12 +325,11 @@ <h6>MVVM</h6>
330
325
for a view is automatically set when < b > AutoWireViewModel</ b > flag set to
331
326
true. There's a naming convention between ViewModels and Views. A xaml filename
332
327
must end with View postfix and the binding context of the xaml filename
333
- must end with ViewModel postfix. < span lang ="EN-US "> For example </ span > if
334
- xaml filename is < i > ProductView.xaml </ i > the corresponding view model filename
335
- must be < i > ProductViewModel.cs.</ i > </ p >
336
- < p > There's an < span lang ="EN-US "> empty </ span > sample view called < i > _SampleView.xaml</ i >
337
- and binding context as < i > _SampleViewModel.cs</ i > . You can copy paste these
338
- empty templates to add a new blank page.</ p >
328
+ must end with ViewModel postfix. For example if xaml filename is < i > ProductView.xaml</ i >
329
+ the corresponding view model filename must be < i > ProductViewModel.cs.</ i > </ p >
330
+ < p > There's an empty sample view called < i > _SampleView.xaml</ i > and binding
331
+ context as < i > _SampleViewModel.cs</ i > . You can copy paste these empty templates
332
+ to add a new blank page.</ p >
339
333
< pre > <ContentPage
340
334
...
341
335
< span style ="background-color: #FFFF00 "> base:ViewManager.AutoWireViewModel="true"</ span >
@@ -416,16 +410,14 @@ <h6>Navigation Service</h6>
416
410
</ ul >
417
411
< h6 > Exception Handling</ h6 >
418
412
< p > All exceptions are globally handled in< i > ExceptionHandler LogException()</ i >
419
- method. < span class ="pl-c "> Subscription to app wide unhandled exceptions
420
- is done in < i > MainActivity</ i > class for Android and in < i > AppDelegate</ i >
421
- class for IOS. However be aware that when an unhandled exception occurs,
422
- typically Android will be destroying the process. So there's not a lot can
423
- be done on the Android side, but your Xamarin code should still be able
424
- to work. So you can log the error message with a third party tool like
425
- < a href ="https://hockeyapp.net/ "> HockeyApp Crash Reporting</ a > . Beside it's
426
- </ span > < span lang ="EN-US "> advised </ span > < span class ="pl-c "> to put a breakpoint
427
- in < i > LogException() </ i > </ span > method. This is useful to see the exception
428
- before app crashes.</ p >
413
+ method. Subscription to app wide unhandled exceptions is done in < i > MainActivity</ i >
414
+ class for Android and in < i > AppDelegate</ i > class for IOS. However be aware
415
+ that when an unhandled exception occurs, typically Android will be destroying
416
+ the process. So there's not a lot can be done on the Android side, but your
417
+ Xamarin code should still be able to work. So you can log the error message
418
+ with a third party tool like < a href ="https://hockeyapp.net/ "> HockeyApp
419
+ Crash Reporting</ a > . Beside it's advised to put a breakpoint in < i > LogException()</ i >
420
+ method. This is useful to see the exception before app crashes. </ p >
429
421
< h5 > Pages</ h5 >
430
422
< h6 > InitialView</ h6 >
431
423
< p > InitialView is a transition page that checks whether user has any granted
0 commit comments