Data Transfer from HC-05 module crashes app

Hi there,

I suspect that my HC-05 bluetooth module that is connected to a Arduino Mega 2560 is broken, but I want to make sure I don't have a problem in my code.
The project is pretty big, but the main issue can be boiled down to the following code snippets:
datatest.ino (357 Bytes)
datatest.aia (3.9 KB)

I am able to connect my phone to the HC-05, but no data is transmitted and the app instantly freezes after. Also, I have been able to transmit data in the past with the same wiring (VCC to 3.3V, GND to GND, TXD to RX0, RXD to TX0), but the code has changed since and I am using a different phone.

I appretiate any help, thanks in advance. It's the middle of the night here, so I will probably not react to suggestions for the next couple of hours.

Here an example with HC-05