How to get fee in a transaction with unconfirmed inputs in bitcoinj?
In case of a SPV node you don't have the values of the inputs of a transaction, as you don't have the full blockchain and thus all the UTXOs.

The transaction itself has no values of the inputs!

You have the following options:


Query a trusted server for the UTXOs (e.g. electrum servers)
Query a webservice (e.g. blockcypher)
of course have a full copy of the blockchain, you could use java bindings to query a local bitcoind