Search code examples
androidscreen-resolution

Screen resolution assistance


I need help with my application,

I am making an android game and i want it to appear circles or squares on random point on screen. Now the problem I am facing is that i want it to appear by using random.nextint()... I have already made the png pictures, and everything else but i do not know how to get the screen x and y (what i mean is the max x and y) so i can use it in my random. Also how could i make it appear and dissapear every lets say 2 second?

Thanks


Solution

  • Refer to this to get screen size programatically

    How do I get the ScreenSize programmatically in android

    To make views disappear use Animations, here is an example:

    How do I animate View.setVisibility(GONE)