You are here:  Theme SDK

Download SDK


Download ThemeKernel.jar
Version : 1.0.2
Last update : 10-04-2012

Download SampleTheme.zip
Version : 1.0.2
Last update : 10-04-2012

Instructions


The easiest way to start creating theme for Full Screen Caller ID is to download the sample theme and customize it.
This section will explain some of the main concepts behind FSCI themes.

Requirements

Themes are basically Android applications that are called by FSCI during a phone call or other event. We will assume that you are familiar with Android tools and java development. Please note that only few programming skills are required to start with.
If you have never developped for Android devices, please download the Android SDK and follow some basic tutorials.

The sample project was developed with Eclipse ; however you can choose your favorite IDE to create your own theme. It should compile just fine.

Main files

Let's take a look at the key files of the sample theme project.

AndroidManifest.xml

Activities are declared in this file. To be detected as a theme, you must create a activity with the following intent :
<activity
	 android:name=".SampleThemeActivity"
	 android:configChanges="orientation"
	 android:label="@string/app_name"
	 android:theme="@android:style/Theme.NoTitleBar.Fullscreen" >
	 <intent-filter>
	 	 <action android:name="android.intent.action.MAIN" />
	 	 <action android:name="com.isodroid.fsci.theme" />
	 </intent-filter>
</activity>
You must also declare the SampleDevActivity (see below) if you wish to use it and the a settings activity if your theme has a settings screen. Please note that multiple themes can be declared within a single APK.

SampleDevActivity.java

The SampleDevActivity extends the GenericThemeDevActivity class and is only used for testing during development. There is only one method to override in this class :
@Override
protected Class<?> getTestActivity() {
	return SampleThemeActivity.class;
}

SampleThemeActivity.java

This file links the ThemeActivity to the Theme class. It also provides a fake bitmap that will be used during development.
@Override
protected AbstractTheme getTheme(Context context, DataProvider dp, ActionManager am) {
	return new SampleTheme(context, context.getPackageName(), dp, am);
}

@Override
protected Bitmap getFakeBitmap() {
	return ((BitmapDrawable) getResources().getDrawable(R.drawable.mona)).getBitmap();
}

SampleSettingsActivity.java

This activity is launched when the user wishes to view the theme's settings. It acts exactly as any PreferenceActivity. However please note that this class must extends the GenericThemeSettingsActivity.

SampleTheme.java

The name of this class is very important : it must be the same name as the declared activity minus the Activity. In this case the declared activity is called SampleThemeActivity so the theme main class must be SampleTheme.
This class must extends GenericTheme and provide the following methods :
getIncomingCallView : returns the view when the user is receiving a phone call.

getIncomingMessageView : returns the view when the user has received a SMS. Can return null if theme does not support this feature.

getMissedCallsView : returns the view when the user has missed calls. Can return null if theme does not support this feature.

getOutgoingCallView : returns the view when the user is calling someone. Can return null if theme does not support this feature.

onCallAnswered : is called when the user has answered a phone call. It is usually the right moment to hide the Answer button.

onUpdateMissedCallsView : is called when the user is browsing the missed calls. It is the right moment to update the bitmap and the texts.

getSettingsIntent : returns the settings activity.

showFeatureBar : returns true if theme must show feature bar (speaker icon + feature button). Return false if theme has it's own buttons.

onSurfaceChanged : is called when the user screen has changed orientation. This is the right moment to update the displayed bitmap as the user can have a specific landscape picture.

ThemeSurfaceView.java

Themes are sometimes a mix of Android layout and SurfaceView animation. SurfaceViews provide more flexibility and smoothness in animations.
The sample theme displays the caller id as a bitmap in the main.xml layout and add an animated SurfaceView as an example.
Theme's surface views must extend ThemeSurfaceView and provide the following methods :
onDraw : is called on every frame. You must animate the scene and redraw it. The deltaTime parameter is the amount of time since the last onDraw call for animation purposes.

onSurfaceChanged : is called when the user screen has changed orientation. This is the right moment to update the displayed bitmap as the user can have a specific landscape picture.

Shared parameters

You must use the getSP() method to retrieve the SharedPreferences object of the theme.

Getting datas

Information about an event held by Full Screen Caller ID can be retrieve using the DataProvider object. Here is the current list of available items :
public final static int STRING_NAME = 0; // First line of information, by default the caller's name
public final static int STRING_PHONE = 1; // Second line of information, by default the caller's phone number
public final static int STRING_MESSAGE = 2; // SMS content
public final static int STRING_ANSWER = 3; // Answer button's label
public final static int STRING_CANCEL = 4; // End call button's label
public final static int STRING_IGNORE = 5; // Ignore call button's label
public final static int STRING_CALL_BACK = 6; // Call back button's label
public final static int STRING_DATE = 7; // The formatted date of the displayed missed call
public final static int STRING_MUTE_ON = 8; // Text for action : mute the ringer
public final static int STRING_MUTE_OFF = 9; // Text for action : unmuting the ringer
public final static int STRING_SPEAKER_ON = 10; // Text for action : turn speaker on
public final static int STRING_SPEAKER_OFF = 11; // Text for action : turn speaker off

public final static int BOOLEAN_HAS_NEXT_MISSED_CALL = 0; // Is there a previous missed call
public final static int BOOLEAN_HAS_PREVIOUS_MISSED_CALL = 1; // Is there a next missed call
public final static int BOOLEAN_IS_UNKNOWN = 2; // Is the current event from an unknown contact
public final static int BOOLEAN_IS_CALLER_WITHOUT_PHOTO = 3; // Is the current event from an contact without HD picture
public final static int BOOLEAN_IS_SPEAKER_ON = 4; // Is the speaker on
public final static int BOOLEAN_IS_MUTE_ON = 5; // Is the ringer muted

Sending actions

User's actions must be transmitted to Full Screen Caller ID using the ActionManager object. Here is the list of available actions :
public static final int ACTION_CLOSE = 0; // User closes the Full Screen notification
public static final int ACTION_ANSWER = 3;	// User presses the Answer button 
public static final int ACTION_CANCEL = 4;	// User presses the end call button
public static final int ACTION_SPEAKER_ON = 5; // User activates the speaker 
public static final int ACTION_SPEAKER_OFF = 6; // User deactivates the speaker
public static final int ACTION_NEXT_MISSED_CALL = 13; // User wants the next missed call event
public static final int ACTION_PREVIOUS_MISSED_CALL = 14; // User wants the previous missed call event
public static final int ACTION_IGNORE = 19; // User presses the ignore button
public static final int ACTION_CALL_BACK = 20; // User presses the call back button
public static final int ACTION_READ = 24;	// Activate TTS of the current event
public static final int ACTION_MUTE_RINGER = 25; // Mute ringer during incoming call
public static final int ACTION_UNMUTE_RINGER = 26; // Unmute ringer
public static final int ACTION_MESSAGE_REPLY = 28; // Close notification and open SMS application
public static final int ACTION_CANNED_RESPONSES = 29; // Display a list of customized canned responses

Publishing

Publishing a theme on Google Play is like publishing any other Android application. Please use google's instructions on this subject.
Once you have published a theme, feel free to contact me so I can add your theme to the built-in list of available themes.

FAQ

When I try my theme I get the default FSCI theme, why ?