本文整理匯總了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;
}