本文整理汇总了Java中com.connectsdk.service.sessions.CastWebAppSession类的典型用法代码示例。如果您正苦于以下问题:Java CastWebAppSession类的具体用法?Java CastWebAppSession怎么用?Java CastWebAppSession使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
CastWebAppSession类属于com.connectsdk.service.sessions包,在下文中一共展示了CastWebAppSession类的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: CastService
import com.connectsdk.service.sessions.CastWebAppSession; //导入依赖的package包/类
public CastService(ServiceDescription serviceDescription, ServiceConfig serviceConfig) {
super(serviceDescription, serviceConfig);
mCastClient = new CastClient();
mCastClientListener = new CastListener();
mConnectionCallbacks = new ConnectionCallbacks();
mConnectionFailedListener = new ConnectionFailedListener();
sessions = new HashMap<String, CastWebAppSession>();
subscriptions = new ArrayList<URLServiceSubscription<?>>();
mWaitingForReconnect = false;
}
示例2: onResult
import com.connectsdk.service.sessions.CastWebAppSession; //导入依赖的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));
}
}
}
示例3: CastService
import com.connectsdk.service.sessions.CastWebAppSession; //导入依赖的package包/类
public CastService(ServiceDescription serviceDescription, ServiceConfig serviceConfig) {
super(serviceDescription, serviceConfig);
mCastClientListener = new CastListener();
mConnectionCallbacks = new ConnectionCallbacks();
mConnectionFailedListener = new ConnectionFailedListener();
sessions = new HashMap<String, CastWebAppSession>();
subscriptions = new ArrayList<URLServiceSubscription<?>>();
mWaitingForReconnect = false;
}
示例4: onApplicationDisconnected
import com.connectsdk.service.sessions.CastWebAppSession; //导入依赖的package包/类
@Override
public void onApplicationDisconnected(int statusCode) {
Log.d(Util.T, "Cast.Listener.onApplicationDisconnected: " + statusCode);
if (currentAppId == null)
return;
CastWebAppSession webAppSession = sessions.get(currentAppId);
if (webAppSession == null)
return;
webAppSession.handleAppClose();
currentAppId = null;
}
示例5: CastServiceChannel
import com.connectsdk.service.sessions.CastWebAppSession; //导入依赖的package包/类
public CastServiceChannel(String webAppId, @NonNull CastWebAppSession session) {
this.webAppId = webAppId;
this.session = session;
}
示例6: setUp
import com.connectsdk.service.sessions.CastWebAppSession; //导入依赖的package包/类
@Before
public void setUp() {
session = Mockito.mock(CastWebAppSession.class);
channel = new CastServiceChannel("id", session);
}
示例7: CastServiceChannel
import com.connectsdk.service.sessions.CastWebAppSession; //导入依赖的package包/类
public CastServiceChannel(String webAppId, CastWebAppSession session) {
this.webAppId = webAppId;
this.session = session;
}