Tuesday, May 07, 2013

N=10 - SQLite Persistent Data Storage - N+1 Days of MvvmCross

Today I looked at some simple SQLite operations using the MvvmCross SQLite plugin which is built on top of Frank's excellent SQLite-net ORM


As this was mainly about the PCL code, I only demo'd in Xamarin.Android and WindowsPhone.


The code from the demo is available in: https://github.com/slodge/NPlus1DaysOfMvvmCross/tree/master/N-10-KittensDb








During the demo, there was some oddness with the keyboard on the emulator - sorry!




Previously in N+1:


2 comments:

  1. Excellent!! Just what the doctor ordered :)

    ReplyDelete
  2. I cannot create dataService to Windows 8.1. I got this message:
    "An exception of type 'System.Exception' occurred in App_Concept_W81.exe but was not handled in user code

    Additional information: Failed to load Page App_Concept_W81.Views.MainView"

    and

    "Problem creating viewModel of type MainViewModel - problem MvxException: Failed to resolve parameter for parameter factory of type ISQLiteConnectionFactory when creating App_Concept_PCL.DAL.DataService
    at Cirrious.CrossCore.IoC.MvxSimpleIoCContainer.GetIoCParameterValues(Type type, ConstructorInfo firstConstructor)
    at Cirrious.CrossCore.IoC.MvxSimpleIoCContainer.IoCConstruct(Type type)
    at Cirrious.CrossCore.Mvx.IocConstruct(Type t)
    at Cirrious.CrossCore.IoC.MvxLazySingletonCreator.get_Instance()
    at Cirrious.CrossCore.IoC.MvxTypeExtensions.<>c__DisplayClass43.b__42()
    at Cirrious.CrossCore.IoC.MvxSimpleIoCContainer.ConstructingSingletonResolver.Resolve()
    at Cirrious.CrossCore.IoC.MvxSimpleIoCContainer.InternalTryResolve(Type type, ResolveOptions resolveOptions, Object& resolved)
    at Cirrious.CrossCore.IoC.MvxSimpleIoCContainer.InternalTryResolve(Type type, Object& resolved)
    at Cirrious.CrossCore.IoC.MvxSimpleIoCContainer.TryResolve(Type type, Object& resolved)
    at Cirrious.CrossCore.IoC.MvxSimpleIoCContainer.GetIoCParameterValues(Type type, ConstructorInfo firstConstructor)
    at Cirrious.CrossCore.IoC.MvxSimpleIoCContainer.IoCConstruct(Type type)
    at Cirrious.CrossCore.Mvx.IocConstruct(Type t)
    at Cirrious.MvvmCross.ViewModels.MvxDefaultViewModelLocator.TryLoad(Type viewModelType, IMvxBundle parameterValues, IMvxBundle savedState, IMvxViewModel& viewModel)"

    Wath's a problem? I included the packages of cirrious to mvvm.

    Thanks

    ReplyDelete