public final class

C2CallSdk

extends Object
implements IServiceListener
java.lang.Object
   ↳ com.c2call.sdk.pub.core.C2CallSdk

Class Overview

This singleton is the main control class of the C2Call SDK. It holds the application's context and several factories which can be used to customize the look and feel as well es the behavoir of major parts within the SDK. The singleton Object has to be initialized by init within your applications onCreate() method:

     @Override
     public void onCreate()
     {

         final String affiliateId = "Your Affilitae ID";
         final String secret = "Your Secret";
         final String contentProviderPrefix = getPackageName();

         final AffiliateCredentials credentials = new AffiliateCredentials(affiliateId,
                                                                           getPackageName(),
                                                                           secret);


         C2CallSdk.instance().init(getApplicationContext(),
                                   contentProviderPrefix,
                                   credentials);
         super.onCreate();
     }
 }
 

Summary

Public Methods
static IActivityStateObserver activityStateObserver()
Static convenience method that calls getActivityStateObserver()
static IAdvertisingIdProvider advertisingProvider()
void close(Context context, boolean threaded, boolean unregisterAPS, boolean toPushCall)
void close(Context context)
static IContactResolver contactResolver()
Static convenience method that calls getContactResolver()
static Context context()
Static convenience method that calls getContext()
static IDialogFactory dialogFactory()
Static convenience method that calls getDialogFactory()
void enableDatabaseLogging(boolean enable)
IActivityStateObserver getActivityStateObserver()
IAdvertisingIdProvider getAdvertisingIdProvider()
AffiliateCredentials getAffiliateCredentials()
IContactResolver getContactResolver()
String getContentProviderPrefix()
Context getContext()
IDialogFactory getDialogFactory()
IGroupCallStartHandler getGroupCallStartHandler()
WindowManager.LayoutParams getLayoutParams()
INotificationFactory getNotificationFactory()
INotifier getNotifier()
IPhoneNumberCache getPhoneNumberCache()
IPhoneNumberFormatter getPhoneNumberFormatter()
ProximityHandler getProximityHandler()
IPushHandler getPushHandler()
IStartControl getStartControl()
IViewDescriptionFactory getVD()
IVideoCallLayoutFactory getVideoCallLayoutFactory()
static IGroupCallStartHandler groupCallStartHandler()
void init(Context appContext, String contentProvdiderPrefix, AffiliateCredentials affiliateCredentials)
void init(Context appContext, String contentProvdiderPrefix, AffiliateCredentials affiliateCredentials, IStartControl startControl, IViewDescriptionFactory viewDescriptionFactory, INotifier notifer, IDialogFactory dialogFactory)
void initViewHolders()
static C2CallSdk instance()
Static access to the singleton object of this class.
boolean isDebug()
void logoutAndClose(Context context)
boolean makeSureFileFolderExists()
static INotificationFactory notificationFactory()
Static convenience method that calls getNotificationFactory()
static INotifier notifier()
Static convenience method that calls getNotifier()
void onConnected()
void onDisconnected()
static IPhoneNumberCache phoneNumberCache()
Static convenience method that calls getPhoneNumberCache()
static IPhoneNumberFormatter phoneNumberFormatter()
Static convenience method that calls getPhoneNumberFormatter()
void setActivityStateObserver(IActivityStateObserver iActivityStateObserver)
Sets the IActivityStateObserver that is notified whenever a subclass of SCBaseFragmentActivity changes the state within its lifecycle.
void setAdvertisingIdProvider(IAdvertisingIdProvider advertisingIdProvider)
void setAffiliateCredentials(AffiliateCredentials affiliateCredentials)
Set the AffiliateCredentials used by this SDK
void setContactResolver(IContactResolver resolver)
Set the IContactResolver that is mostly used to resolve contact names based on IDs or phone numbers
void setDialogFactory(IDialogFactory factory)
Sets the IDialogFactory for this SDK
void setGroupCallStartHandler(IGroupCallStartHandler groupCallStartHandler)
Set that handler that is called when a group call started.
void setIncomingCallHandler(IIncomingCallHandler handler)
Sets the handler for incoming calls.
void setNotifier(INotifier notifier)
Set the Notifier for this SDK
void setPhoneNumberCache(IPhoneNumberCache phoneNumberCache)
Set the IPhoneNumberCache that is used by this SDK Must not be null.
void setPhoneNumberFormatter(IPhoneNumberFormatter phoneNumberFormatter)
Sets the IPhoneNumberFormatter that is used by the SDK to format phone numbers
void setPushHandler(IPushHandler pushHandler)
Sets a PushHandler that will handle all incoming push messages
void setStartControl(IStartControl startControl)
Sets the IStartControl for this SDK
void setVd(IViewDescriptionFactory vd)
set the IViewDescriptionFactory that is used by this SDK
void setVideoCallLayoutFactory(IVideoCallLayoutFactory videoCallLayoutFactory)
Sets the IVideoCallLayoutFactory for this SDK
static IStartControl startControl()
Static convenience method that calls getStartControl()
static IViewDescriptionFactory vd()
Static convenience method that calls getVD()
static IVideoCallLayoutFactory videoCallLayoutFactory()
Static convenience method that calls getVideoCallLayoutFactory()
[Expand]
Inherited Methods
From class java.lang.Object
From interface com.c2call.sdk.pub.core.IServiceListener

Public Methods

public static IActivityStateObserver activityStateObserver ()

Static convenience method that calls getActivityStateObserver()

