有 Java 编程相关的问题?

你可以在下面搜索框中键入要查询的问题!


共 (1) 个答案

  1. # 1 楼答案

    你不能同时在两个应用程序中使用任何东西,因为Android操作系统会在应用程序失去焦点后阻止应用程序工作。但是,您可以使用2services来实现这一点,并且可以在需要时从应用程序中获取数据

    例如:

    //App1
        //Service1
            //read gyro data, write it to application space(db or sharedpreferences)
    
        //App1 Activity
            //read data from application space and show it to the user
    
    //App2
        //Service2
            //read gyro data, write it to application space(db or sharedpreferences)
        //App2 Activity
            //read data from application space and show it to the user
    

    因此,您可以在同一时间为每个应用程序提供连续的数据流