number = droid.readPhoneState()['result']['incomingNumber']
What are 'result' and 'incomingNumber' in this syntax -- are they not parameters?
How are they related to the function readPhoneState
?
import android
droid = android.Android()
droid.startTrackingPhoneState()
number = droid.readPhoneState()['result']['incomingNumber']
if number != None:
droid.speak('Call from '+str(number))
else:
droid.makeToast('No incoming call')