2016-12-23 26 views

回答

0

你不能在兩個應用程序中同時使用任何東西,因爲android操作系統會在應用程序失去焦點後阻止應用程序工作。但是你可以用2 services來完成,你可以在需要的時候從應用程序中獲取數據。

例如:

//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 

所以,你可以在同一時間,每個應用連續的數據流。