Beruflich Dokumente
Kultur Dokumente
V100R002C01SPC200
Control User Guide(UC,
Android, Phone)
Issue 01
Date 2014-01-31
and other Huawei trademarks are trademarks of Huawei Technologies Co., Ltd.
All other trademarks and trade names mentioned in this document are the property of their respective
holders.
Notice
The purchased products, services and features are stipulated by the contract made between Huawei and
the customer. All or part of the products, services and features described in this document may not be
within the purchase scope or the usage scope. Unless otherwise specified in the contract, all statements,
information, and recommendations in this document are provided "AS IS" without warranties, guarantees or
representations of any kind, either express or implied.
The information in this document is subject to change without notice. Every effort has been made in the
preparation of this document to ensure accuracy of the contents, but all statements, information, and
recommendations in this document do not constitute a warranty of any kind, express or implied.
Website: http://enterprise.huawei.com
Purpose
This document describes eSDK UC Android control, how to use the control to develop
programs, examples for using the control, and related reference information.
Product Versions
The following table lists the versions of related products.
Product Version
Intended Audience
This document is intended for:
Independent software vendor (ISV) software developers
Symbol Conventions
The symbols that may be found in this document are defined as follows.
Symbol Description
Symbol Description
Change History
Changes between document issues are cumulative. The latest document issue contains all the
changes made in earlier issues.
Issue 01 (2014-01-31)
This issue is the first official release.
Contents
1.1 Overview
To enable ISVs to easily integrate UC functions into third-party applications, eSDK UC
Android control provides the call, conference, instant messaging (IM), and contact controls.
Figure 1-1 shows eSDK UC Android control architecture.
Conference Control
ISVs can integrate the conference control into third-party applications so that they can
integrate eSpace capabilities of creating voice and multimedia data conferences.
IM Control
ISVs can integrate the IM control into third-party applications so that they can integrate
eSpace IM capabilities.
Contact Control
ISVs can integrate the contact control into third-party applications so that they can integrate
eSpace address book capabilities. The contact control allows ISVs to easily search the
enterprise address book.
If you have any problems when downloading documents or software, send emails to
enterprise_isv@huawei.com to contact Huawei customer service.
2 Programming Guide
Name Version
Before developing applications, you must obtain the mobile terminal access configuration
information provided by the eSpace UC server and UC accounts. Table 2-2 provides examples
of required information.
Step 2 Click Next. The Android application configuration wizard window is displayed, as shown in
Figure 2-2.
Step 3 Deselect Create custom launcher icon and Create Activity, and click Finish. The project is
created, as shown in Figure 2-3.
----End
The libs directory contains all the required Java Archive (JAR) packages and .so files. The ecslib.jar file
provides basic eSpace utility classes. The eSapceService.jar file provides underlying eSpace services.
The HME-Audio.jar and HME-Video.jar files provide the audio and video codec capabilities. The
SvnApi.jar file provides Secure Sockets Layer virtual private network (SVN) security authentication
functions.
The esdk_uc_control_android_phone_code.jar file in the bin directory provides control
encapsulation.
</uses-permission>
<uses-permission android:name="android.permission.MODIFY_AUDIO_SETTINGS" >
</uses-permission>
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" >
</uses-permission>
<uses-permission android:name="android.permission.GET_TASKS" >
</uses-permission>
<uses-permission android:name="android.permission.CALL_PHONE" >
</uses-permission>
<uses-permission android:name="android.permission.READ_CALENDAR" >
</uses-permission>
<uses-permission android:name="android.permission.WRITE_CALENDAR" >
</uses-permission>
<uses-permission android:name="android.permission.GET_ACCOUNTS" >
</uses-permission>
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" >
</uses-permission>
<uses-permission android:name="android.permission.MOUNT_UNMOUNT_FILESYSTEMS" >
</uses-permission>
<!-- fast2.0 need bluetooth permission -->
<uses-permission android:name="android.permission.BLUETOOTH" >
</uses-permission>
<!-- camera permission -->
<uses-permission android:name="android.permission.CAMERA" >
</uses-permission>
<uses-feature android:name="android.hardware.camera" />
<uses-feature android:name="android.hardware.camera.autofocus" />
<uses-permission android:name="android.permission.ACCESS_SURFACE_FLINGER" >
</uses-permission>
<!-- Customized permission. You can invoke eSpaceMobile components only after the
customized permission is added. -->
<uses-permission android:name="com.huawei.eSpaceMobileApp" />
<activity
android:name="com.huawei.esdk.uc.control.conference.ui.ConferenceListManageActivity
"
android:configChanges="locale"
android:screenOrientation="portrait" />
<!-- Conference details page -->
<activity
android:name="com.huawei.esdk.uc.control.conference.ui.ConferenceDetailActivity"
android:configChanges="locale"
android:screenOrientation="portrait" />
<!-- Page for creating conferences -->
<activity
android:name="com.huawei.esdk.uc.control.conference.ui.ConferenceCreateActivity"
android:configChanges="locale"
android:screenOrientation="portrait" />
<!-- Page for selecting time -->
<activity
android:name="com.huawei.esdk.uc.control.conference.ui.ConferenceCreateDateActivity
"
android:configChanges="locale"
android:screenOrientation="portrait" />
<!-- Conference management page -->
<activity
android:name="com.huawei.esdk.uc.control.conference.ui.ConferenceManageActivity"
android:configChanges="orientation|keyboardHidden"
android:launchMode="singleTask"
android:screenOrientation="portrait" />
<!-- Page for adding participants -->
<activity
android:name="com.huawei.esdk.uc.control.conference.ui.ConferenceAddMemberActivity"
android:configChanges="locale"
android:screenOrientation="portrait" />
<!-- Participant list page -->
<activity
android:name="com.huawei.esdk.uc.control.conference.ui.MoreAddMemberActivity"
android:configChanges="locale"
android:screenOrientation="portrait" />
<!-- Conference IM page -->
<activity
android:name="com.huawei.esdk.uc.control.conference.ui.ConferenceChatActivity"
android:configChanges="locale"
android:screenOrientation="portrait" />
<!-- Conference data sharing page -->
<activity
android:name="com.huawei.esdk.uc.control.conference.ui.ConferenceShareActivity"
android:configChanges="locale"
android:screenOrientation="landscape"
android:theme="@android:style/Theme.Black.NoTitleBar" />
<!-- Contact control -->
<activity
android:name="com.huawei.esdk.uc.control.contact.ContactActivity"
android:configChanges="locale"
android:screenOrientation="portrait" />
<!-- Call page -->
<activity
android:name="com.huawei.esdk.uc.control.module.media.ui.MediaActivity"
android:configChanges="locale"
android:launchMode="singleTask"
android:screenOrientation="portrait" />
<!-- IM history page -->
<activity
android:name="com.huawei.esdk.uc.control.im.ui.ChatHistoryActivity"
android:configChanges="locale"
android:screenOrientation="portrait" />
<!-- Black screen page during a call -->
<activity
android:name="com.huawei.esdk.uc.control.call.ui.BlackActivity"
android:configChanges="locale"
android:screenOrientation="portrait" />
<!-- Dial plate control -->
<activity
android:name="com.huawei.esdk.uc.control.call.ui.DialViewActivity"
android:configChanges="locale"
android:screenOrientation="portrait" />
<!-- Page for selecting a contact -->
<activity
android:name="com.huawei.esdk.uc.control.call.ui.DialContactActivity"
android:configChanges="locale"
android:screenOrientation="portrait" />
<!-- eSpace service -->
<service android:name="com.huawei.service.eSpaceService" />
UI layout
Control initialization
Login
Dial plate
conference
Contact
Data
IM
VoIP call
CTD call
Video call
Logout
The process of invoking eSDK UC Android control involves the following operations:
Creating a project: Use the integrated development environment (IDE) to create an
Android project and load eSDK UC Android control.
Arranging the UI layout
Arrange the UI layout based on the project requirements, including:
− Add the home page layout file (activity_main.xml) and the corresponding activity
(MainActivity).
− Declare variables for each UI element in MainActivity, set initial values for text
boxes, and set click events for buttons.
Implementing the login function: Implement the login function to allow users to log in
to the UC server in common mode or using an SVN security gateway.
Implementing services: Implement the call service, including initiating the dial plate
and processing CTD and VoIP calls (including video calls), contact service (video calls
can be directly initiated from the address book), data conference service, and IM service.
Implementing the logout function: Implement the logout function to allow login users
to log out of the UC server.
3.1 Overview
Adding the Home Page
Add the home page layout file (activity_main.xml) and the corresponding activity
(MainAcitvity) to the esdk_uc_control_android_phone_demo project. Figure 3-1 shows the
home page. For details about activity_main.xml and MainAcitvity, see the demo sample
code.
Logging In
Class
com.huawei.esdk.uc.control.login.LoginService
Method definition
public void logIn(String userName,String password,Handler loginHandler)
Parameter
Logging Out
Class
com.huawei.esdk.uc.control.login.LoginService
Method definition
public void logOut(Handler logoutHandler)
Parameter
break;
break;
default:
break;
}
}
};
Toast.makeText(MainActivity.this, getText(R.string.label_logout_success),
Toast.LENGTH_SHORT).show();
if(logoutForFinish){
finish();
}
break;
if(logoutForFinish){
finish();
}
break;
default:
break;
}
}
if("".equals(edServerIp.getText().toString().trim())){
Toast.makeText(MainActivity.this, getText(R.string.serverblank),
Toast.LENGTH_SHORT).show();
return false;
}
if("".equals(edServerPort.getText().toString().trim())){
Toast.makeText(MainActivity.this, getText(R.string.portblank),
Toast.LENGTH_SHORT).show();
return false;
}
if("".equals(edUCAccount.getText().toString().trim()) ||
"".equals(edUCPassword.getText().toString().trim())){
Toast.makeText(MainActivity.this, getText(R.string.userorpasswrong),
Toast.LENGTH_SHORT).show();
return false;
}
SelfDataHandler.getIns().getSelfData().setServerUrl(edServerIp.getText().toStri
ng());
SelfDataHandler.getIns().getSelfData().setServerPort(edServerPort.getText().toStrin
g());
return true;
}
// Save operation.
SelfDataHandler.getIns().getSelfData().setSvnFlag(isShowSvnSetting); // Save the
settings about whether to use an SVN security gateway.
SelfDataHandler.getIns().getSelfData().setVersion(getString(R.string.androidversion
)); // Save the Android version.
Logger.debug(LocalLog.APPTAG, "svnFlag->"+isShowSvnSetting+
"SelfDataHandler.getIns().getSelfData().setVersion
done");
if (isShowSvnSetting)
{
int resId = -1;
if(StringUtil.isStringEmpty(svnIpValue))
{
resId = R.string.svnipblank;
}
else if(StringUtil.isStringEmpty(svnPortValue))
{
resId = R.string.svnportblank;
}
else if(StringUtil.isStringEmpty(svnAccountValue))
{
resId = R.string.svn_account_empty_prompt;
}
else if(StringUtil.isStringEmpty(svnPassValue))
{
resId = R.string.svn_pwd_empty_prompt;
}
else if(!CommonUtil.isIPAddress(svnIpValue)
&& !CommonUtil.isDomainName(svnIpValue))
{
resId = R.string.svn_address_format_error;
}
else if(isIllegalPort(svnPortValue))
{
resId = R.string.svn_port_error;
}
if (-1 != resId)
{
Toast.makeText(MainActivity.this, getText(resId), Toast.LENGTH_SHORT).show();
return false;
}
SelfDataHandler.getIns().getSelfData().setSvnAccount(svnAccountValue); // Save
the SVN security gateway account.
SelfDataHandler.getIns().getSelfData().setSvnPassword(svnPassValue); // Save
the SVN security gateway password.
return true;
}
return true;
}
Remarks
Before users can log in using an SVN security gateway, you must configure the following
information:
SVN login flag
− true: Use an SVN security gateway.
SelfDataHandler.getIns().getSelfData().setSvnPort(svnPortValue);//Configure the
port number for the SVN security gateway.
SelfDataHandler.getIns().getSelfData().setSvnAccount(svnAccountValue);//Configu
re the SVN security gateway account.
SelfDataHandler.getIns().getSelfData().setSvnPassword(svnPassValue);//Configure
the SVN security gateway password.
Control Functions
Table 3-1 lists the functions provided by the call control.
Function Description
Method definition
public static boolean gotoCall(Context context, String calledNumber)
Parameter
Class
com.huawei.esdk.uc.control.data.selfinfo.SelfDataHandler
Method definition
SelfDataHandler.getIns().getSelfData().setCallbackNumber(String callbackNumber)
/**
* Set the callback number.
*/
private void setCallBackNume()
{
// Callback number.
String callbackNumber = edUcCallbackNum.getText().toString().trim();
SelfDataHandler.getIns().getSelfData().setSelfDefineCallNumber(callbackNumber);
// Set the callback number.
SelfDataHandler.getIns().getSelfData().setCallbackNumber(callbackNumber);
callbackNumL.setVisibility(View.GONE);
callbackNumCheck.setImageResource(R.drawable.icon_select_off2);
isShowCallBackSetting = false;
}
Processing Services
The code for invoking the dial plate page is as follows:
/**
* Access the dial plate.
*/
private void dialCall()
{
if(!IsLogin()) // Check whether a user has logged in.
{
return ;
}
On the dial plate page, you can set the call type to VoIP or CTD. VoIP calls can be
upgraded to video calls.
You must set the callback number for a CTD call, which is the UC account by default.
For details, see section "Setting the Callback Number."
Function Description
Function Description
Processing Services
The code for invoking the conference list page is as follows:
/**
* Access the conference list.
*/
private void conferenceList()
{
if (!LoginProcess.isLoginCheck()) // Check whether a user has logged in.
{
Toast.makeText(ConferenceActivity.this, R.string.message_login_first,
0).show();
return;
}
3.5 IM Control
Control Functions
eSDK UC Android IM control is an Android activity. Table 3-3 lists the functions provided by
the IM control.
Function Description
Function Description
Opening the emoticon library Open the emoticon library in the text input box to
send an emoticon.
Processing Services
The code for invoking the IM page is as follows:
/*Respond to the click on the IM chat button.*/
private void gotoIM()
{
String eSpaceNumber = = editChatWith.getText().toString().trim();
if(!eSpaceNumber.isEmpty())
{
Controls.gotoIM(this, eSpaceNumber); // Invoke the IM control.
}
Function Description
Searching for a contact based on Search for a contact based on search criteria. Fuzzy
search criteria search is supported.
Viewing contact information Click to view the detailed contact information.
Receiving contact status changes Receive contact status changes
Initiating a CTD or VoIP call Initiate a CTD or VoIP call from an address book.
Initiating a video call Initiate a video call from the contact details page.
Initiating an IM chat Initiate an IM chat from an address book.
Processing Services
The code for invoking the contact page is as follows:
/**
* Access the contact page.
*/
private void showContacts()
{
if(!LoginProcess.isLoginCheck()) // Check whether a user has logged in.
{
Toast.makeText(ContactsActivity.this, R.string.message_login_first,
0).show();
return ;
}
Controls.gotoContact(this); // Invoke the contact control.
A
AA Authentication Authorization
B
BMP business management platform
C
CTC click to conference
CTD click to dial
E
eSDK Enterprise Software Development Kit
I
IM instant messaging
ISV independent software vendor
M
MAA mobile access agent
S
SDK software development kit
SVN Secure Sockets Layer virtual private network
U
UC unified communications
V
VoIP voice over Internet Protocol