Moved to app.js (inline code in the html doesn't work in real devices, because of the security sandbox model)