Get Screen Resolution

How to get screen resolution at the time of starting an application.



WebApplicationContext context = ((WebApplicationContext) getApplication().getContext());
WebBrowser wb = context.getBrowser();
int width = wb.getScreenWidth();

The above code gives 0 at the time of starting the application (ie, in init() function). But I wants to set at the time of starting the application.
How it possible to get screen width .

It is not possible from the constructor as something has to be sent to the client browser to get the screen size.
See
this thread
for instance.