我要评分
获取效率
正确性
完整性
易理解

Creating an Activity

Application Scenario

Create a main rendering activity page for the cloud phone.

Development Process

  1. Create an activity to implement the NativeListener interface function.
  2. Set the Activity attribute android:process=":remote" in the AndroidManifest.xml file.
  3. 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.
         ...
       }
    }
}