What is the algorithm in Bitcoin Wallet for Android to select the inputs to create a new transaction?
It appears that Bitcoin Wallet for Android uses the DefaultCoinSelector from bitcoinj.
The DefaultCoinSelector sorts the available UTXO by diminishing age and value:
value [satoshi] * age [confirmations]
Should two UTXO compare as equal, larger value is preferred.
The CoinSelection then picks from the front until the target is reached.
Still trying to figure out whether I understood this correctly:
If the resulting change is large enough to pay for the fee and remain above dust level, the transaction goes ahead.
Else, change will be increased by 0.01 BTC. If it satisfies neither option, the change will be added to the fee.