This time:
- we include a very simple REST service - which sends GET requests to the Google Books search API
- we include the JSON plugin to decode the requests
- we try to use the Visual Designers to help produce nicer UIs
You'll quickly spot that I'm not very good with the designers - it's not them, it's me :)
Here's the video:
You'll see that I hit a couple of errors along the way:
- I initially got my namespace wrong - sorry - just had to fix it during the demo!
- A bug in the JSON plugin NuGet package for MvvmCross - have already fixed in v3 (but not uploaded to nuget.org yet)
- A possible bug in Mono (MonoTouch?) with SSL - will report to Xamarin and see what they say
Completed code is on: https://github.com/slodge/NPlus1DaysOfMvvmCross/tree/master/N-06-Books
For more on the Google Books API try https://developers.google.com/books/docs/v1/using#PerformingSearch
For more on json to C# conversion, see http://json2csharp.com/
.... or try http://blogs.msdn.com/b/webdev/archive/2012/12/18/paste-json-as-classes-in-asp-net-and-web-tools-2012-2-rc.aspx
Update: I then moved across to the Mac and did a prettier cell design - here it is:
Previously in N+1:
- N=0 - a first application - http://slodge.blogspot.co.uk/2013/04/n0-first-mvvmcross-application-n1-days.html
- N=1 - tip calc - including the Android Designer and using IoC -http://slodge.blogspot.com/2013/04/n1-tipcalc-second-example-adding-ioc.html
- N=2 - Kittens - lists and tables - N=2: Lists and Kittens (N+1 days of MvvmCross)
- N=3 - Kitten Cells on iPhone - http://slodge.blogspot.co.uk/2013/04/n3-kitten-cells-on-iphone-n1-days-of.html
- N=4 - ValueConverters - http://slodge.blogspot.co.uk/2013/04/n4-valueconverters-n1-days-of-mvvmcross.html
- N=5 - ICommand and Multiple Pages - http://slodge.blogspot.co.uk/2013/04/n5-some-first-icommands-and-multiple.html
I have this problem on last branch
ReplyDeletehere
public string authorSummary
{
get { return authors == null ? "-" : string.Join(", ", authors); }
}
/Users/Downloads/NPlus1DaysOfMvvmCross-master/N-06-Books/Book.Core/Services/VolumeInfo.cs(57,57): Error CS1502: The best overloaded method match for `string.Join(string, string[])' has some invalid arguments (CS1502) (Books.Core)
/Users/Downloads/NPlus1DaysOfMvvmCross-master/N-06-Books/Book.Core/Services/VolumeInfo.cs(68,68): Error CS1503: Argument `#2' cannot convert `System.Collections.Generic.List' expression to type `string[]' (CS1503) (Books.Core)
/Users/Downloads/NPlus1DaysOfMvvmCross-master/N-06-Books/Book.Core/ViewModels/FirstViewModel.cs(40,40): Error CS1684: Reference to type `System.Func`1' claims it is defined assembly `mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089', but it could not be found (CS1684) (Books.Core)
What are you compiling on? Sounds like the same error as the unity guys saw - but they were using an old .net version - see https://github.com/slodge/MvvmCross/issues/246
ReplyDeleteI had configured Xamarin Studio in beta. I did a rollback in stable and now works correctly!
ReplyDeleteThanks for support!
Hi, I have problem about displaying images on my android project. Title and author have no problem but I can't display images with this layout;
ReplyDeleteI checked the json document on link and follow path where the smallThumbnail is located. Do you have any suggestion.
Thank you..