Does you program work if you change it so you can send data from the Serial Monitor?
My wild guess is that when the value is (say) 150 your AppInventor program is sending the characters 1,5,0 and a carriage-return. If it does use that format it is sending 4 characters but your program is only reading one of them.
Have a look at the examples in Serial Input Basics - simple reliable ways to receive data. There is also a parse example to illustrate how to extract numbers from the received text.
...R