Returns

public static IAdvertisingIdProvider advertisingProvider ()

public void close (Context context, boolean threaded, boolean unregisterAPS, boolean toPushCall)

public void close (Context context)

public static IContactResolver contactResolver ()

Static convenience method that calls getContactResolver()

Returns

public static Context context ()

Static convenience method that calls getContext()

Returns
  • The context this singleton was initialized with.
Throws
IllegalStateException If the context was not correctly initialized.

public static IDialogFactory dialogFactory ()

Static convenience method that calls getDialogFactory()

Returns

public void enableDatabaseLogging (boolean enable)

public IActivityStateObserver getActivityStateObserver ()

public IAdvertisingIdProvider getAdvertisingIdProvider ()

public AffiliateCredentials getAffiliateCredentials ()

public IContactResolver getContactResolver ()

Returns

public String getContentProviderPrefix ()

public Context getContext ()

Returns
  • The context this singleton was initialized with.
Throws
IllegalStateException If the context was not correctly initialized.

public IDialogFactory getDialogFactory ()

Returns

public IGroupCallStartHandler getGroupCallStartHandler ()

Returns
  • The default handler that is called when a group call started

public WindowManager.LayoutParams getLayoutParams ()

public INotificationFactory getNotificationFactory ()

Returns

public INotifier getNotifier ()

Returns
  • The notifier that was previously set (default: SCNotifier)

public IPhoneNumberCache getPhoneNumberCache ()

Returns

public IPhoneNumberFormatter getPhoneNumberFormatter ()

Returns

public ProximityHandler getProximityHandler ()

public IPushHandler getPushHandler ()

Returns
  • The PushHandler that was previously set (default: SCPushHandler)

public IStartControl getStartControl ()

Returns

public IViewDescriptionFactory getVD ()

Returns

public IVideoCallLayoutFactory getVideoCallLayoutFactory ()

Returns

public static IGroupCallStartHandler groupCallStartHandler ()

public void init (Context appContext, String contentProvdiderPrefix, AffiliateCredentials affiliateCredentials)

public void init (Context appContext, String contentProvdiderPrefix, AffiliateCredentials affiliateCredentials, IStartControl startControl, IViewDescriptionFactory viewDescriptionFactory, INotifier notifer, IDialogFactory dialogFactory)

public void initViewHolders ()

public static C2CallSdk instance ()

Static access to the singleton object of this class.

Returns
  • The singleton object.

public boolean isDebug ()

public void logoutAndClose (Context context)

public boolean makeSureFileFolderExists ()

public static INotificationFactory notificationFactory ()

Static convenience method that calls getNotificationFactory()

Returns

public static INotifier notifier ()

Static convenience method that calls getNotifier()

Returns

public void onConnected ()

public void onDisconnected ()

public static IPhoneNumberCache phoneNumberCache ()

Static convenience method that calls getPhoneNumberCache()

Returns

public static IPhoneNumberFormatter phoneNumberFormatter ()

Static convenience method that calls getPhoneNumberFormatter()

Returns

public void setActivityStateObserver (IActivityStateObserver iActivityStateObserver)

Sets the IActivityStateObserver that is notified whenever a subclass of SCBaseFragmentActivity changes the state within its lifecycle.

public void setAdvertisingIdProvider (IAdvertisingIdProvider advertisingIdProvider)

public void setAffiliateCredentials (AffiliateCredentials affiliateCredentials)

Set the AffiliateCredentials used by this SDK

public void setContactResolver (IContactResolver resolver)

Set the IContactResolver that is mostly used to resolve contact names based on IDs or phone numbers

public void setDialogFactory (IDialogFactory factory)

Sets the IDialogFactory for this SDK

Parameters
factory The IDialogFactory to be set.

public void setGroupCallStartHandler (IGroupCallStartHandler groupCallStartHandler)

Set that handler that is called when a group call started. May be null

Parameters
groupCallStartHandler The handler to set.

public void setIncomingCallHandler (IIncomingCallHandler handler)

Sets the handler for incoming calls.

Parameters
handler the handler to set, may be null.

public void setNotifier (INotifier notifier)

Set the Notifier for this SDK

Parameters
notifier The Notifier to be set.

public void setPhoneNumberCache (IPhoneNumberCache phoneNumberCache)

Set the IPhoneNumberCache that is used by this SDK Must not be null.

public void setPhoneNumberFormatter (IPhoneNumberFormatter phoneNumberFormatter)

Sets the IPhoneNumberFormatter that is used by the SDK to format phone numbers

public void setPushHandler (IPushHandler pushHandler)

Sets a PushHandler that will handle all incoming push messages

Parameters
pushHandler the new PushHandler to set

public void setStartControl (IStartControl startControl)

Sets the IStartControl for this SDK

Parameters
startControl The StartControl to be set.

public void setVd (IViewDescriptionFactory vd)

set the IViewDescriptionFactory that is used by this SDK

public void setVideoCallLayoutFactory (IVideoCallLayoutFactory videoCallLayoutFactory)

Sets the IVideoCallLayoutFactory for this SDK

Parameters
videoCallLayoutFactory The IVideoCallLayoutFactory to be set.

public static IStartControl startControl ()

Static convenience method that calls getStartControl()

Returns

public static IViewDescriptionFactory vd ()

Static convenience method that calls getVD()

Returns

public static IVideoCallLayoutFactory videoCallLayoutFactory ()

Static convenience method that calls getVideoCallLayoutFactory()

Returns