本文整理汇总了Java中com.connectsdk.service.sessions.LaunchSession.setAppName方法的典型用法代码示例。如果您正苦于以下问题:Java LaunchSession.setAppName方法的具体用法?Java LaunchSession.setAppName怎么用?Java LaunchSession.setAppName使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.connectsdk.service.sessions.LaunchSession
的用法示例。
在下文中一共展示了LaunchSession.setAppName方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: launchAppWithInfo
import com.connectsdk.service.sessions.LaunchSession; //导入方法依赖的package包/类
@Override
public void launchAppWithInfo(final AppInfo appInfo, Object params, final AppLaunchListener listener) {
ServiceCommand<ResponseListener<Object>> command =
new ServiceCommand<ResponseListener<Object>>(getCommandProcessor(),
requestURL(appInfo.getName()), params, new ResponseListener<Object>() {
@Override
public void onError(ServiceCommandError error) {
Util.postError(listener, new ServiceCommandError(0, "Problem Launching app", null));
}
@Override
public void onSuccess(Object object) {
LaunchSession launchSession = LaunchSession.launchSessionForAppId(appInfo.getId());
launchSession.setAppName(appInfo.getName());
launchSession.setSessionId((String)object);
launchSession.setService(DIALService.this);
launchSession.setSessionType(LaunchSessionType.App);
Util.postSuccess(listener, launchSession);
}
});
command.send();
}
示例2: launchAppWithInfo
import com.connectsdk.service.sessions.LaunchSession; //导入方法依赖的package包/类
@Override
public void launchAppWithInfo(final AppInfo appInfo, Object params, final AppLaunchListener listener) {
ServiceCommand<ResponseListener<Object>> command = new ServiceCommand<ResponseListener<Object>>(this, requestURL(appInfo.getName()), params, new ResponseListener<Object>() {
@Override
public void onError(ServiceCommandError error) {
Util.postError(listener, new ServiceCommandError(0, "Problem Launching app", null));
}
@Override
public void onSuccess(Object object) {
LaunchSession launchSession = LaunchSession.launchSessionForAppId(appInfo.getId());
launchSession.setAppName(appInfo.getName());
launchSession.setSessionId((String)object);
launchSession.setService(DIALService.this);
launchSession.setSessionType(LaunchSessionType.App);
Util.postSuccess(listener, launchSession);
}
});
command.send();
}
示例3: onResult
import com.connectsdk.service.sessions.LaunchSession; //导入方法依赖的package包/类
@Override
public void onResult(ApplicationConnectionResult result) {
Status status = result.getStatus();
if (status.isSuccess()) {
ApplicationMetadata applicationMetadata = result.getApplicationMetadata();
currentAppId = applicationMetadata.getApplicationId();
LaunchSession launchSession = LaunchSession.launchSessionForAppId(applicationMetadata.getApplicationId());
launchSession.setAppName(applicationMetadata.getName());
launchSession.setSessionId(result.getSessionId());
launchSession.setSessionType(LaunchSessionType.WebApp);
launchSession.setService(CastService.this);
CastWebAppSession webAppSession = new CastWebAppSession(launchSession, CastService.this);
webAppSession.setMetadata(applicationMetadata);
sessions.put(applicationMetadata.getApplicationId(), webAppSession);
if (listener != null) {
listener.onSuccess(webAppSession);
}
launchingAppId = null;
}
else {
if (listener != null) {
listener.onFailure(new ServiceCommandError(status.getStatusCode(), status.getStatusMessage(), status));
}
}
}
示例4: createMediaLaunchObject
import com.connectsdk.service.sessions.LaunchSession; //导入方法依赖的package包/类
private MediaLaunchObject createMediaLaunchObject() {
LaunchSession launchSession = new LaunchSession();
launchSession.setService(this);
launchSession.setSessionType(LaunchSession.LaunchSessionType.Media);
launchSession.setAppId(remoteMediaPlayer.getUniqueIdentifier());
launchSession.setAppName(remoteMediaPlayer.getName());
MediaLaunchObject mediaLaunchObject = new MediaLaunchObject(launchSession, this);
return mediaLaunchObject;
}
示例5: launchApplication
import com.connectsdk.service.sessions.LaunchSession; //导入方法依赖的package包/类
private void launchApplication(final String appName, final String auid, final String contentId, final Launcher.AppLaunchListener listener) {
JSONObject jsonObj = new JSONObject();
try {
jsonObj.put("id", auid);
jsonObj.put("title", appName);
} catch (JSONException e) {
e.printStackTrace();
}
ResponseListener<Object> responseListener = new ResponseListener<Object>() {
@Override
public void onSuccess(Object response) {
LaunchSession launchSession = LaunchSession.launchSessionForAppId(auid);
launchSession.setAppName(appName);
launchSession.setService(NetcastTVService.this);
launchSession.setSessionType(LaunchSessionType.App);
Util.postSuccess(listener, launchSession);
}
@Override
public void onError(ServiceCommandError error) {
Util.postError(listener, error);
}
};
String requestURL = getUDAPRequestURL(UDAP_PATH_APPTOAPP_COMMAND);
Map <String,String> params = new HashMap<String,String>();
params.put("name", "AppExecute");
params.put("auid", auid);
if (appName != null) {
params.put("appname", appName);
}
if (contentId != null) {
params.put("contentid", contentId);
}
String httpMessage = getUDAPMessageBody(UDAP_API_COMMAND, params);
ServiceCommand<ResponseListener<Object>> request = new ServiceCommand<ResponseListener<Object>>(this, requestURL, httpMessage, responseListener);
request.send();
}
示例6: launchAppStore
import com.connectsdk.service.sessions.LaunchSession; //导入方法依赖的package包/类
@Override
public void launchAppStore(final String appId, final AppLaunchListener listener) {
if (!serviceDescription.getModelNumber().equals("4.0")) {
launchApp("LG Smart World", listener); // TODO: this will not work in Korea, use Korean name instead
return;
}
String targetPath = getUDAPRequestURL(ROAP_PATH_APP_STORE);
Map<String, String> params = new HashMap<String, String>();
params.put("name", "SearchCMDPlaySDPContent");
params.put("content_type", "4");
params.put("conts_exec_type", "");
params.put("conts_plex_type_flag", "");
params.put("conts_search_id", "");
params.put("conts_age", "12");
params.put("exec_id", "");
params.put("item_id", HttpMessage.encode(appId));
params.put("app_type", "S");
String httpMessage = getUDAPMessageBody(UDAP_API_COMMAND, params);
ResponseListener<Object> responseListener = new ResponseListener<Object>() {
@Override
public void onSuccess(Object response) {
LaunchSession launchSession = LaunchSession.launchSessionForAppId(appId);
launchSession.setAppName("LG Smart World"); // TODO: this will not work in Korea, use Korean name instead
launchSession.setService(NetcastTVService.this);
launchSession.setSessionType(LaunchSessionType.App);
Util.postSuccess(listener, launchSession);
}
@Override
public void onError(ServiceCommandError error) {
Util.postError(listener, error);
}
};
ServiceCommand<ResponseListener<Object>> command = new ServiceCommand<ResponseListener<Object>>(this, targetPath, httpMessage, responseListener);
command.send();
}