Skip to main content

Posts

Showing posts from December, 2016

Difference between Abstract Class and Interface with example in c#

1. Multiple inheritance  A class may inherit several interfaces.  class abc : ICrud,IDisposal  A class may inherit only one abstract class.  class abc : parentClass 2. Default implementation Interface : An interface cannot provide any code, just the signature. Example: interface IPerson     {         void Add(string name, string email);     }     Abstract class : An abstract class can provide complete, default code and/or just the details that have to be overridden. Example: abstract class APerson     {         //         string Name;         string Email;        // like interface        public abstract void Add(string name, string email);               public void Update()        {        }     } 3. Access Modifiers Interface : An interface cannot have access modifiers for the subs, functions, properties etc everything is assumed as public     interface IPerson     {         void Add(string name, string email);     }     class iPerson :

Sql Helper into Xamarin Forms PCL Project

public abstract class SQLiteConnection : IDisposable { public string DatabasePath { get ; private set ; } public bool TimeExecution { get ; set ; } public bool Trace { get ; set ; } public SQLiteConnection ( string databasePath) { DatabasePath = databasePath; } public abstract int CreateTable < T > (); public abstract SQLiteCommand CreateCommand ( string cmdText, params object [] ps); public abstract int Execute ( string query, params object [] args); public abstract List < T > Query < T > ( string query, params object [] args) where T : new (); public abstract TableQuery < T > Table < T > () where T : new (); public abstract T Get < T > ( object pk) where T : new (); public bool IsInTransaction { get ; protected set ; } public abstract void BeginTransaction (); public abstract void Rollback (); public abstract void Co

Getting java.lang.OutOfMemoryError in Xamarin

Error        java.lang.OutOfMemoryError. Consider increasing the value of $(JavaMaximumHeapSize). Java ran out of memory while executing 'java.exe -jar  "C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\MonoAndroid\v6.0\mono.android.jar"  ------------------------ Solution -------------- Just set the java max heap size into the android project property using below steps: Right click your Android Project > Proerties > Android Options > Advanced Tab > Java Max Heap Size set Java Max Heap size to 1G and save the settings.