AES-128 (or higher) is the recommended algorithm.
You should also choose a good Chaining Method with a random Initialization Vector. Padding variable length source data is helpful since AES is a block algorithm. AES/CBC/PKCS5Padding
is a good option.
The encryption Key should be generated from a Cryptographically Secure (Pseudo-)Random Number Generator. (i.e. Java's SecureRandom
)
Alternatively, the encryption key could be Derived from a reasonably strong Password using a suitable Key Derivation Function. (comparison herecomparison here)
I'm assuming you need to encrypt data at rest. Key Management will have to be considered.
If you need to encrypt data in transit you'd also need MITM and Integrity verification, which is best accomplished with TLS. (HTTPS)