0

我尝试访问在 Q python 中呼叫我的所有电话号码。

我写了这段代码:

import androidhelper
w=1
while (w == 1):
   droid = androidhelper.Android()
   droid.startTrackingPhoneState()
   phonest = droid.readPhoneState()
   number = phonest[2] 
   if number != None:
       print(number)

当其他人给我打电话或我给其他人打电话时我没有找到任何结果我的设备是 lg k 10 2 sim。

我能做些什么?

4

2 回答 2

0

Read this and look for exactly the command you need

https://www.qpython.org/en/guide_androidhelpers.html

Once you've found said command add

.result 

To the end of it so only the result is returned

于 2019-06-18T11:47:41.053 回答
0

请改用此代码,您将获得结果。至于获得确切的数字,我不太确定。

import androidhelper
w=1
while (w == 1):
   droid = androidhelper.Android()
   droid.startTrackingPhoneState()
   phonest = droid.readPhoneState().result
   number = phonest[2] 
   if number != None:
       print(number)
于 2019-06-18T12:23:29.830 回答