setting android application window size

242 views
Skip to first unread message

souvik

unread,
Jun 24, 2009, 6:10:20 AM6/24/09
to CodeAndroid Developers Group, sadhu....@gmail.com
Hi,

Is it possible in android to find the application size ? or how to set
the
application x,y coordinate in android while launching an application?

Thanks in advance

-souvik

Daniel , Dao Quang Minh

unread,
Jun 24, 2009, 6:35:01 AM6/24/09
to WeCode...@googlegroups.com, sadhu....@gmail.com
Hi,

There are getMeasureWidth() and  getMeasureHeight() function which will return the the width and height of the most recent call to measure() .

You can set the layout position using layout() function

I guess that you are trying to customize your View ? Section How Android draws View in the Dev guide may help in that case.

Cheers,
Daniel.

souvik

unread,
Jun 24, 2009, 6:43:16 AM6/24/09
to CodeAndroid Developers Group
Hi Daniel,
Thanks for quick response.

Actually I want to re-size the android application window.
like windows we can resize. so that I can launch two application in
launcher screen.
even i want to resize this screen runtime. like person can drag one
corner and it will enlarge.

And is it possible in android emulator ?

-thanks,
Souvik

On Jun 24, 3:35 pm, "Daniel , Dao Quang Minh" <dqmin...@gmail.com>
wrote:
> Hi,
>
> There are getMeasureWidth()<http://developer.android.com/reference/android/view/View.html#getMeas...>and
>  getMeasureHeight()
> <http://developer.android.com/reference/android/view/View.html#getMeas...>function
> which will return the the width and height of the most recent call to
> measure() .
>
> You can set the layout position using layout()
> function<http://developer.android.com/reference/android/view/View.html#layout%...>
>
> I guess that you are trying to customize your View ? Section How Android
> draws View<http://developer.android.com/guide/topics/ui/how-android-draws.html>in
> the Dev guide may help in that case.
>
> Cheers,
> Daniel.
>

Daniel , Dao Quang Minh

unread,
Jun 24, 2009, 7:09:06 AM6/24/09
to WeCode...@googlegroups.com
I have never done those things before. Basically you cannot run two applications in 1 screen. So my best guess is that you have to use nested layout.

For nested layout, you need to have a child layout as a placeholder inside your normal layout, so it will look like:

<RelativeLayout>
       <LinearLayout/> or any customized layout here
</RelativeLayout>

and you need to have another .xml file declaring the layout you want to added into the original.

After that, you can use View.inflate() to attach the it into the original one.

Hence, the resizing function will be the layout resize function.

Daniel.

honcheng

unread,
Jun 24, 2009, 8:28:02 AM6/24/09
to WeCode...@googlegroups.com
Most application consists of activities. Activities fills the screen. You probably mean having 2 views

Sent from my iPhone

souvik

unread,
Jun 24, 2009, 11:33:16 PM6/24/09
to CodeAndroid Developers Group
Hi Daniel,

can u please tell me where i will get the default layout coordinate
for one application?
Let me clear my doubt once again!

consider there are two separate application(dialer & calc).
At the time of launching calculator application I want to resize the
application size
so that it launches in half of the android screen. And again at the
time of launching dialer application I want to resize the application
size so that it fits into the other half of the android screen.

Is this really possible?
What I am thinking is if I can change the application layout size,then
it will be possible.
please put some idea into this.

-souvik


On Jun 24, 5:28 pm, honcheng <honch...@gmail.com> wrote:
> Most application consists of activities. Activities fills the screen.  
> You probably mean having 2 views
>
> Sent from my iPhone
>
> On 24-Jun-2009, at 7:09 PM, "Daniel , Dao Quang Minh" <dqmin...@gmail.com
>
>  > wrote:
> > I have never done those things before. Basically you cannot run two  
> > applications in 1 screen. So my best guess is that you have to use  
> > nested layout.
>
> > For nested layout, you need to have a child layout as a placeholder  
> > inside your normal layout, so it will look like:
>
> > <RelativeLayout>
> >        <LinearLayout/> or any customized layout here
> > </RelativeLayout>
>
> > and you need to have another .xml file declaring the layout you want  
> > to added into the original.
>
> > After that, you can use View.inflate() to attach the it into the  
> > original one.
>
> > Hence, the resizing function will be the layout resize function.
>
> > Daniel.
> > On Wed, Jun 24, 2009 at 6:43 PM, souvik <sadhu.sou...@gmail.com>  

honcheng

unread,
Jun 25, 2009, 1:01:38 AM6/25/09
to WeCode...@googlegroups.com
Hi souvik,

You cannot have 2 applications in one screen. Do you mean 2 different
views in one activity?

Sent from my iPhone
Reply all
Reply to author
Forward
0 new messages