title: Android Get Screen dimensions from Service
body: <p>I got the Screen Size by using the following from a activity,</p>
  
  <pre><code>Display display = getWindowManager().getDefaultDisplay();
  </code></pre>
  
  <p>But the same thing is not working from a service (for obvious reasons, i know!) but i desperately need to get the display size from a service. Can some1 please explain me any other way for getting the ScreenSize??</p>
  
  <p>So i guess as far as i see, there is no way we can get the Screen size from the service. Wat i have done as of now is to start the activity atleast 1ce by default and store the actual screen size in pixels in the shared preferences. I use the shared preferences to get the value when the service starts.</p>
  
  <p>Is this the only way it'll work out??? Cant we by any means get the screen size from the service??</p>