Is there a way to get the address of associated with a transaction input with bitcoinj? If I was not mistaken, with transactioninput.getConnectedOutput(), the output which is used for the input is obtained.

But what to do later? There seem to be two relevant methods: getAddressFromP2PKHScript(NetworkParameters networkParameters) and getAddressFromP2SH(NetworkParameters networkParameters). Am I correct that either one of them will give me the correct address?

Also how to obtain the addresses involved in multisignature transaction with bitcoinj?
Yes, but be aware that there is no concept of a "from address" in Bitcoin. So you should always be prepared for unknown script types. For example, the sender could also be using P2PK, the oldest standardized form of payment in Bitcoin.