When you build a multi-platform application in .NET, especially for the mobile, you typically choose between two approaches. One is to code the shared UI layer commonly with Xamarin.Forms (you will still need to have some parts to be placed in platform projects, like custom renderers or providers). The second is to put the entire UI code in platform-specific projects. In this approach you can use the full power of each platform features (like fragments on Android). Both solutions allow for sharing common business logic between all the platforms. On the other hand full implementation of MVVM pattern in the second approach can be tricky and time consuming. The solution is to use 3rd party library; and here comes the MvvmCross. It covers many more areas than the pure MVVM pattern:

  • cross-platform plug-ins,
  • platform-specific helpers (i.e. Android recycler views with grouping or iOS table views with simplified customization API),
  • IoC and messaging infrastructure.

Thanks to the consistent design, all the plugins and extensions, it can seriously speed-up building UI-intensive cross-platform projects. And it still allows you to take all the benefits provided by MVVM design pattern.

Now let’s see how to make Ninject and MvvmCross work together on your project.

→ Read more

Have you ever encountered an error: Error executing task BuildApk: .../bin/packaged_resources does not exist? If so you probably know that solving this issue can be sometimes quite tricky. It may be hard to track when and where the true bug was introduced in the code base. Although some suggestions can be found on the Xamarin Forum the solution usually differ case by case.

→ Read more

As it’s mentioned in MVVMCross documentation Android is quite specific in terms of navigation requirements. The entry point is statically indicated by MainLauncher = true attribute parameter on the activity. On rest of the platforms, specifically on iOS, this can be done dynamically by implementing IMvxAppStart class for registration in MvxApplication.Initialize().

To achieve this MVVMCross introduce a special lightweight type of activity - IMvxAndroidSplashScreenActivity. Unfortunately the default implementation does not support the features from MvvmCross.Droid.Support.V7.AppCompat like vector images or material design themes.

→ Read more

Running certain tasks in a scheduled manner may be an easy solution for many problems. One might be refreshing the application cache when the data needs to be fresh and warm no matter what the actual traffic is. Other could be the synchronization or periodical clean-up. There are obviously few good architectural patterns to do it in more elegant and efficient way - distributed queues, publish-subscribe models, enterprise service buses etc. But the simplicity of scheduling still might be an important decision variable.

I was using Quartz.NET (2.x) for this purpose for quite a while in ASP.NET MVC5. It’s simple to use in simple scenarios but powerful enough to handle more complex when there is such a need. Recently I needed to implement a scheduling in an ASP.NET Core Web API service. I wanted to have all the Core features on board - importantly dependency injection, strongly-typed configuration and standard logging. It turned out not to be as straight forward as it seemed on the beginning. But was not so hard either. Here is how I did it.

→ Read more

An error Failure INSTALL_PARSE_FAILED_MANIFEST_MALFORMED appears from time to time in world of Android Java developers. However among Xamarin devs it seems to appear much rarely. Today I came across one and the standard Android solution did not work for me. Curious about the solution I found (with a little help of my friends)?

→ Read more