0

I try to access all phone number that calling me in Q python.

I wrote this code:

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

I have not find any result when other call me or I call other my device is lg k 10 2 sim.

What can I do?

Spikatrix
  • 20,225
  • 7
  • 37
  • 83
cheamin
  • 33
  • 1
  • 6

2 Answers2

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

james beastly
  • 31
  • 1
  • 5
0

Use this code instead and you'll get a result. As for getting the exact number I'm not so sure.

import androidhelper
w=1
while (w == 1):
   droid = androidhelper.Android()
   droid.startTrackingPhoneState()
   phonest = droid.readPhoneState().result
   number = phonest[2] 
   if number != None:
       print(number)
james beastly
  • 31
  • 1
  • 5