Monday, 8 February 2016

iOs style Badge Icon in android App using Xamarin


Here I'm going to describe how can you add badge icon on application's icon in android device using Xamarin.

Though there is no universal way of implement in all device is available, still some manufacturers support adding a badge on applications icon. And there are a lot of ways available for implementing that is android.

But here I wanted to achieve that by using Xamarin so I have rewrite the android code in C# and here I'm going to share that information.

So following are steps for it.

1.)  So here first step is to add permission in AndroidMenifest file in Droid project. Since different merchants has different permission for the badge implementation, here I'm going to add all the available permission.



2.) Second Step is to create a abstract class,



3.) The next step is to implement the previously created abstract classes that will actually check if launchers are appropriate and update badge on application's icon. Here is sample for Samsung Device.


I have attached all possible implementation for other devices and attached a file for it.

4.) Next step is to to create a method to get supported launcher and for that we need to find supported launcher in device and compare with all implemented launchers.


5.) And then actually call "executeBadge" with count that you want to set,

Here I have attached the file where you can download demo application.
https://drive.google.com/file/d/0B0dJLMU9SXZHemx5bzlPLTlPbXVoX0ZYQ0xtOVdiMVZfT1Nv/view?usp=sharing


Let me know if you find any issue in it or want to rectify any information.

References :
http://vardhan-justlikethat.blogspot.in/2014/07/android-ios-style-badge-app-icon-for.html
https://github.com/leolin310148/ShortcutBadger

(Solved) Maximum Request length Exceed error in .Net Application

When working with file in .net which has large uploads it gives error “Maximum Request length Exceed” because default upload file size is 4MB. So if we want to upload file size greater than 4MB we need to increase size of file upload size in web.config file.
So to increase size of upload file we need to add following blocks to web.config file
  1. MaxRequestLength is given in KB and is the max size of request supported by ASP.NET
  2. MaxAllowedContentLength is given in bytes and is max length of content in a request supported by IIS.
  3. Here, Both values MaxRequestLenth and MaxAllowedContentLength properties has same value 1 GB in KB and bytes respectively
  4. If in an application both value is specified, then smaller from both value gets the priority.
For more detail you can refer,
http://stackoverflow.com/questions/3853767/maximum-request-length-exceeded