Creating an Activity
Application Scenario
Create a main rendering activity page for the cloud phone.
Development Process
- Create an activity to implement the NativeListener interface function.
- Set the Activity attribute android:process=":remote" in the AndroidManifest.xml file.
- Process events reported by the video stream engine client.
Encoding Instance
public class Activity implements NativeListener {
protected void onCreate(Bundle savedInstanceState) {
// Set the full-screen mode for the activity.
getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN,
WindowManager.LayoutParams.FLAG_FULLSCREEN);
int vis = getWindow().getDecorView().getSystemUiVisibility();
getWindow().getDecorView().setSystemUiVisibility(vis|
View.SYSTEM_UI_FLAG_HIDE_NAVIGATION | View.SYSTEM_UI_FLAG_IMMERSIVE);
// Set the activity orientation.
setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_PORTRAIT);
}
// Implement the NativeListener interface function.
public void onVmiEngineEvent(int event, int reserved0, int reserved1, int reserved2, int reserved3, String additionInfo){
switch (event) {
// Process the reported event.
...
}
}
}
Parent topic: Development Process of the Video Stream Engine Client