All right, so I'm making a game for Android. For the menu screen, I want to have the logo floating in the background, from right to left and vice versa. That doesn't seem too much of an issue, but I want it to be at random heights, and not out of the screen, so I'll need the resolution. I found the following script in the answers to this question:
Display display = getWindowManager().getDefaultDisplay();
Point size = new Point();
display.getSize(size);
int scrHeight = size.y;
Unfortunately, I get an error in line 3:
Multiple markers at this line
- Syntax error on token "size", VariableDeclaratorId expected after this token
- Syntax error on token(s), misplaced construct(s)
I don't know what's wrong (I basically ctrl+c,ctrl+v'd it), and I feel kind of reluctant to use getHeight() since it's deprecated...
And then one tiny extra question: getSize was implemented in SDK 13, right? Does that mean it doesn't work on phones released before SDK 13, or is that something I can ignore?
Thanks already!