Don't hardcode any values...  With a little imagination and research you
should be able to achieve what you want without detecting the screen size
either...

Thanks,
Justin Anderson
MagouyaWare Developer
http://sites.google.com/site/magouyaware


On Fri, Aug 10, 2012 at 3:43 PM, bob <[email protected]> wrote:

> Display display = ((WindowManager)
> getSystemService(WINDOW_SERVICE)).getDefaultDisplay();
> int width = display.getWidth();
> int height = display.getHeight();
>
>
> On Friday, August 10, 2012 4:34:12 PM UTC-5, cellurl wrote:
>>
>> I have an app that looks fine on an HTC-G1, but is all misaligned on a
>> tablet.
>> Q: What functions should I use to find screen size, so I can get rid
>> of the hard numbers you see below.
>> For example, 347 is 50% in the X direction...
>> Thanks for any leads!
>> -cellurl
>>
>>
>> public class View extends SurfaceView implements SurfaceHolder.Callback {
>>
>>     class Thread extends Thread implements OnJetEventListener {}
>>
>>       public Thread(SurfaceHolder surfaceHolder, Context context,
>> Handler handler) {}
>>
>>        c = mSurfaceHolder.lockCanvas(**null);
>>                     // synchronized (mSurfaceHolder) {
>>                     doDraw(c);
>>         }
>>
>>         private void doNeedleAnimation2nd(Canvas canvas) {
>>
>>             float px= 347;  //this is the center for R.drawable.needle
>>             float py= 33;
>>             canvas.translate(-110, 245);    //this is the pivot for
>> R.drawable.background_a
>>         }
>>
>  --
> You received this message because you are subscribed to the Google
> Groups "Android Developers" group.
> To post to this group, send email to [email protected]
> To unsubscribe from this group, send email to
> [email protected]
> For more options, visit this group at
> http://groups.google.com/group/android-developers?hl=en
>

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

Reply via email to