[android-developers] Re: Screen

2009-02-20 Thread Dianne Hackborn
Finger nails do not work with a capacitive touch screen like the G1's, at
all.  Sorry.

On Fri, Feb 20, 2009 at 8:22 AM, Danex  wrote:

>
> Hi, I am looking for an app that can adjust my screen sensitity, for
> example: if I wanted to use my finger nails instead of my finger tip.
> A tmobile agent mentioned to me they have one but I've looked for days
> and cannot find one. Please help!
>
> >
>


-- 
Dianne Hackborn
Android framework engineer
hack...@android.com

Note: please don't send private questions to me, as I don't have time to
provide private support.  All such questions should be posted on public
forums, where I and others can see and answer them.

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



[android-developers] Re: Screen Orientation.

2009-03-24 Thread for android
getRequestedOrientation()

On Wed, Mar 25, 2009 at 9:34 AM, Suman  wrote:

>
> Hi all...
>
>
>Thanks for replies. Can any one tell me by which
> method i can check the screen orientation? I mean i want to check
> whether it is land-scap mode or portrait mode. Thanks in advance.
>
>
> Suman.
>
> >
>

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



[android-developers] Re: Screen Orientation.

2009-03-24 Thread Dianne Hackborn
That returns the orientation mode your activity has requested.  The actual
current orientation is in getResources().getDisplayMetrics().

On Tue, Mar 24, 2009 at 10:01 PM, for android  wrote:

> getRequestedOrientation()
>
>
> On Wed, Mar 25, 2009 at 9:34 AM, Suman  wrote:
>
>>
>> Hi all...
>>
>>
>>Thanks for replies. Can any one tell me by which
>> method i can check the screen orientation? I mean i want to check
>> whether it is land-scap mode or portrait mode. Thanks in advance.
>>
>>
>> Suman.
>>
>>
>>
>
> >
>


-- 
Dianne Hackborn
Android framework engineer
hack...@android.com

Note: please don't send private questions to me, as I don't have time to
provide private support.  All such questions should be posted on public
forums, where I and others can see and answer them.

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



[android-developers] Re: Screen Orientation.

2009-03-24 Thread for android
Does that mean from the DisplayMetrics we need to check from the height and
width?

On Wed, Mar 25, 2009 at 10:55 AM, Dianne Hackborn wrote:

> That returns the orientation mode your activity has requested.  The actual
> current orientation is in getResources().getDisplayMetrics().
>
> On Tue, Mar 24, 2009 at 10:01 PM, for android wrote:
>
>> getRequestedOrientation()
>>
>>
>> On Wed, Mar 25, 2009 at 9:34 AM, Suman  wrote:
>>
>>>
>>> Hi all...
>>>
>>>
>>>Thanks for replies. Can any one tell me by which
>>> method i can check the screen orientation? I mean i want to check
>>> whether it is land-scap mode or portrait mode. Thanks in advance.
>>>
>>>
>>> Suman.
>>>
>>>
>>>
>>
>>
>>
>
>
> --
> Dianne Hackborn
> Android framework engineer
> hack...@android.com
>
> Note: please don't send private questions to me, as I don't have time to
> provide private support.  All such questions should be posted on public
> forums, where I and others can see and answer them.
>
>
>
> >
>

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



[android-developers] Re: Screen Orientation.

2009-03-25 Thread Dianne Hackborn
Sorry I made a mistake, use getResources().getConfiguration().

On Tue, Mar 24, 2009 at 10:43 PM, for android  wrote:

> Does that mean from the DisplayMetrics we need to check from the height and
> width?
>
> On Wed, Mar 25, 2009 at 10:55 AM, Dianne Hackborn wrote:
>
>> That returns the orientation mode your activity has requested.  The actual
>> current orientation is in getResources().getDisplayMetrics().
>>
>> On Tue, Mar 24, 2009 at 10:01 PM, for android wrote:
>>
>>> getRequestedOrientation()
>>>
>>>
>>> On Wed, Mar 25, 2009 at 9:34 AM, Suman  wrote:
>>>

 Hi all...


Thanks for replies. Can any one tell me by which
 method i can check the screen orientation? I mean i want to check
 whether it is land-scap mode or portrait mode. Thanks in advance.


 Suman.



>>>
>>>
>>>
>>
>>
>> --
>> Dianne Hackborn
>> Android framework engineer
>> hack...@android.com
>>
>> Note: please don't send private questions to me, as I don't have time to
>> provide private support.  All such questions should be posted on public
>> forums, where I and others can see and answer them.
>>
>>
>>
>>
>>
>
> >
>


-- 
Dianne Hackborn
Android framework engineer
hack...@android.com

Note: please don't send private questions to me, as I don't have time to
provide private support.  All such questions should be posted on public
forums, where I and others can see and answer them.

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



[android-developers] Re: Screen Orientation.

2009-03-26 Thread Amir Alagic

int orientation = getResources().getConfiguration().orientation


On Mar 25, 8:12 am, Dianne Hackborn  wrote:
> Sorry I made a mistake, use getResources().getConfiguration().
>
>
>
>
>
> On Tue, Mar 24, 2009 at 10:43 PM, for android  wrote:
> > Does that mean from the DisplayMetrics we need to check from the height and
> > width?
>
> > On Wed, Mar 25, 2009 at 10:55 AM, Dianne Hackborn 
> > wrote:
>
> >> That returns the orientation mode your activity has requested.  The actual
> >> current orientation is in getResources().getDisplayMetrics().
>
> >> On Tue, Mar 24, 2009 at 10:01 PM, for android wrote:
>
> >>> getRequestedOrientation()
>
> >>> On Wed, Mar 25, 2009 at 9:34 AM, Suman  wrote:
>
>  Hi all...
>
>                 Thanks for replies. Can any one tell me by which
>  method i can check the screen orientation? I mean i want to check
>  whether it is land-scap mode or portrait mode. Thanks in advance.
>
>  Suman.
>
> >> --
> >> Dianne Hackborn
> >> Android framework engineer
> >> hack...@android.com
>
> >> Note: please don't send private questions to me, as I don't have time to
> >> provide private support.  All such questions should be posted on public
> >> forums, where I and others can see and answer them.
>
> --
> Dianne Hackborn
> Android framework engineer
> hack...@android.com
>
> Note: please don't send private questions to me, as I don't have time to
> provide private support.  All such questions should be posted on public
> forums, where I and others can see and answer them.- Hide quoted text -
>
> - Show quoted text -
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers-unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] Re: Screen Orientation.

2009-04-27 Thread jrgraf...@googlemail.com

I cant seem to get current orientation via either:

getResources().getConfiguration().orientation
or
(WindowManager) getSystemService(WINDOW_SERVICE).getDefaultDisplay
().getOrientation();

after setting up a preferred orientation via:

setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_LANDSCAPE);

Is there something I am doing wrong here? Is there a different way to
access the current orientation of the phone?

Thanks!

On Mar 26, 9:50 am, Amir Alagic  wrote:
> int orientation = getResources().getConfiguration().orientation
>
> On Mar 25, 8:12 am, Dianne Hackborn  wrote:
>
> > Sorry I made a mistake, use getResources().getConfiguration().
>
> > On Tue, Mar 24, 2009 at 10:43 PM, for android  wrote:
> > > Does that mean from the DisplayMetrics we need to check from the height 
> > > and
> > > width?
>
> > > On Wed, Mar 25, 2009 at 10:55 AM, Dianne Hackborn 
> > > wrote:
>
> > >> That returns the orientation mode your activity has requested.  The 
> > >> actual
> > >> current orientation is in getResources().getDisplayMetrics().
>
> > >> On Tue, Mar 24, 2009 at 10:01 PM, for android 
> > >> wrote:
>
> > >>> getRequestedOrientation()
>
> > >>> On Wed, Mar 25, 2009 at 9:34 AM, Suman  wrote:
>
> >  Hi all...
>
> >                 Thanks for replies. Can any one tell me by which
> >  method i can check the screen orientation? I mean i want to check
> >  whether it is land-scap mode or portrait mode. Thanks in advance.
>
> >  Suman.
>
> > >> --
> > >> Dianne Hackborn
> > >> Android framework engineer
> > >> hack...@android.com
>
> > >> Note: please don't send private questions to me, as I don't have time to
> > >> provide private support.  All such questions should be posted on public
> > >> forums, where I and others can see and answer them.
>
> > --
> > Dianne Hackborn
> > Android framework engineer
> > hack...@android.com
>
> > Note: please don't send private questions to me, as I don't have time to
> > provide private support.  All such questions should be posted on public
> > forums, where I and others can see and answer them.- Hide quoted text -
>
> > - Show quoted text -

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



[android-developers] Re: Screen Size

2009-11-28 Thread Jason
Have you taken a look at the "Supporting Multiple Screens" page on the
developer site?

http://developer.android.com/guide/practices/screens_support.html

This should provide most of the information you need in terms of
designing for multiple sizes.

On Nov 26, 1:30 pm, "Sasikumar.S"  wrote:
> Hi,
>
> What are the different screen size of android mobile?
>
> I need mobile screen size & model number of those mobiles.
>
> any one can know about these?
>
> Thanks in advance...
>
> --
> Thanks & Regards
> Sasikumar.S

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


[android-developers] Re: Screen rotation

2009-08-22 Thread Dianne Hackborn
All you can do is monitor the accelerometer yourself and decide for yourself
when you consider the screen to be rotated.

On Sat, Aug 22, 2009 at 3:27 PM, kabir  wrote:

>
> Hi,
>
> I have an activity which I have defined to keep in portrait position.
>
> However I would still like to change things (slightly) when the screen
> is rotated, what is the best way of doing this?
> I notice onConfigurationChanged is still called, but this still
> reports portrait mode.
>
> I want to keep the notification bar etc in the same position if
> possible.
>
> Cheers
> Kabir
> >
>


-- 
Dianne Hackborn
Android framework engineer
hack...@android.com

Note: please don't send private questions to me, as I don't have time to
provide private support, and so won't reply to such e-mails.  All such
questions should be posted on public forums, where I and others can see and
answer them.

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



[android-developers] Re: Screen rotation

2009-08-23 Thread Spektor Yaron
Hi Kabir,
if you mean how do you catch these events and change the layout this could
help:
http://www.devx.com/wireless/Article/40792/1954


On Sun, Aug 23, 2009 at 1:27 AM, kabir  wrote:

>
> Hi,
>
> I have an activity which I have defined to keep in portrait position.
>
> However I would still like to change things (slightly) when the screen
> is rotated, what is the best way of doing this?
> I notice onConfigurationChanged is still called, but this still
> reports portrait mode.
>
> I want to keep the notification bar etc in the same position if
> possible.
>
> Cheers
> Kabir
> >
>


-- 
Yaron Spektor

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



[android-developers] Re: Screen rotation

2009-08-23 Thread kabir

Thanks

On Aug 22, 11:27 pm, kabir  wrote:
> Hi,
>
> I have an activity which I have defined to keep in portrait position.
>
> However I would still like to change things (slightly) when the screen
> is rotated, what is the best way of doing this?
> I notice onConfigurationChanged is still called, but this still
> reports portrait mode.
>
> I want to keep the notification bar etc in the same position if
> possible.
>
> Cheers
> Kabir
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers-unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] Re: Screen size

2009-10-15 Thread Dianne Hackborn
Because you are running in density compatibility mode.

And for the most part, it is far better to get the screen size by creating
your view hierarchy and seeing what size the view(s) get set to.  The size
you get from Display is the absolute size of the physical screen, which
doesn't account for screen decorations like the status bar, soft keyboard,
and who knows what other things may be added on some devices in the future.

On Thu, Oct 15, 2009 at 2:07 PM, Sikus  wrote:

>
> Hi,
> is there any solution how recognize screen size? I'm using
> Display display = ((WindowManager) getSystemService
> (Context.WINDOW_SERVICE)).getDefaultDisplay();
>int width = display.getWidth();
>Log.i("width",""+width);
> but it doesn't works good. If i use HVGA in emulator it returns
> 320x480 but when I use QVGA it returns me 320x427 but QVGA has
> 240x320. Why?
> >
>


-- 
Dianne Hackborn
Android framework engineer
hack...@android.com

Note: please don't send private questions to me, as I don't have time to
provide private support, and so won't reply to such e-mails.  All such
questions should be posted on public forums, where I and others can see and
answer them.

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



[android-developers] Re: Screen size

2009-10-16 Thread Sikus

I don't understand where is problem in QVGA distinction. I have banner
which I load from server. Therefor I  need recognize programatically
absolute size of the physical screen that I have right width of
banner. Is there any way how can I recognize right physical screen
width?

On 15 říj, 23:39, Dianne Hackborn  wrote:
> Because you are running in density compatibility mode.
>
> And for the most part, it is far better to get the screen size by creating
> your view hierarchy and seeing what size the view(s) get set to.  The size
> you get from Display is the absolute size of the physical screen, which
> doesn't account for screen decorations like the status bar, soft keyboard,
> and who knows what other things may be added on some devices in the future.

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



[android-developers] Re: Screen size

2009-10-22 Thread Sikus

So, I solved it. I have problem with manifest.xml. When I don't use
android:targetSdkVersion="4" it resize for example QVGA from 240x320
to 320x427 and WVGA from 480x800 to 320x533. When I use
android:targetSdkVersion="4" everithing works good and
Display display = ((WindowManager) getSystemService
(Context.WINDOW_SERVICE)).getDefaultDisplay();
display.getWidth();
display.getHeight();

return me correct absolute size of the physical screen. QWGA 240x320
like in Table 1 on 
http://d.android.com/guide/practices/screens_support.html#range

Now I need density too, so I use

DisplayMetrics metrics = new DisplayMetrics();
 getWindowManager().getDefaultDisplay().getMetrics(metrics);
 metrics.densityDpi;

it returns 120, 160 and 240 int number.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] Re: Screen size

2009-10-22 Thread Dianne Hackborn
Be sure you read this so you understand what you are doing:
http://developer.android.com/guide/practices/screens_support.html

Also, go
ahead and ignore my point that you shouldn't do things based on the raw
physical dimensions of the screen, but your app will break in the future
when it is running on some device that has status-bar like UI elements along
the side of the screen.  You can pretty much count on this happening,
especially as larger screens like MIDs etc appear.

On Thu, Oct 22, 2009 at 4:57 AM, Sikus  wrote:

>
> So, I solved it. I have problem with manifest.xml. When I don't use
> android:targetSdkVersion="4" it resize for example QVGA from 240x320
> to 320x427 and WVGA from 480x800 to 320x533. When I use
> android:targetSdkVersion="4" everithing works good and
> Display display = ((WindowManager) getSystemService
> (Context.WINDOW_SERVICE)).getDefaultDisplay();
> display.getWidth();
> display.getHeight();
>
> return me correct absolute size of the physical screen. QWGA 240x320
> like in Table 1 on
> http://d.android.com/guide/practices/screens_support.html#range
>
> Now I need density too, so I use
>
> DisplayMetrics metrics = new DisplayMetrics();
> getWindowManager().getDefaultDisplay().getMetrics(metrics);
> metrics.densityDpi;
>
> it returns 120, 160 and 240 int number.
> >
>


-- 
Dianne Hackborn
Android framework engineer
hack...@android.com

Note: please don't send private questions to me, as I don't have time to
provide private support, and so won't reply to such e-mails.  All such
questions should be posted on public forums, where I and others can see and
answer them.

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



[android-developers] Re: Screen Orientation.

2009-04-27 Thread Dianne Hackborn
getResources().getConfiguration().orientation contains the current
orientation, as defined by the constants described in the java docs (NOT the
SCREEN_ORIENTATION_* contantgs).

On Mon, Apr 27, 2009 at 4:05 PM, jrgraf...@googlemail.com <
jrgraf...@googlemail.com> wrote:

>
> I cant seem to get current orientation via either:
>
> getResources().getConfiguration().orientation
> or
> (WindowManager) getSystemService(WINDOW_SERVICE).getDefaultDisplay
> ().getOrientation();
>
> after setting up a preferred orientation via:
>
> setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_LANDSCAPE);
>
> Is there something I am doing wrong here? Is there a different way to
> access the current orientation of the phone?
>
> Thanks!
>
> On Mar 26, 9:50 am, Amir Alagic  wrote:
> > int orientation = getResources().getConfiguration().orientation
> >
> > On Mar 25, 8:12 am, Dianne Hackborn  wrote:
> >
> > > Sorry I made a mistake, use getResources().getConfiguration().
> >
> > > On Tue, Mar 24, 2009 at 10:43 PM, for android 
> wrote:
> > > > Does that mean from the DisplayMetrics we need to check from the
> height and
> > > > width?
> >
> > > > On Wed, Mar 25, 2009 at 10:55 AM, Dianne Hackborn <
> hack...@android.com>wrote:
> >
> > > >> That returns the orientation mode your activity has requested.  The
> actual
> > > >> current orientation is in getResources().getDisplayMetrics().
> >
> > > >> On Tue, Mar 24, 2009 at 10:01 PM, for android  >wrote:
> >
> > > >>> getRequestedOrientation()
> >
> > > >>> On Wed, Mar 25, 2009 at 9:34 AM, Suman 
> wrote:
> >
> > >  Hi all...
> >
> > > Thanks for replies. Can any one tell me by which
> > >  method i can check the screen orientation? I mean i want to check
> > >  whether it is land-scap mode or portrait mode. Thanks in advance.
> >
> > >  Suman.
> >
> > > >> --
> > > >> Dianne Hackborn
> > > >> Android framework engineer
> > > >> hack...@android.com
> >
> > > >> Note: please don't send private questions to me, as I don't have
> time to
> > > >> provide private support.  All such questions should be posted on
> public
> > > >> forums, where I and others can see and answer them.
> >
> > > --
> > > Dianne Hackborn
> > > Android framework engineer
> > > hack...@android.com
> >
> > > Note: please don't send private questions to me, as I don't have time
> to
> > > provide private support.  All such questions should be posted on public
> > > forums, where I and others can see and answer them.- Hide quoted text -
> >
> > > - Show quoted text -
>
> >
>


-- 
Dianne Hackborn
Android framework engineer
hack...@android.com

Note: please don't send private questions to me, as I don't have time to
provide private support, and so won't reply to such e-mails.  All such
questions should be posted on public forums, where I and others can see and
answer them.

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



[android-developers] Re: Screen Orientation.

2009-04-28 Thread jrgraf...@googlemail.com

The problem for me though is that the constants returned never change
after I set a preferred Orientation no matter how I rotate the
Phone :/

On Apr 28, 4:34 am, Dianne Hackborn  wrote:
> getResources().getConfiguration().orientation contains the current
> orientation, as defined by the constants described in the java docs (NOT the
> SCREEN_ORIENTATION_* contantgs).
>
> On Mon, Apr 27, 2009 at 4:05 PM, jrgraf...@googlemail.com <
>
>
>
> jrgraf...@googlemail.com> wrote:
>
> > I cant seem to get current orientation via either:
>
> > getResources().getConfiguration().orientation
> > or
> > (WindowManager) getSystemService(WINDOW_SERVICE).getDefaultDisplay
> > ().getOrientation();
>
> > after setting up a preferred orientation via:
>
> > setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_LANDSCAPE);
>
> > Is there something I am doing wrong here? Is there a different way to
> > access the current orientation of the phone?
>
> > Thanks!
>
> > On Mar 26, 9:50 am, Amir Alagic  wrote:
> > > int orientation = getResources().getConfiguration().orientation
>
> > > On Mar 25, 8:12 am, Dianne Hackborn  wrote:
>
> > > > Sorry I made a mistake, use getResources().getConfiguration().
>
> > > > On Tue, Mar 24, 2009 at 10:43 PM, for android 
> > wrote:
> > > > > Does that mean from the DisplayMetrics we need to check from the
> > height and
> > > > > width?
>
> > > > > On Wed, Mar 25, 2009 at 10:55 AM, Dianne Hackborn <
> > hack...@android.com>wrote:
>
> > > > >> That returns the orientation mode your activity has requested.  The
> > actual
> > > > >> current orientation is in getResources().getDisplayMetrics().
>
> > > > >> On Tue, Mar 24, 2009 at 10:01 PM, for android  > >wrote:
>
> > > > >>> getRequestedOrientation()
>
> > > > >>> On Wed, Mar 25, 2009 at 9:34 AM, Suman 
> > wrote:
>
> > > >  Hi all...
>
> > > >                 Thanks for replies. Can any one tell me by which
> > > >  method i can check the screen orientation? I mean i want to check
> > > >  whether it is land-scap mode or portrait mode. Thanks in advance.
>
> > > >  Suman.
>
> > > > >> --
> > > > >> Dianne Hackborn
> > > > >> Android framework engineer
> > > > >> hack...@android.com
>
> > > > >> Note: please don't send private questions to me, as I don't have
> > time to
> > > > >> provide private support.  All such questions should be posted on
> > public
> > > > >> forums, where I and others can see and answer them.
>
> > > > --
> > > > Dianne Hackborn
> > > > Android framework engineer
> > > > hack...@android.com
>
> > > > Note: please don't send private questions to me, as I don't have time
> > to
> > > > provide private support.  All such questions should be posted on public
> > > > forums, where I and others can see and answer them.- Hide quoted text -
>
> > > > - Show quoted text -
>
> --
> Dianne Hackborn
> Android framework engineer
> hack...@android.com
>
> Note: please don't send private questions to me, as I don't have time to
> provide private support, and so won't reply to such e-mails.  All such
> questions should be posted on public forums, where I and others can see and
> answer them.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers-unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] Re: Screen Orientation.

2009-04-28 Thread Troglodad

I can get my phone to rotate one way only- If I rotate the phone onto
the left side, as though I were going to use the keyboard. Upside down
and right side, nothing.

Also, I notice that only some programs rotate- the main screen doesn't
rotate, but the browser, messaging and notepad do.


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



[android-developers] Re: Screen Orientation.

2009-04-28 Thread Dianne Hackborn
Yes, for 1.5 we only support rotating to the left (the same as the rotation
on the G1).  And some of the built-in apps turn off rotation.

On Tue, Apr 28, 2009 at 8:33 AM, Troglodad  wrote:

>
> I can get my phone to rotate one way only- If I rotate the phone onto
> the left side, as though I were going to use the keyboard. Upside down
> and right side, nothing.
>
> Also, I notice that only some programs rotate- the main screen doesn't
> rotate, but the browser, messaging and notepad do.
>
>
> >
>


-- 
Dianne Hackborn
Android framework engineer
hack...@android.com

Note: please don't send private questions to me, as I don't have time to
provide private support, and so won't reply to such e-mails.  All such
questions should be posted on public forums, where I and others can see and
answer them.

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



[android-developers] Re: Screen Orientation.

2009-04-28 Thread Dianne Hackborn
I don't know what to say, they certainly do in all the cases I know of.  You
must want to put together short as possible sample code showing the problem
happening; otherwise, with no way to repro (and no code to see exactly what
you are doing), I can't help any more.

On Tue, Apr 28, 2009 at 7:23 AM, jrgraf...@googlemail.com <
jrgraf...@googlemail.com> wrote:

>
> The problem for me though is that the constants returned never change
> after I set a preferred Orientation no matter how I rotate the
> Phone :/
>
> On Apr 28, 4:34 am, Dianne Hackborn  wrote:
> > getResources().getConfiguration().orientation contains the current
> > orientation, as defined by the constants described in the java docs (NOT
> the
> > SCREEN_ORIENTATION_* contantgs).
> >
> > On Mon, Apr 27, 2009 at 4:05 PM, jrgraf...@googlemail.com <
> >
> >
> >
> > jrgraf...@googlemail.com> wrote:
> >
> > > I cant seem to get current orientation via either:
> >
> > > getResources().getConfiguration().orientation
> > > or
> > > (WindowManager) getSystemService(WINDOW_SERVICE).getDefaultDisplay
> > > ().getOrientation();
> >
> > > after setting up a preferred orientation via:
> >
> > > setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_LANDSCAPE);
> >
> > > Is there something I am doing wrong here? Is there a different way to
> > > access the current orientation of the phone?
> >
> > > Thanks!
> >
> > > On Mar 26, 9:50 am, Amir Alagic  wrote:
> > > > int orientation = getResources().getConfiguration().orientation
> >
> > > > On Mar 25, 8:12 am, Dianne Hackborn  wrote:
> >
> > > > > Sorry I made a mistake, use getResources().getConfiguration().
> >
> > > > > On Tue, Mar 24, 2009 at 10:43 PM, for android <
> forandr...@gmail.com>
> > > wrote:
> > > > > > Does that mean from the DisplayMetrics we need to check from the
> > > height and
> > > > > > width?
> >
> > > > > > On Wed, Mar 25, 2009 at 10:55 AM, Dianne Hackborn <
> > > hack...@android.com>wrote:
> >
> > > > > >> That returns the orientation mode your activity has requested.
>  The
> > > actual
> > > > > >> current orientation is in getResources().getDisplayMetrics().
> >
> > > > > >> On Tue, Mar 24, 2009 at 10:01 PM, for android <
> forandr...@gmail.com
> > > >wrote:
> >
> > > > > >>> getRequestedOrientation()
> >
> > > > > >>> On Wed, Mar 25, 2009 at 9:34 AM, Suman  >
> > > wrote:
> >
> > > > >  Hi all...
> >
> > > > > Thanks for replies. Can any one tell me by
> which
> > > > >  method i can check the screen orientation? I mean i want to
> check
> > > > >  whether it is land-scap mode or portrait mode. Thanks in
> advance.
> >
> > > > >  Suman.
> >
> > > > > >> --
> > > > > >> Dianne Hackborn
> > > > > >> Android framework engineer
> > > > > >> hack...@android.com
> >
> > > > > >> Note: please don't send private questions to me, as I don't have
> > > time to
> > > > > >> provide private support.  All such questions should be posted on
> > > public
> > > > > >> forums, where I and others can see and answer them.
> >
> > > > > --
> > > > > Dianne Hackborn
> > > > > Android framework engineer
> > > > > hack...@android.com
> >
> > > > > Note: please don't send private questions to me, as I don't have
> time
> > > to
> > > > > provide private support.  All such questions should be posted on
> public
> > > > > forums, where I and others can see and answer them.- Hide quoted
> text -
> >
> > > > > - Show quoted text -
> >
> > --
> > Dianne Hackborn
> > Android framework engineer
> > hack...@android.com
> >
> > Note: please don't send private questions to me, as I don't have time to
> > provide private support, and so won't reply to such e-mails.  All such
> > questions should be posted on public forums, where I and others can see
> and
> > answer them.
> >
>


-- 
Dianne Hackborn
Android framework engineer
hack...@android.com

Note: please don't send private questions to me, as I don't have time to
provide private support, and so won't reply to such e-mails.  All such
questions should be posted on public forums, where I and others can see and
answer them.

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



[android-developers] Re: Screen Orientation.

2009-04-28 Thread Troglodad

Well that stinks- I lay on my right side in bed... I was looking
forward to checking emails and surfing the net without having to turn
the phone!

On Apr 28, 12:47 pm, Dianne Hackborn  wrote:
> Yes, for 1.5 we only support rotating to the left (the same as the rotation
> on the G1).  And some of the built-in apps turn off rotation.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers-unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] Re: Screen Orientation.

2009-04-28 Thread jrgraf...@googlemail.com

Hey Dianne,

Thanks for your reply, below is a sample of the code that I am using:

@Override
public void onConfigurationChanged(Configuration newConfig) {
super.onConfigurationChanged(newConfig);
Log.i(TAG, "WM getOrientation: "
+ ((WindowManager) getSystemService
(WINDOW_SERVICE)).getDefaultDisplay().getOrientation());
Log.i(TAG, "getResources: " + getResources().getConfiguration
().orientation);
Log.i(TAG, "newConfig: " + newConfig.orientation);
}

As well as adding the following to the Android XML file so that I can
handle rotation events locally:



The following is the output after two successive rotations:

04-29 00:28:08.588: INFO/sinEgen(883): WM getOrientation: 1
04-29 00:28:08.588: INFO/sinEgen(883): getResources: 2
04-29 00:28:08.598: INFO/sinEgen(883): newConfig: 2
04-29 00:28:10.326: INFO/WindowManager(569): Config changed:
{ scale=1.0 imsi=0/0 locale=en_GB touch=3 key=2/1/2 nav=3 orien=2 }
04-29 00:28:10.449: DEBUG/dalvikvm(569): GC freed 1837 objects /
114064 bytes in 126ms
04-29 00:28:10.459: INFO/WindowManager(569): onOrientationChanged,
rotation changed to 0
04-29 00:28:10.549: DEBUG/StatusBar(569): updateResources
04-29 00:28:10.639: INFO/sinEgen(883): WM getOrientation: 1
04-29 00:28:10.639: INFO/sinEgen(883): getResources: 2
04-29 00:28:10.639: INFO/sinEgen(883): newConfig: 2

As you can see none of the methods used are detecting any orientation
change at all!

However if I remove:


setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_LANDSCAPE);

>From my activities onCreate() function they all successfully detect
orientation changes:

04-29 00:35:32.939: INFO/sinEgen(720): WM getOrientation: 1
04-29 00:35:32.939: INFO/sinEgen(720): getResources: 2
04-29 00:35:32.939: INFO/sinEgen(720): newConfig: 2
04-29 00:35:32.959: WARN/ActivityManager(567): Activity idle timeout
for HistoryRecord{4358b930 {com.android.jamesgrafton.sinEgen/
com.android.jamesgrafton.sinEgen.SinEgen}}
04-29 00:35:33.168: INFO/WindowManager(567): Config changed:
{ scale=1.0 imsi=0/0 locale=en_GB touch=3 key=2/1/2 nav=3 orien=2 }
04-29 00:35:33.229: INFO/WindowManager(567): onOrientationChanged,
rotation changed to 0
04-29 00:35:33.229: INFO/WindowManager(567): Setting rotation to 0,
animFlags=0
04-29 00:35:33.279: INFO/WindowManager(567): Config changed:
{ scale=1.0 imsi=0/0 locale=en_GB touch=3 key=2/1/2 nav=3 orien=1 }
04-29 00:35:33.349: INFO/ARMAssembler(567): generated
scanline__0077:03545404_0004_ [ 47 ipp] (67 ins) at
[0x1ecd80:0x1ece8c] in 432527 ns
04-29 00:35:33.389: DEBUG/StatusBar(567): updateResources
04-29 00:35:33.509: DEBUG/StatusBar(567): updateResources
04-29 00:35:33.519: INFO/sinEgen(720): WM getOrientation: 0
04-29 00:35:33.549: INFO/sinEgen(720): getResources: 1
04-29 00:35:33.549: INFO/sinEgen(720): newConfig: 1

I must admit I am at a loss!


On Apr 28, 5:48 pm, Dianne Hackborn  wrote:
> I don't know what to say, they certainly do in all the cases I know of.  You
> must want to put together short as possible sample code showing the problem
> happening; otherwise, with no way to repro (and no code to see exactly what
> you are doing), I can't help any more.
>
> On Tue, Apr 28, 2009 at 7:23 AM, jrgraf...@googlemail.com <
>
>
>
> jrgraf...@googlemail.com> wrote:
>
> > The problem for me though is that the constants returned never change
> > after I set a preferred Orientation no matter how I rotate the
> > Phone :/
>
> > On Apr 28, 4:34 am, Dianne Hackborn  wrote:
> > > getResources().getConfiguration().orientation contains the current
> > > orientation, as defined by the constants described in the java docs (NOT
> > the
> > > SCREEN_ORIENTATION_* contantgs).
>
> > > On Mon, Apr 27, 2009 at 4:05 PM, jrgraf...@googlemail.com <
>
> > > jrgraf...@googlemail.com> wrote:
>
> > > > I cant seem to get current orientation via either:
>
> > > > getResources().getConfiguration().orientation
> > > > or
> > > > (WindowManager) getSystemService(WINDOW_SERVICE).getDefaultDisplay
> > > > ().getOrientation();
>
> > > > after setting up a preferred orientation via:
>
> > > > setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_LANDSCAPE);
>
> > > > Is there something I am doing wrong here? Is there a different way to
> > > > access the current orientation of the phone?
>
> > > > Thanks!
>
> > > > On Mar 26, 9:50 am, Amir Alagic  wrote:
> > > > > int orientation = getResources().getConfiguration().orientation
>
> > > > > On Mar 25, 8:12 am, Dianne Hackborn  wrote:
>
> > > > > > Sorry I made a mistake, use getResources().getConfiguration().
>
> > > > > > On Tue, Mar 24, 2009 at 10:43 PM, for android <
> > forandr...@gmail.com>
> > > > wrote:
> > > > > > > Does that mean from the DisplayMetrics we need to check from the
> > > > height and
> > > > > > > width?
>
> > > > > > > On Wed, Mar 25, 2009 at 10:55 AM, Dianne Hackborn <
> > > > hack...@android.

[android-developers] Re: Screen Orientation.

2009-04-28 Thread Dianne Hackborn
Um, if I am reading that right, it is exactly working as intended.  With
setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_LANDSCAPE) you are
saying to keep the screen in landscape, so the orientation shouldn't
change.  In fact you shouldn't see the screen actually rotating, just the
keyboard hidden state changing.

Am I missing something?

On Tue, Apr 28, 2009 at 5:36 PM, jrgraf...@googlemail.com <
jrgraf...@googlemail.com> wrote:

>
> Hey Dianne,
>
> Thanks for your reply, below is a sample of the code that I am using:
>
>@Override
>public void onConfigurationChanged(Configuration newConfig) {
>super.onConfigurationChanged(newConfig);
>Log.i(TAG, "WM getOrientation: "
>+ ((WindowManager) getSystemService
> (WINDOW_SERVICE)).getDefaultDisplay().getOrientation());
>Log.i(TAG, "getResources: " +
> getResources().getConfiguration
> ().orientation);
>Log.i(TAG, "newConfig: " + newConfig.orientation);
>}
>
> As well as adding the following to the Android XML file so that I can
> handle rotation events locally:
>
>  android:label="@string/app_name"
> android:configChanges="keyboardHidden|orientation">
>
> The following is the output after two successive rotations:
>
> 04-29 00:28:08.588: INFO/sinEgen(883): WM getOrientation: 1
> 04-29 00:28:08.588: INFO/sinEgen(883): getResources: 2
> 04-29 00:28:08.598: INFO/sinEgen(883): newConfig: 2
> 04-29 00:28:10.326: INFO/WindowManager(569): Config changed:
> { scale=1.0 imsi=0/0 locale=en_GB touch=3 key=2/1/2 nav=3 orien=2 }
> 04-29 00:28:10.449: DEBUG/dalvikvm(569): GC freed 1837 objects /
> 114064 bytes in 126ms
> 04-29 00:28:10.459: INFO/WindowManager(569): onOrientationChanged,
> rotation changed to 0
> 04-29 00:28:10.549: DEBUG/StatusBar(569): updateResources
> 04-29 00:28:10.639: INFO/sinEgen(883): WM getOrientation: 1
> 04-29 00:28:10.639: INFO/sinEgen(883): getResources: 2
> 04-29 00:28:10.639: INFO/sinEgen(883): newConfig: 2
>
> As you can see none of the methods used are detecting any orientation
> change at all!
>
> However if I remove:
>
>
>  setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_LANDSCAPE);
>
> From my activities onCreate() function they all successfully detect
> orientation changes:
>
> 04-29 00:35:32.939: INFO/sinEgen(720): WM getOrientation: 1
> 04-29 00:35:32.939: INFO/sinEgen(720): getResources: 2
> 04-29 00:35:32.939: INFO/sinEgen(720): newConfig: 2
> 04-29 00:35:32.959: WARN/ActivityManager(567): Activity idle timeout
> for HistoryRecord{4358b930 {com.android.jamesgrafton.sinEgen/
> com.android.jamesgrafton.sinEgen.SinEgen}}
> 04-29 00:35:33.168: INFO/WindowManager(567): Config changed:
> { scale=1.0 imsi=0/0 locale=en_GB touch=3 key=2/1/2 nav=3 orien=2 }
> 04-29 00:35:33.229: INFO/WindowManager(567): onOrientationChanged,
> rotation changed to 0
> 04-29 00:35:33.229: INFO/WindowManager(567): Setting rotation to 0,
> animFlags=0
> 04-29 00:35:33.279: INFO/WindowManager(567): Config changed:
> { scale=1.0 imsi=0/0 locale=en_GB touch=3 key=2/1/2 nav=3 orien=1 }
> 04-29 00:35:33.349: INFO/ARMAssembler(567): generated
> scanline__0077:03545404_0004_ [ 47 ipp] (67 ins) at
> [0x1ecd80:0x1ece8c] in 432527 ns
> 04-29 00:35:33.389: DEBUG/StatusBar(567): updateResources
> 04-29 00:35:33.509: DEBUG/StatusBar(567): updateResources
> 04-29 00:35:33.519: INFO/sinEgen(720): WM getOrientation: 0
> 04-29 00:35:33.549: INFO/sinEgen(720): getResources: 1
> 04-29 00:35:33.549: INFO/sinEgen(720): newConfig: 1
>
> I must admit I am at a loss!
>
>
> On Apr 28, 5:48 pm, Dianne Hackborn  wrote:
> > I don't know what to say, they certainly do in all the cases I know of.
>  You
> > must want to put together short as possible sample code showing the
> problem
> > happening; otherwise, with no way to repro (and no code to see exactly
> what
> > you are doing), I can't help any more.
> >
> > On Tue, Apr 28, 2009 at 7:23 AM, jrgraf...@googlemail.com <
> >
> >
> >
> > jrgraf...@googlemail.com> wrote:
> >
> > > The problem for me though is that the constants returned never change
> > > after I set a preferred Orientation no matter how I rotate the
> > > Phone :/
> >
> > > On Apr 28, 4:34 am, Dianne Hackborn  wrote:
> > > > getResources().getConfiguration().orientation contains the current
> > > > orientation, as defined by the constants described in the java docs
> (NOT
> > > the
> > > > SCREEN_ORIENTATION_* contantgs).
> >
> > > > On Mon, Apr 27, 2009 at 4:05 PM, jrgraf...@googlemail.com <
> >
> > > > jrgraf...@googlemail.com> wrote:
> >
> > > > > I cant seem to get current orientation via either:
> >
> > > > > getResources().getConfiguration().orientation
> > > > > or
> > > > > (WindowManager) getSystemService(WINDOW_SERVICE).getDefaultDisplay
> > > > > ().getOrientation();
> >
> > > > > after setting up a preferred orientation via:
> >
> > > > > setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATIO

[android-developers] Re: Screen Orientation.

2009-04-29 Thread jrgraf...@googlemail.com

Ah sorry my fault, I think I may have mis communicated my original
issue. I wanted to know if there was a way of detecting the actual
phone orientation rather than the screen orientation (I want my
application to always stay in one orientation but still be able to
detect the current orientation of the phone).

I noticed that although all orientation detection functions stay
constant once I have set my requested orientation the "INFO/
WindowManager(567): Setting rotation to" message still seems to detect
the Orientation change.

On Apr 29, 5:09 am, Dianne Hackborn  wrote:
> Um, if I am reading that right, it is exactly working as intended.  With
> setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_LANDSCAPE) you are
> saying to keep the screen in landscape, so the orientation shouldn't
> change.  In fact you shouldn't see the screen actually rotating, just the
> keyboard hidden state changing.
>
> Am I missing something?
>
> On Tue, Apr 28, 2009 at 5:36 PM, jrgraf...@googlemail.com <
>
>
>
> jrgraf...@googlemail.com> wrote:
>
> > Hey Dianne,
>
> > Thanks for your reply, below is a sample of the code that I am using:
>
> >       �...@override
> >        public void onConfigurationChanged(Configuration newConfig) {
> >                super.onConfigurationChanged(newConfig);
> >                Log.i(TAG, "WM getOrientation: "
> >                                + ((WindowManager) getSystemService
> > (WINDOW_SERVICE)).getDefaultDisplay().getOrientation());
> >                Log.i(TAG, "getResources: " +
> > getResources().getConfiguration
> > ().orientation);
> >                Log.i(TAG, "newConfig: " + newConfig.orientation);
> >        }
>
> > As well as adding the following to the Android XML file so that I can
> > handle rotation events locally:
>
> >         >                  android:label="@string/app_name"
> > android:configChanges="keyboardHidden|orientation">
>
> > The following is the output after two successive rotations:
>
> > 04-29 00:28:08.588: INFO/sinEgen(883): WM getOrientation: 1
> > 04-29 00:28:08.588: INFO/sinEgen(883): getResources: 2
> > 04-29 00:28:08.598: INFO/sinEgen(883): newConfig: 2
> > 04-29 00:28:10.326: INFO/WindowManager(569): Config changed:
> > { scale=1.0 imsi=0/0 locale=en_GB touch=3 key=2/1/2 nav=3 orien=2 }
> > 04-29 00:28:10.449: DEBUG/dalvikvm(569): GC freed 1837 objects /
> > 114064 bytes in 126ms
> > 04-29 00:28:10.459: INFO/WindowManager(569): onOrientationChanged,
> > rotation changed to 0
> > 04-29 00:28:10.549: DEBUG/StatusBar(569): updateResources
> > 04-29 00:28:10.639: INFO/sinEgen(883): WM getOrientation: 1
> > 04-29 00:28:10.639: INFO/sinEgen(883): getResources: 2
> > 04-29 00:28:10.639: INFO/sinEgen(883): newConfig: 2
>
> > As you can see none of the methods used are detecting any orientation
> > change at all!
>
> > However if I remove:
>
> >  setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_LANDSCAPE);
>
> > From my activities onCreate() function they all successfully detect
> > orientation changes:
>
> > 04-29 00:35:32.939: INFO/sinEgen(720): WM getOrientation: 1
> > 04-29 00:35:32.939: INFO/sinEgen(720): getResources: 2
> > 04-29 00:35:32.939: INFO/sinEgen(720): newConfig: 2
> > 04-29 00:35:32.959: WARN/ActivityManager(567): Activity idle timeout
> > for HistoryRecord{4358b930 {com.android.jamesgrafton.sinEgen/
> > com.android.jamesgrafton.sinEgen.SinEgen}}
> > 04-29 00:35:33.168: INFO/WindowManager(567): Config changed:
> > { scale=1.0 imsi=0/0 locale=en_GB touch=3 key=2/1/2 nav=3 orien=2 }
> > 04-29 00:35:33.229: INFO/WindowManager(567): onOrientationChanged,
> > rotation changed to 0
> > 04-29 00:35:33.229: INFO/WindowManager(567): Setting rotation to 0,
> > animFlags=0
> > 04-29 00:35:33.279: INFO/WindowManager(567): Config changed:
> > { scale=1.0 imsi=0/0 locale=en_GB touch=3 key=2/1/2 nav=3 orien=1 }
> > 04-29 00:35:33.349: INFO/ARMAssembler(567): generated
> > scanline__0077:03545404_0004_ [ 47 ipp] (67 ins) at
> > [0x1ecd80:0x1ece8c] in 432527 ns
> > 04-29 00:35:33.389: DEBUG/StatusBar(567): updateResources
> > 04-29 00:35:33.509: DEBUG/StatusBar(567): updateResources
> > 04-29 00:35:33.519: INFO/sinEgen(720): WM getOrientation: 0
> > 04-29 00:35:33.549: INFO/sinEgen(720): getResources: 1
> > 04-29 00:35:33.549: INFO/sinEgen(720): newConfig: 1
>
> > I must admit I am at a loss!
>
> > On Apr 28, 5:48 pm, Dianne Hackborn  wrote:
> > > I don't know what to say, they certainly do in all the cases I know of.
> >  You
> > > must want to put together short as possible sample code showing the
> > problem
> > > happening; otherwise, with no way to repro (and no code to see exactly
> > what
> > > you are doing), I can't help any more.
>
> > > On Tue, Apr 28, 2009 at 7:23 AM, jrgraf...@googlemail.com <
>
> > > jrgraf...@googlemail.com> wrote:
>
> > > > The problem for me though is that the constants returned never change
> > > > after I set a preferred Orientation no matter how I rotate the
> > > > Phone :/
>
> > > > On Apr 28

[android-developers] Re: Screen Orientation.

2009-05-06 Thread Anonymous Anonymous
Is it disabled for messaging now?

On Tue, Apr 28, 2009 at 10:17 PM, Dianne Hackborn wrote:

> Yes, for 1.5 we only support rotating to the left (the same as the rotation
> on the G1).  And some of the built-in apps turn off rotation.
>
> On Tue, Apr 28, 2009 at 8:33 AM, Troglodad  wrote:
>
>>
>> I can get my phone to rotate one way only- If I rotate the phone onto
>> the left side, as though I were going to use the keyboard. Upside down
>> and right side, nothing.
>>
>> Also, I notice that only some programs rotate- the main screen doesn't
>> rotate, but the browser, messaging and notepad do.
>>
>>
>>
>>
>
>
> --
> Dianne Hackborn
> Android framework engineer
> hack...@android.com
>
> Note: please don't send private questions to me, as I don't have time to
> provide private support, and so won't reply to such e-mails.  All such
> questions should be posted on public forums, where I and others can see and
> answer them.
>
>
> >
>

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



[android-developers] Re: screen orientation.

2011-06-09 Thread Android K
I meant Dialog box gets stuck and I can't remove the dialog box.

On Thu, Jun 9, 2011 at 7:46 PM, Android K wrote:

> Hello,
> I am trying to control the orientation from which I start. It works fine if
> I hold the phone in portrait mode and start my app. Otherwise dialog gets if
> I start in landscape position.
>
> Any help is appreciated.
>
> Thanks,
> Harsha
>
>
> *public* *void* onCreate(Bundle savedInstanceState)
>
> {
>
>  *super*.onCreate(savedInstanceState);
>
> setRequestedOrientation(ActivityInfo.
> *SCREEN_ORIENTATION_PORTRAIT*);
>
>
>
> showDialog(TEST);
>
> }
>
>
>
> I tried using Manisfest file too.
>
>
>
>  xml version=*"1.0"* encoding=*"utf-8"*?>
>
> <
> manifest xmlns:android=*"http://schemas.android.com/apk/res/android"*
>
> package=*"com.playWAV"*
>
> android:versionCode=*"1"*
>
> android:versionName=*"1.0"*
>
> android:screenOrientation=*"portrait"*>
>
> 
> android:name=*"android.permission.INTERNET"* />
>
> 
> android:name=*"android.permission.READ_CONTACTS"* />
>
> 
> android:name=*"android.permission.READ_PHONE_STATE"* />
>
> 
> android:label=*"@string/app_name"*
>
> android:screenOrientation=*"portrait"*
>

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

[android-developers] Re: Screen Rotation

2010-07-17 Thread nation-x
If you look at this tutorial I created at
http://androidworkz.com/2010/07/06/source-code-imageview-flipper-sd-card-scanner/
there is an example of one way to save an array object to a file and
to read it back in. I tried using SharedPreferences, etc as described
in the docs and gave up because I couldn't get it to work and this
solution I came up with works perfectly. This is essentially the basis
of the method. It is simple to use... there are 2 functions.

public void saveArray(String filename, String[] output_field) {
 try {
FileOutputStream fos = new FileOutputStream(filename);
GZIPOutputStream gzos = new GZIPOutputStream(fos);
ObjectOutputStream out = new ObjectOutputStream(gzos);
out.writeObject(output_field);
out.flush();
out.close();
 }
 catch (IOException e) {
 e.getStackTrace();
 }
}

@SuppressWarnings("unchecked")
public String[] loadArray(String filename) {
  try {
FileInputStream fis = new FileInputStream(filename);
GZIPInputStream gzis = new GZIPInputStream(fis);
ObjectInputStream in = new ObjectInputStream(gzis);
String[] read_field = (String[])in.readObject();
in.close();
return read_field;
  }
  catch (Exception e) {
  e.getStackTrace();
  }
  return null;
}

You just call them like this.
Save Array: saveArray("/sdcard/.mydata/data.dat", MyArray);
Load Array: String[] MyArray = loadArray("/sdcard/.mydata/data.dat");


If you want to use a different type such as a List or whatever,
you can just change the functions to use that type. I have found it
works with any object that is Serializeable.

Shawn McAllister


On Jul 16, 12:09 am, 7H3LaughingMan  wrote:
> I was working on implementing a more advanced list view then the
> standard one they teach you in basic tutorials, and I did find a great
> tutorial explaining how to create your own Adapter and such 
> not.http://www.softwarepassion.com/android-series-custom-listview-items-a...
>
> I do have a working version of the tutorial and I am currently in the
> process of changing the list to suit my needs, but there are a few
> issues I am stumped on. If your run the tutorial code it creates a
> little progress dialog saying that it is retrieving data. In my
> application it is going to be fetching data from the internet and
> storing it in an ArrayList of custom objects. However if I where to
> rotate the screen the progress dialog pops up again, I have no clue on
> how to set it up so that when it rotates that it doesn't recreate
> everything and re-fetch the data and process it again.
>
> Any help is greatly appreciated.

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


[android-developers] Re: screen design

2010-08-09 Thread andrej sarkic
you might want to read this:

http://developer.android.com/guide/practices/screens_support.html

On Aug 9, 1:53 am, "A N K ! T"  wrote:
> i am developing some UI screens.. but i am not getting ..should i make
> screens for all resolutions or some keywords like things are there by which
> i can make UI so that it can support all resolutions.
> guide me.. thanks
>
> --
>
>  A N K ! T..

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


[android-developers] Re: screen design

2010-08-09 Thread Peter Stacey
ANK!T,

If you haven't read it already, you might find the following
information on the developer guide useful:

http://developer.android.com/guide/practices/screens_support.html

regards,

Peter


On Aug 9, 7:53 am, "A N K ! T"  wrote:
> i am developing some UI screens.. but i am not getting ..should i make
> screens for all resolutions or some keywords like things are there by which
> i can make UI so that it can support all resolutions.
> guide me.. thanks
>
> --
>
>  A N K ! T..

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


[android-developers] Re: Screen Rotation

2010-12-31 Thread Sarwar Erfan
http://stackoverflow.com/questions/2730855/prevent-screen-rotation-android

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

[android-developers] Re: Screen Rotation

2010-12-31 Thread Robert
Yes, I agree and even said in my original post that I was working to
understand how to make that work correctly.  Still would be interested
to know why the manifest entry doesn't seem to be working as
documented.

On Dec 31, 12:55 pm, TreKing  wrote:
> On Fri, Dec 31, 2010 at 11:48 AM, Robert  wrote:
> > The reason I want to do this is that the app is accessing a webserver via
> > an AsyncTask and I'd like to stop the restart until I can figure out how to
> > link the background task to the new pid that is created. I've read some
> > pages on it but not yet clear how to do that.
>
> Quoting the docs for that property:
>
> *Note:* Using this attribute should be avoided and used only as a
> last-resort. Please read Handling Runtime
> Changes
> for
> more information about how to properly handle a restart due to a
> configuration change.
>
> I highly recommend you spend the time figuring out how to do this correctly
> then wasting time on a hack that will cause other problems.
>
> --- 
> --
> TreKing  - Chicago
> transit tracking app for Android-powered devices

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


[android-developers] Re: Screen Rotation

2011-01-02 Thread Prateek Jain
I am not sure, if you just want to stop your app to change orientation
on rotating. But if thats the case, along with the line you mentioned

android:configChanges="orientation|keyboardHidden" which tells the
system that app will be handling the orientation change, you need to
add the following line to in manifest.xml

android:screenOrientation="portrait"

or landscape, depending upon your choice.

Hope it helps !!

Cheers,
Prateek


On Jan 1, 1:21 am, Robert  wrote:
> Yes, I agree and even said in my original post that I was working to
> understand how to make that work correctly.  Still would be interested
> to know why the manifest entry doesn't seem to be working as
> documented.
>
> On Dec 31, 12:55 pm, TreKing  wrote:
>
>
>
>
>
>
>
> > On Fri, Dec 31, 2010 at 11:48 AM, Robert  wrote:
> > > The reason I want to do this is that the app is accessing a webserver via
> > > an AsyncTask and I'd like to stop the restart until I can figure out how 
> > > to
> > > link the background task to the new pid that is created. I've read some
> > > pages on it but not yet clear how to do that.
>
> > Quoting the docs for that property:
>
> > *Note:* Using this attribute should be avoided and used only as a
> > last-resort. Please read Handling Runtime
> > Changes
> > for
> > more information about how to properly handle a restart due to a
> > configuration change.
>
> > I highly recommend you spend the time figuring out how to do this correctly
> > then wasting time on a hack that will cause other problems.
>
> > --- 
> > --
> > TreKing  - Chicago
> > transit tracking app for Android-powered devices

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


[android-developers] Re: Screen Rotation

2011-01-03 Thread kernelpanic
if what you posted in the original msg is a cut/paste, then the
problem is likely a typo - the ">" right before your
android:configChanges line should be moved to AFTER


  android:configChanges="orientation|keyboardHidden"


On Dec 31 2010, 2:21 pm, Robert  wrote:
> Yes, I agree and even said in my original post that I was working to
> understand how to make that work correctly.  Still would be interested
> to know why the manifest entry doesn't seem to be working as
> documented.

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


[android-developers] Re: Screen refreshing

2011-05-11 Thread Nicholas Johnson

>
> If fact, I do want the UI to be locked while 
> the proccess is working
>

Are you sure you want the main thread blocked? This could cause the 
"Application Not Responding" error to pop up during your lengthy process. 
And users tend to get very confused when their phones become unresponsive.

On other platforms, 
> there is some kind of DoEvents() or DoPendingEvents() functions which 
> allow UI threads to proccess pending messages before continuing with 
> the execution. 
>
> There is some way of doing this in Android?


Not that I'm aware of. But you should really consider putting your "lengthy 
process" in its own thread. An AsyncTask seems like it'd work well for you 
here. You can even update your text view in the onPreExecute method, and 
then notify the user of completion in the onPostExecute method.

Nick

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

[android-developers] Re: Screen Orientation Change

2009-10-08 Thread RichardC

Have a look at Activity.onConfigurationChanged and
Activity.getChangingConfigurations

You will need to make changes to your manifest to use
onConfigurationChanged

--
RichardC

On Oct 8, 6:03 pm, Neilz  wrote:
> Hi all. I notice when using the emulator that when the screen is
> flipped, I get a following logcat message:
>
> INFO/WindowManager(589): onOrientationChanged, rotation changed to 1
>
> How can I catch this in the code? I want to know whenever the
> orientation changes. I assume I have to set a listener, but I can't
> find an example anywhere.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] Re: Screen Orientation Change

2009-10-08 Thread Neilz

Richard that's great, thanks. I'm almost there. One further
question...

How can I check what the orientation of the screen is when the
Activity loads?

On Oct 8, 6:27 pm, RichardC  wrote:
> Have a look at Activity.onConfigurationChanged and
> Activity.getChangingConfigurations
>
> You will need to make changes to your manifest to use
> onConfigurationChanged
>
> --
> RichardC
>
> On Oct 8, 6:03 pm, Neilz  wrote:
>
> > Hi all. I notice when using the emulator that when the screen is
> > flipped, I get a following logcat message:
>
> > INFO/WindowManager(589): onOrientationChanged, rotation changed to 1
>
> > How can I catch this in the code? I want to know whenever the
> > orientation changes. I assume I have to set a listener, but I can't
> > find an example anywhere.
>
>
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] Re: Screen Orientation Change

2009-10-09 Thread Neilz

This must be simple, right?

On Oct 8, 11:34 pm, Neilz  wrote:
> Richard that's great, thanks. I'm almost there. One further
> question...
>
> How can I check what the orientation of the screen is when the
> Activity loads?
>
> On Oct 8, 6:27 pm, RichardC  wrote:
>
> > Have a look at Activity.onConfigurationChanged and
> > Activity.getChangingConfigurations
>
> > You will need to make changes to your manifest to use
> > onConfigurationChanged
>
> > --
> > RichardC
>
> > On Oct 8, 6:03 pm, Neilz  wrote:
>
> > > Hi all. I notice when using the emulator that when the screen is
> > > flipped, I get a following logcat message:
>
> > > INFO/WindowManager(589): onOrientationChanged, rotation changed to 1
>
> > > How can I catch this in the code? I want to know whenever the
> > > orientation changes. I assume I have to set a listener, but I can't
> > > find an example anywhere.
>
>
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] Re: Screen Orientation Change

2009-10-09 Thread Mark Murphy

Neilz wrote:
> This must be simple, right?
> 
> On Oct 8, 11:34 pm, Neilz  wrote:
>> Richard that's great, thanks. I'm almost there. One further
>> question...
>>
>> How can I check what the orientation of the screen is when the
>> Activity loads?

Try getResources().getConfiguration().

-- 
Mark Murphy (a Commons Guy)
http://commonsware.com | http://twitter.com/commonsguy

Android App Developer Books: http://commonsware.com/books.html

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



[android-developers] Re: Screen Orientation Change

2009-10-10 Thread Neilz

Great, thanks!

On Oct 10, 12:22 am, Mark Murphy  wrote:
> Neilz wrote:
> > This must be simple, right?
>
> > On Oct 8, 11:34 pm, Neilz  wrote:
> >> Richard that's great, thanks. I'm almost there. One further
> >> question...
>
> >> How can I check what the orientation of the screen is when the
> >> Activity loads?
>
> Try getResources().getConfiguration().
>
> --
> Mark Murphy (a Commons 
> Guy)http://commonsware.com|http://twitter.com/commonsguy
>
> Android App Developer Books:http://commonsware.com/books.html
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] Re: screen size compatibility

2009-12-17 Thread admin.androidsl...@googlemail.com
You can use an emulator and set it to Droid WVGA resolution.

If you are just testing screen sizes this should be fine.

If you need to test other functionality of the device, e.g. camera,
gps, integration between apps, etc. you will be better off with the
device itself.

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


[android-developers] Re: Screen orientation woes

2008-11-27 Thread Mark Murphy

> On a side note, I read here[1] that I can set the orientation to
> "sensor", which will report screen orientation changes as the device's
> physical orientation changes. Does this really work on a real device
> (I still don't have one) or that's reserved for a future release?

Yes, it works.

http://androidguys.com/?p=2914

> I'm
> asking because from what I read in some G1 reviews, the device's
> screen orientation changes to landscape only when the user slides the
> keyboard open.

That's true, in that the default for screenOrientation goes by the
keyboard. But, if you use "sensor" instead, it will rotate based on
movement alone.

--
Mark Murphy (a Commons Guy)
http://commonsware.com
_The Busy Coder's Guide to Android Development_ Version 1.4 Published!



--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
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
-~--~~~~--~~--~--~---



[android-developers] Re: Screen orientation woes

2008-11-27 Thread Stoyan Damov

Aha, that's very good to know, thanks Mark! :)

On Thu, Nov 27, 2008 at 9:42 PM, Mark Murphy <[EMAIL PROTECTED]> wrote:
>
>> On a side note, I read here[1] that I can set the orientation to
>> "sensor", which will report screen orientation changes as the device's
>> physical orientation changes. Does this really work on a real device
>> (I still don't have one) or that's reserved for a future release?
>
> Yes, it works.
>
> http://androidguys.com/?p=2914
>
>> I'm
>> asking because from what I read in some G1 reviews, the device's
>> screen orientation changes to landscape only when the user slides the
>> keyboard open.
>
> That's true, in that the default for screenOrientation goes by the
> keyboard. But, if you use "sensor" instead, it will rotate based on
> movement alone.
>
> --
> Mark Murphy (a Commons Guy)
> http://commonsware.com
> _The Busy Coder's Guide to Android Development_ Version 1.4 Published!
>
>
>
> >
>

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
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
-~--~~~~--~~--~--~---



[android-developers] Re: Screen orientation woes

2008-11-27 Thread Ralf

On Thu, Nov 27, 2008 at 11:39 AM, Stoyan Damov <[EMAIL PROTECTED]> wrote:
>
> Hi all,
>
> For my app the landscape orientation is useless, so I set my
> activity's "Screen orientation" attribute to "portrait". Even when the
> screen orientation changes to landscape, whatever I draw is simply
> drawn flipped 90 degrees, which is what I want.
>
> I also don't want my activity to get restarted when the screen
> orientation changes, so I set the "Config changes" attribute to
> "mcc|mnc|locale|touchscreen|keyboard||fontScale"
> and handle onConfigurationChanged myself. That's great too.

You only need to check for keyboardHidden|orientation.


> Now, the thing is, that when onConfigurationChanged gets called, the
> orientation is always reported as portrait, while I really want to
> know that the user has changed it to landscape, so I can put a message
> saying something like "landscape orientation is not supported".
>
> Is there a way to do that? Is there a way in which I can query the
> device for it's physical orientation?

Try using android.view.OrientationListener.

R/

>
> On a side note, I read here[1] that I can set the orientation to
> "sensor", which will report screen orientation changes as the device's
> physical orientation changes. Does this really work on a real device
> (I still don't have one) or that's reserved for a future release? I'm
> asking because from what I read in some G1 reviews, the device's
> screen orientation changes to landscape only when the user slides the
> keyboard open.
>
> FWIW I'm using SDK 1.0 r1.
>
> Thanks,
> Stoyan
>
> [1] 
> http://code.google.com/android/reference/android/R.styleable.html#AndroidManifestActivity_screenOrientation
>
> >
>

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
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
-~--~~~~--~~--~--~---



[android-developers] Re: Screen orientation woes

2008-11-27 Thread Stoyan Damov

On Fri, Nov 28, 2008 at 1:23 AM, Ralf <[EMAIL PROTECTED]> wrote:
> On Thu, Nov 27, 2008 at 11:39 AM, Stoyan Damov <[EMAIL PROTECTED]> wrote:
>> I also don't want my activity to get restarted when the screen
>> orientation changes, so I set the "Config changes" attribute to
>> "mcc|mnc|locale|touchscreen|keyboard||fontScale"
>> and handle onConfigurationChanged myself. That's great too.
>
> You only need to check for keyboardHidden|orientation.
>

I don't want my app restarted when any of these settings change - e.g.
I don't care if user switched locale, MCC, MNC, etc.

>
>> Now, the thing is, that when onConfigurationChanged gets called, the
>> orientation is always reported as portrait, while I really want to
>> know that the user has changed it to landscape, so I can put a message
>> saying something like "landscape orientation is not supported".
>>
>> Is there a way to do that? Is there a way in which I can query the
>> device for it's physical orientation?
>
> Try using android.view.OrientationListener.
>

Thanks, I'll take a look!

Cheers

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
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
-~--~~~~--~~--~--~---



[android-developers] Re: Screen orientation woes

2008-11-27 Thread Ralf

On Thu, Nov 27, 2008 at 3:29 PM, Stoyan Damov <[EMAIL PROTECTED]> wrote:
>
> On Fri, Nov 28, 2008 at 1:23 AM, Ralf <[EMAIL PROTECTED]> wrote:
>> On Thu, Nov 27, 2008 at 11:39 AM, Stoyan Damov <[EMAIL PROTECTED]> wrote:
>>> I also don't want my activity to get restarted when the screen
>>> orientation changes, so I set the "Config changes" attribute to
>>> "mcc|mnc|locale|touchscreen|keyboard||fontScale"
>>> and handle onConfigurationChanged myself. That's great too.
>>
>> You only need to check for keyboardHidden|orientation.
>>
>
> I don't want my app restarted when any of these settings change - e.g.
> I don't care if user switched locale, MCC, MNC, etc.

It's unlikely a user can change the locale whilst your app is running
in foreground.

R/


>>
>>> Now, the thing is, that when onConfigurationChanged gets called, the
>>> orientation is always reported as portrait, while I really want to
>>> know that the user has changed it to landscape, so I can put a message
>>> saying something like "landscape orientation is not supported".
>>>
>>> Is there a way to do that? Is there a way in which I can query the
>>> device for it's physical orientation?
>>
>> Try using android.view.OrientationListener.
>>
>
> Thanks, I'll take a look!
>
> Cheers
>
> >
>

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
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
-~--~~~~--~~--~--~---



[android-developers] Re: screen orientation question

2008-11-29 Thread Mark Murphy

joshbeck wrote:
> Hello all,
> I am trying to determine exactly what happens when the screen
> orientation changes.
> (What I mean is, what happens to the lifecycle of an app when the user
> slides the screen out.)
> 
> Reason:
>  I show a dialog in my app.
>  If the user slides the screen out, the app crashes with
> 'View not attached to window manager error.'
> 
> Is onPause called or something else?

By default, the activity is destroyed (onPause() through onDestroy()) 
and then restarted.

I have a five-part blog series on this topic over at AndroidGuys:

http://androidguys.com/?s=rotational+forces&x=0&y=0

-- 
Mark Murphy (a Commons Guy)
http://commonsware.com

Android Training on the Ranch! -- Mar 16-20, 2009
http://www.bignerdranch.com/schedule.shtml

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
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
-~--~~~~--~~--~--~---



[android-developers] Re: Screen orientation woes

2008-11-29 Thread Dianne Hackborn
On Thu, Nov 27, 2008 at 3:29 PM, Stoyan Damov <[EMAIL PROTECTED]>wrote:

> On Fri, Nov 28, 2008 at 1:23 AM, Ralf <[EMAIL PROTECTED]> wrote:
> > On Thu, Nov 27, 2008 at 11:39 AM, Stoyan Damov <[EMAIL PROTECTED]>
> wrote:
> >> I also don't want my activity to get restarted when the screen
> >> orientation changes, so I set the "Config changes" attribute to
> >> "mcc|mnc|locale|touchscreen|keyboard||fontScale"
> >> and handle onConfigurationChanged myself. That's great too.
> > You only need to check for keyboardHidden|orientation.
> I don't want my app restarted when any of these settings change - e.g.
> I don't care if user switched locale, MCC, MNC, etc.


Please don't do this.  If, when your app is restarted due to these changes,
it to breaks, then it will also break when the user moves to another app and
then returns to yours and it needs to be restarted.  There is simply no
reason to do this kind of thing except to hide bugs in your app, which users
will eventually encounter.

As far as finding out if the user tried to put your app in an orientation it
is not allowing...  no, there is no way to do this, because you are forcing
a particular orientation, so actually the orientation didn't change at all.

And actually, I'd have to wonder, if you are forcing the orientation one
way, does it really make sense to show a different UI if the orientation
might have changed?  I mean, if you are forcing portrait, and the user opens
the G1 keyboard, and...  well, the screen stays portrait.  Your app still
works.  Why tell them they can't use it when they happen to have the
keyboard open?  Likewise if on some device the orientation is controlled by
the accelerometer, why tell them they can't use your app if they happen to
have the screen angled a certain way?

-- 
Dianne Hackborn
Android framework engineer
[EMAIL PROTECTED]

Note: please don't send private questions to me, as I don't have time to
provide private support.  All such questions should be posted on public
forums, where I and others can see and answer them.

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
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
-~--~~~~--~~--~--~---



[android-developers] Re: screen pixel size

2010-04-13 Thread krox
Hi,
The following code would provide that for you

WindowManager wm =
(WindowManager)getSystemService(Context.WINDOW_SERVICE);
Display dsp = wm.getDefaultDisplay();


On Apr 13, 12:05 am, Bob  wrote:
> Hi,
> I need to know how many pixels wide and tall the screen is.  I know
> that there are a bunch of different localization folders that I could
> make for different views but I just need to know, programmatically,
> how many pixels are on the screen so I can do some drawing.  How can I
> detect this?
>
> Thanks,
> Bob

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

To unsubscribe, reply using "remove me" as the subject.


[android-developers] Re: screen pixel size

2010-04-13 Thread krox
Hi (again)
I accidentally clicked send while writing my reply so here comes the
proper one :-)
The following code will provide you with the size of the screen (in
pixels)

WindowManager wm =
(WindowManager)getSystemService(Context.WINDOW_SERVICE);
Display dsp = wm.getDefaultDisplay();
int height = dsp.getHeight();
int width = dsp.getWidth();

Hope this helps!

Kind regards,
Erik


On Apr 13, 12:05 am, Bob  wrote:
> Hi,
> I need to know how many pixels wide and tall the screen is.  I know
> that there are a bunch of different localization folders that I could
> make for different views but I just need to know, programmatically,
> how many pixels are on the screen so I can do some drawing.  How can I
> detect this?
>
> Thanks,
> Bob

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

To unsubscribe, reply using "remove me" as the subject.


Re: [android-developers] Re: Screen Rotation

2010-07-20 Thread TreKing
On Sat, Jul 17, 2010 at 9:40 AM, nation-x  wrote:

> there is an example of one way to save an array object to a file and to
> read it back in.
>

Note that the OP's problem was trying to retain data on screen rotation, not
persist across application restarts.

In general, saving data to a file and reading it back in for a configuration
change is not the ideal solution as it takes longer than necessary to reload
the data compared to using the Activity Lifecycle methods.

-
TreKing  - Chicago
transit tracking app for Android-powered devices

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

[android-developers] Re: screen brightness change

2010-12-13 Thread Gulfam
I think this kind of broadcast are not availbele.

Gulfam

On Dec 14, 11:04 am, "Hendrik Greving"  wrote:
> Hi is there some broadcast or listener for screen brightness changes?

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


[android-developers] Re: screen brightness change

2010-12-14 Thread Jake Basile
As an aside, to find what broadcast intents are available, you can check in 
a few places:

   - In your platform folder for the version of Android you are targeting, 
   look for the broadcast_actions.txt file. This contains the string action 
   for any intent that the system can broadcast.
   - You can also check the documentation for 
Intent, 
   which has many (I don't know if it has all) of the actions listed as 
   constants. These also may have documentation about the intent broadcast that 
   you would need to use it.
   

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

[android-developers] Re: screen referesh dealy

2010-10-19 Thread Tudor Tihan
Thanks guys, this is what I needed.
I will target it for 2.0 then, maybe, if the game seems successful,
make a fixed pipeline version.

On Oct 19, 2:37 pm, Mark Murphy  wrote:
> Your activity may be taking too long to draw. Use Traceview to
> determine where your performance problem lies:
>
> http://developer.android.com/guide/developing/tools/traceview.html
>
>
>
>
>
> On Tue, Oct 19, 2010 at 1:28 AM, Shakeel  
> wrote:
> > Dear all,
>
> > I am facing problem with delay in display when I tilt the device.
>
> > Screen takes few seconds to adjust to portrait or landscape when device is
> > tilted.
>
> > Thanks
> > shakeel
>
> > --
> > You received this message because you are subscribed to the Google
> > Groups "Android Developers" group.
> > To post to this group, send email to android-developers@googlegroups.com
> > To unsubscribe from this group, send email to
> > android-developers+unsubscr...@googlegroups.com
> > For more options, visit this group at
> >http://groups.google.com/group/android-developers?hl=en
>
> --
> Mark Murphy (a Commons 
> Guy)http://commonsware.com|http://github.com/commonsguyhttp://commonsware.com/blog|http://twitter.com/commonsguy
>
> Android App Developer Books:http://commonsware.com/books

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


Re: [android-developers] Re: Screen refreshing

2011-05-12 Thread Justin Anderson
The way I do this on Android is display a dialog on the main thread (which
essentially locks out the UI to the user while not blocking the actual
thread) and then do all the heavy work in another thread.

As Nick mentioned, AsyncTask is a great way to do this...

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


On Wed, May 11, 2011 at 7:23 PM, Nicholas Johnson
wrote:

> If fact, I do want the UI to be locked while
>> the proccess is working
>>
>
> Are you sure you want the main thread blocked? This could cause the
> "Application Not Responding" error to pop up during your lengthy process.
> And users tend to get very confused when their phones become unresponsive.
>
> On other platforms,
>> there is some kind of DoEvents() or DoPendingEvents() functions which
>> allow UI threads to proccess pending messages before continuing with
>> the execution.
>>
>> There is some way of doing this in Android?
>
>
> Not that I'm aware of. But you should really consider putting your "lengthy
> process" in its own thread. An AsyncTask seems like it'd work well for you
> here. You can even update your text view in the onPreExecute method, and
> then notify the user of completion in the onPostExecute method.
>
> Nick
>
> --
> You received this message because you are subscribed to the Google
> Groups "Android Developers" group.
> To post to this group, send email to android-developers@googlegroups.com
> To unsubscribe from this group, send email to
> android-developers+unsubscr...@googlegroups.com
> 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 android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

[android-developers] Re: screen flickering in GLSurfaceView

2010-03-18 Thread Mario Zechner
The problem is that there's actually to targets you render to, the
back and the frontbuffer of the OpenGL surface. In each call to
Renderer.onDrawFrame()  you actually render to the back buffer while
the front buffer is presented on screen. Once you leave the
onDrawFrame method the back buffer becomes the new front buffer and is
presented on screen, while the former front buffer becomes the new
back buffer. This is called double buffering and is actually used to
reduce another form of flickering which is related to screen refresh
rates.

What happens in your case is the following (as far as i can tell). In
the first onDrawFrame() call you render some elements to the initially
black back buffer. The front buffer is also black. Now you leave
onDrawFrame() and the back buffer gets presented while the front
buffer becomes your new back buffer. But the new back buffer does not
contain the elements you just rendered! So you render your new
elements to a completely black back buffer this time so the final
image is not a composition of the first onDrawFrame and the second
one. As the buffers are constantly swaped they never have the same
content as half of the elements is in one buffer and the others are in
the other buffer.

There might be a way to disable double buffering in the GLSurfaceView
if you use that. Otherwise you will need to use EGL directly to setup
your OpenGL surface without double buffering. On the other hand i
wonder why you don't compose your complete scene in a single
onDrawFrame call.

On 18 Mrz., 13:44, ac  wrote:
> Hello,
>
> I'm using GLSurfaceView to create a simple OpenGL drawing application.
> Since the elements drawn in each frame must remain on screen in order
> to be composed into the whole drawing, I don't use
> gl.glClear(GL10.GL_COLOR_BUFFER_BIT) at the beginning of each frame.
> But not clearing the color buffer leads to substantial flickering.
>
> Is there any way to eliminate flickering while still not clearing the
> screen at the beginning of each frame?
>
> Thanks a lot,
> ac

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


[android-developers] Re: screen flickering in GLSurfaceView

2010-03-18 Thread Mario Zechner
oh, i tried that once with OpenGL ES. I didn't use the backbuffer but
drew directly to a texture using an intermediate Bitmap as the drawing
surface and reuploading only those parts of the texture that changed.
You can find a video and an apk of that at
http://apistudios.com/hosted/marzec/badlogic/wordpress/?cat=10. The
problem is that if you update to much of the texture at once you get
100ms interruptions which might be visible to the user.

On 18 Mrz., 14:46, Andres Colubri  wrote:
> > What happens in your case is the following (as far as i can tell). In
> > the first onDrawFrame() call you render some elements to the initially
> > black back buffer. The front buffer is also black. Now you leave
> > onDrawFrame() and the back buffer gets presented while the front
> > buffer becomes your new back buffer. But the new back buffer does not
> > contain the elements you just rendered! So you render your new
> > elements to a completely black back buffer this time so the final
> > image is not a composition of the first onDrawFrame and the second
> > one. As the buffers are constantly swaped they never have the same
> > content as half of the elements is in one buffer and the others are in
> > the other buffer.
>
> Thanks for the explanation, this makes the source of the problem
> perfectly clear.
>
> > There might be a way to disable double buffering in the GLSurfaceView
> > if you use that.
>
> That would be nice, I wonder if it is possible to do at all... After a
> quick look at the source code of GLSurfaceView, it seems to me that the
> double buffering is hard coded into the EglHelper class.
>
> > Otherwise you will need to use EGL directly to setup
> > your OpenGL surface without double buffering.
>
> I'd like to avoid this, since it basically means implementing my own
> GLSurfaceView...
>
> > On the other hand i wonder why you don't compose your complete scene in a 
> > single
> > onDrawFrame call.
>
> Because the goal is to have an interactive drawing application
> controlled by the user input (brushes strokes, etc).

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


[android-developers] Re: Screen width and height

2009-08-16 Thread Dianne Hackborn
It is strongly recommended that you not do anything based on the raw screen
dimensions, but use layout managers to adjust for the screen size.  You can
easily write your own layout manager (deriving from VIewGroup) to have your
code run every time it gets a new size.

On Sun, Aug 16, 2009 at 8:57 PM, Aanderson144 wrote:

>
> I am trying to make my display routine reactive to the size of the
> screen in pixels my question is does android.view.Display.getHeight()
> return the displays total size or will it return different values in
> fullscreen and normal views?
>
> >
>


-- 
Dianne Hackborn
Android framework engineer
hack...@android.com

Note: please don't send private questions to me, as I don't have time to
provide private support, and so won't reply to such e-mails.  All such
questions should be posted on public forums, where I and others can see and
answer them.

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



[android-developers] Re: Screen width and height

2009-08-17 Thread Aanderson144

then my final question would be what is the best way to return the
drawable screen in pixels even if it's in fullscreen mode my app needs
to be aware of it's drawable space for zooming in and out of a 800 x
600 bitmap that changes content but stays the same size?

thanks

On Aug 17, 1:23 am, Dianne Hackborn  wrote:
> It is strongly recommended that you not do anything based on the raw screen
> dimensions, but use layout managers to adjust for the screen size.  You can
> easily write your own layout manager (deriving from VIewGroup) to have your
> code run every time it gets a new size.
>
> On Sun, Aug 16, 2009 at 8:57 PM, Aanderson144 wrote:
>
>
>
> > I am trying to make my display routine reactive to the size of the
> > screen in pixels my question is does android.view.Display.getHeight()
> > return the displays total size or will it return different values in
> > fullscreen and normal views?
>
> --
> Dianne Hackborn
> Android framework engineer
> hack...@android.com
>
> Note: please don't send private questions to me, as I don't have time to
> provide private support, and so won't reply to such e-mails.  All such
> questions should be posted on public forums, where I and others can see and
> answer them.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers-unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] Re: Screen width and height

2009-08-17 Thread Aanderson144

this activity has a single ImageView and no buttons or other view
items

On Aug 17, 3:02 am, Aanderson144  wrote:
> then my final question would be what is the best way to return the
> drawable screen in pixels even if it's in fullscreen mode my app needs
> to be aware of it's drawable space for zooming in and out of a 800 x
> 600 bitmap that changes content but stays the same size?
>
> thanks
>
> On Aug 17, 1:23 am, Dianne Hackborn  wrote:
>
> > It is strongly recommended that you not do anything based on the raw screen
> > dimensions, but use layout managers to adjust for the screen size.  You can
> > easily write your own layout manager (deriving from VIewGroup) to have your
> > code run every time it gets a new size.
>
> > On Sun, Aug 16, 2009 at 8:57 PM, Aanderson144 wrote:
>
> > > I am trying to make my display routine reactive to the size of the
> > > screen in pixels my question is does android.view.Display.getHeight()
> > > return the displays total size or will it return different values in
> > > fullscreen and normal views?
>
> > --
> > Dianne Hackborn
> > Android framework engineer
> > hack...@android.com
>
> > Note: please don't send private questions to me, as I don't have time to
> > provide private support, and so won't reply to such e-mails.  All such
> > questions should be posted on public forums, where I and others can see and
> > answer them.
>
>
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers-unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] Re: Screen width and height

2009-08-17 Thread Dianne Hackborn
Like I said, set up your UI so you have your own custom view placed where
you want, and the size of the view is the size you are about.  You can find
out about the size changing with View.onSizeChanged().  (And if this is just
a leaf view, not one that is going to position child views, you can just
derive from View.)

On Mon, Aug 17, 2009 at 12:02 AM, Aanderson144 wrote:

>
> then my final question would be what is the best way to return the
> drawable screen in pixels even if it's in fullscreen mode my app needs
> to be aware of it's drawable space for zooming in and out of a 800 x
> 600 bitmap that changes content but stays the same size?
>
> thanks
>
> On Aug 17, 1:23 am, Dianne Hackborn  wrote:
> > It is strongly recommended that you not do anything based on the raw
> screen
> > dimensions, but use layout managers to adjust for the screen size.  You
> can
> > easily write your own layout manager (deriving from VIewGroup) to have
> your
> > code run every time it gets a new size.
> >
> > On Sun, Aug 16, 2009 at 8:57 PM, Aanderson144  >wrote:
> >
> >
> >
> > > I am trying to make my display routine reactive to the size of the
> > > screen in pixels my question is does android.view.Display.getHeight()
> > > return the displays total size or will it return different values in
> > > fullscreen and normal views?
> >
> > --
> > Dianne Hackborn
> > Android framework engineer
> > hack...@android.com
> >
> > Note: please don't send private questions to me, as I don't have time to
> > provide private support, and so won't reply to such e-mails.  All such
> > questions should be posted on public forums, where I and others can see
> and
> > answer them.
> >
>


-- 
Dianne Hackborn
Android framework engineer
hack...@android.com

Note: please don't send private questions to me, as I don't have time to
provide private support, and so won't reply to such e-mails.  All such
questions should be posted on public forums, where I and others can see and
answer them.

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



[android-developers] Re: Screen width and height

2009-08-17 Thread Aanderson144

thank you so much that last post just answered all my questions

On Aug 17, 12:45 pm, Dianne Hackborn  wrote:
> Like I said, set up your UI so you have your own custom view placed where
> you want, and the size of the view is the size you are about.  You can find
> out about the size changing with View.onSizeChanged().  (And if this is just
> a leaf view, not one that is going to position child views, you can just
> derive from View.)
>
> On Mon, Aug 17, 2009 at 12:02 AM, Aanderson144 wrote:
>
>
>
>
>
> > then my final question would be what is the best way to return the
> > drawable screen in pixels even if it's in fullscreen mode my app needs
> > to be aware of it's drawable space for zooming in and out of a 800 x
> > 600 bitmap that changes content but stays the same size?
>
> > thanks
>
> > On Aug 17, 1:23 am, Dianne Hackborn  wrote:
> > > It is strongly recommended that you not do anything based on the raw
> > screen
> > > dimensions, but use layout managers to adjust for the screen size.  You
> > can
> > > easily write your own layout manager (deriving from VIewGroup) to have
> > your
> > > code run every time it gets a new size.
>
> > > On Sun, Aug 16, 2009 at 8:57 PM, Aanderson144  > >wrote:
>
> > > > I am trying to make my display routine reactive to the size of the
> > > > screen in pixels my question is does android.view.Display.getHeight()
> > > > return the displays total size or will it return different values in
> > > > fullscreen and normal views?
>
> > > --
> > > Dianne Hackborn
> > > Android framework engineer
> > > hack...@android.com
>
> > > Note: please don't send private questions to me, as I don't have time to
> > > provide private support, and so won't reply to such e-mails.  All such
> > > questions should be posted on public forums, where I and others can see
> > and
> > > answer them.
>
> --
> Dianne Hackborn
> Android framework engineer
> hack...@android.com
>
> Note: please don't send private questions to me, as I don't have time to
> provide private support, and so won't reply to such e-mails.  All such
> questions should be posted on public forums, where I and others can see and
> answer them.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers-unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] Re: screen size of emulator?

2009-09-09 Thread Dianne Hackborn
You generally don't, your views get told the size they should be as part of
the view hierarchy layout.  Directly getting the size of the display is not
recommended, because it may have no relation to the actual space your UI has
available (such as if there are other screen decorations around, like a task
switcher or who knows what).

On Wed, Sep 9, 2009 at 8:03 PM, mmkr  wrote:

>
> Hai,
>
> How can i get the screen size of my emulator?
> i used
>
> Display display = ((WindowManager) getSystemService
> (Context.WINDOW_SERVICE)).getDefaultDisplay();
>int width = display.getWidth();
>Log.i("width",""+width);
>
> But it gives me different values each time. How to find the exact
> value?
> >
>


-- 
Dianne Hackborn
Android framework engineer
hack...@android.com

Note: please don't send private questions to me, as I don't have time to
provide private support, and so won't reply to such e-mails.  All such
questions should be posted on public forums, where I and others can see and
answer them.

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



[android-developers] Re: Screen rotation and ProgressDialog

2012-08-27 Thread Sheharyar Naseer
I'm still unable to do it. I'm fairly new to Android Dev. Could you please 
write me a snippet on how to do this in AsyncTasks. Thankyou for your help.

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

[android-developers] Re: Screen rotation clears TextView

2011-10-07 Thread King Salamon
sorry if this is redundant--I've been trying to post a reply to this 
thread---Can anyone please supply a full coding example for resolving this 
issue. I want users to be able to rotate the device and not loose the the 
data that is displayed in the textView.

Example:
Gold score card app that records strokes for each hole. score is displayed 
in textView like this:
hole#:  4
hole#: 5
hole#: 6


when the device is rotated, this info disappears. Help!

Thanks

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

[android-developers] Re: Screen Shot Capture Timing!!!

2011-08-08 Thread Sebastian Tomaszewski
Bring this to the TOP again... See if someone has the potential answers...
Thank you ahead of time


Sebo

On Thu, Aug 4, 2011 at 4:01 PM, Sebastian Tomaszewski <
stomasze101...@gmail.com> wrote:

> Hello All,
> I have a little dilema with the Timing on one of my Screen Capture
> applications:
>
> 1. Currenlty I am using the following code in oroder to capture the SCREEN
> SHOT of the device:
> "
> v1 = linView.getRootView();
> v1.setDrawingCacheEnabled(*true*);
> bmp = v1.getDrawingCache();
>  "
> Which gives the following timing when I try to capture every second:
>TIME Time to Get Data 1  111MS  2  28MS  3  1MS  4  1MS  5  4MS  6  1MS
>   7  1MS  8  1MS  RESTARTED WHILE APP RUNNING- 9  2MS  10  31MS
> 11  3MS  12  1MS  13  1MS  RESTARTED WHILE APP RUNNING- 14  1MS
> 15  28MS  16  2MS  17  1MS  18  1MS
>
> As you can see that the very 1st time it takes forever, comparing to the
> other times.  Also, always at the second capture it takes more as well.
> Would anyone know why?  Is there some way that I coudl improve this?
>
> 2. The above code is a lot better from the timing perspective then the
> following code:
>
> bmp = Bitmap.*createBitmap*(width , height, Bitmap.Config.*ARGB_*);
>
> canvas = *new* Canvas(bmp);
> 3. Finally could anyone tell me if there is another/better way to capture
> the Screen Shot of the device, which could improve my timing?
>
>
>
> Please let me know.
>
> Thank you and Best Regards,
>
>
>
> Sebo
>

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

[android-developers] Re: Screen Shot Capture Timing!!!

2011-08-08 Thread rich friedel
You would probably have better luck finding answers to this topic in the 
Android internals group. 
https://groups.google.com/forum/?hl=en#!forum/android-internals

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

Re: [android-developers] Re: screen brightness change

2010-12-14 Thread fourhend...@gmail.com
Is there any other event than
ACTION_SCREEN_ON
that
gets broadcasted for screen brightness changes? Or a listener object or
something alike?

On Tue, Dec 14, 2010 at 7:37 AM, Jake Basile  wrote:

> As an aside, to find what broadcast intents are available, you can check in
> a few places:
>
>- In your platform folder for the version of Android you are targeting,
>look for the broadcast_actions.txt file. This contains the string
>action for any intent that the system can broadcast.
>- You can also check the documentation for 
> Intent,
>which has many (I don't know if it has all) of the actions listed as
>constants. These also may have documentation about the intent broadcast 
> that
>you would need to use it.
>
>  --
> You received this message because you are subscribed to the Google
> Groups "Android Developers" group.
> To post to this group, send email to android-developers@googlegroups.com
> To unsubscribe from this group, send email to
> android-developers+unsubscr...@googlegroups.com
> 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 android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

Re: [android-developers] Re: screen brightness change

2010-12-14 Thread Dianne Hackborn
I don't know what broadcast_actions.txt is, but there is no one place that
lists all possible broadcasts.

On Tue, Dec 14, 2010 at 7:37 AM, Jake Basile  wrote:

> As an aside, to find what broadcast intents are available, you can check in
> a few places:
>
>- In your platform folder for the version of Android you are targeting,
>look for the broadcast_actions.txt file. This contains the string
>action for any intent that the system can broadcast.
>- You can also check the documentation for 
> Intent,
>which has many (I don't know if it has all) of the actions listed as
>constants. These also may have documentation about the intent broadcast 
> that
>you would need to use it.
>
>  --
> You received this message because you are subscribed to the Google
> Groups "Android Developers" group.
> To post to this group, send email to android-developers@googlegroups.com
> To unsubscribe from this group, send email to
> android-developers+unsubscr...@googlegroups.com
> For more options, visit this group at
> http://groups.google.com/group/android-developers?hl=en
>



-- 
Dianne Hackborn
Android framework engineer
hack...@android.com

Note: please don't send private questions to me, as I don't have time to
provide private support, and so won't reply to such e-mails.  All such
questions should be posted on public forums, where I and others can see and
answer them.

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

Re: [android-developers] Re: screen brightness change

2010-12-14 Thread Dianne Hackborn
On Tue, Dec 14, 2010 at 1:17 PM, fourhend...@gmail.com <
fourhend...@gmail.com> wrote:

> Is there any other event than 
> ACTION_SCREEN_ON
>  that
> gets broadcasted for screen brightness changes? Or a listener object or
> something alike?


There is no broadcast for screen brightness changes.

What are you trying to accomplish?

-- 
Dianne Hackborn
Android framework engineer
hack...@android.com

Note: please don't send private questions to me, as I don't have time to
provide private support, and so won't reply to such e-mails.  All such
questions should be posted on public forums, where I and others can see and
answer them.

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

Re: [android-developers] Re: screen brightness change

2010-12-14 Thread Jake Basile
On my system, it's at \platforms\android-9\data\broadcast_actions.txt. I don't know if it 
has them all, but it's been useful to me.

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

Re: [android-developers] Re: screen brightness change

2010-12-14 Thread fourhend...@gmail.com
Guys not disturbing your conversation :) but does anybody have the answer to
my question?
On Dec 14, 2010 4:30 PM, "Jake Basile"  wrote:
> On my system, it's at  install>\platforms\android-9\data\broadcast_actions.txt. I don't know if
it
> has them all, but it's been useful to me.
>
> --
> You received this message because you are subscribed to the Google
> Groups "Android Developers" group.
> To post to this group, send email to android-developers@googlegroups.com
> To unsubscribe from this group, send email to
> android-developers+unsubscr...@googlegroups.com
> 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 android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

Re: [android-developers] Re: screen brightness change

2010-12-14 Thread Dianne Hackborn
On Tue, Dec 14, 2010 at 5:10 PM, fourhend...@gmail.com <
fourhend...@gmail.com> wrote:

> Guys not disturbing your conversation :) but does anybody have the answer
> to my question?
>
There is nothing broadcast when the screen brightness changes?

What are you trying to do?

-- 
Dianne Hackborn
Android framework engineer
hack...@android.com

Note: please don't send private questions to me, as I don't have time to
provide private support, and so won't reply to such e-mails.  All such
questions should be posted on public forums, where I and others can see and
answer them.

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

Re: [android-developers] Re: screen brightness change

2010-12-14 Thread fourhend...@gmail.com
I am trying to catch the event when the screen brightness changes.
On Dec 14, 2010 6:35 PM, "Dianne Hackborn"  wrote:
> On Tue, Dec 14, 2010 at 5:10 PM, fourhend...@gmail.com <
> fourhend...@gmail.com> wrote:
>
>> Guys not disturbing your conversation :) but does anybody have the answer
>> to my question?
>>
> There is nothing broadcast when the screen brightness changes?
>
> What are you trying to do?
>
> --
> Dianne Hackborn
> Android framework engineer
> hack...@android.com
>
> Note: please don't send private questions to me, as I don't have time to
> provide private support, and so won't reply to such e-mails. All such
> questions should be posted on public forums, where I and others can see
and
> answer them.
>
> --
> You received this message because you are subscribed to the Google
> Groups "Android Developers" group.
> To post to this group, send email to android-developers@googlegroups.com
> To unsubscribe from this group, send email to
> android-developers+unsubscr...@googlegroups.com
> 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 android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

Re: [android-developers] Re: screen brightness change

2010-12-14 Thread Dianne Hackborn
On Tue, Dec 14, 2010 at 6:43 PM, fourhend...@gmail.com <
fourhend...@gmail.com> wrote:

> I am trying to catch the event when the screen brightness changes.
>

Yeah, I gathered that.  At a higher level, what are you trying to accomplish
from the user's perspective?

-- 
Dianne Hackborn
Android framework engineer
hack...@android.com

Note: please don't send private questions to me, as I don't have time to
provide private support, and so won't reply to such e-mails.  All such
questions should be posted on public forums, where I and others can see and
answer them.

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

Re: [android-developers] Re: screen brightness change

2010-12-14 Thread Hendrik Greving
I have a widget button that adjusts the brightness and it would be nice if the 
button could adjust its face if the brightness gets changed otherwise. I guess 
this is not possible then.
  - Original Message - 
  From: Dianne Hackborn 
  To: android-developers@googlegroups.com 
  Sent: Tuesday, December 14, 2010 6:46 PM
  Subject: Re: [android-developers] Re: screen brightness change


  On Tue, Dec 14, 2010 at 6:43 PM, fourhend...@gmail.com 
 wrote:

I am trying to catch the event when the screen brightness changes.



  Yeah, I gathered that.  At a higher level, what are you trying to accomplish 
from the user's perspective?


  -- 
  Dianne Hackborn
  Android framework engineer
  hack...@android.com

  Note: please don't send private questions to me, as I don't have time to 
provide private support, and so won't reply to such e-mails.  All such 
questions should be posted on public forums, where I and others can see and 
answer them.



  -- 
  You received this message because you are subscribed to the Google
  Groups "Android Developers" group.
  To post to this group, send email to android-developers@googlegroups.com
  To unsubscribe from this group, send email to
  android-developers+unsubscr...@googlegroups.com
  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 android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

[android-developers] Re: Screen Brightness on 2.2

2010-10-29 Thread burton miller
Come on Diane, Mark, Reto - help a fellow out with your words of
wisdom;)

On Oct 27, 4:55 pm, burton miller  wrote:
> Anybody have any idea why this is not working under 2.2?  (nexus one)
>
> WindowManager.LayoutParams lp = getWindow().getAttributes();
> lp.screenBrightness = 1.0f;
> getWindow().setAttributes(lp);
>
> And yes, the auto-brightness is disabled under settings.

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


[android-developers] Re: Screen Brightness on 2.2

2010-10-29 Thread burton miller
Come on Diane, Mark, Reto - help a fellow out with your words of
wisdom;)

On Oct 27, 4:55 pm, burton miller  wrote:
> Anybody have any idea why this is not working under 2.2?  (nexus one)
>
> WindowManager.LayoutParams lp = getWindow().getAttributes();
> lp.screenBrightness = 1.0f;
> getWindow().setAttributes(lp);
>
> And yes, the auto-brightness is disabled under settings.

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


[android-developers] Re: Screen Brightness on 2.2

2010-10-30 Thread burton miller
In PointerLocation, you are setting the window attributes in the
onCreate() call.

I am trying do this in the onResume() call.  Does that make a
difference?

In another case I am doing it in reponse to a seekBar setting in the
midst of an Activity.  It does not work there either.

On Oct 29, 6:15 pm, Dianne Hackborn  wrote:
> Works fine for me in PointerLocation.  *shrug*  Sorry, I don't know off-hand
> what is going on for you.
>
> On Fri, Oct 29, 2010 at 4:08 PM, burton miller wrote:
>
>
>
> > Come on Diane, Mark, Reto - help a fellow out with your words of
> > wisdom;)
>
> > On Oct 27, 4:55 pm, burton miller  wrote:
> > > Anybody have any idea why this is not working under 2.2?  (nexus one)
>
> > > WindowManager.LayoutParams lp = getWindow().getAttributes();
> > > lp.screenBrightness = 1.0f;
> > > getWindow().setAttributes(lp);
>
> > > And yes, the auto-brightness is disabled under settings.
>
> > --
> > You received this message because you are subscribed to the Google
> > Groups "Android Developers" group.
> > To post to this group, send email to android-developers@googlegroups.com
> > To unsubscribe from this group, send email to
> > android-developers+unsubscr...@googlegroups.com
> > For more options, visit this group at
> >http://groups.google.com/group/android-developers?hl=en
>
> --
> Dianne Hackborn
> Android framework engineer
> hack...@android.com
>
> Note: please don't send private questions to me, as I don't have time to
> provide private support, and so won't reply to such e-mails.  All such
> questions should be posted on public forums, where I and others can see and
> answer them.

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


[android-developers] Re: Screen Brightness on 2.2

2010-11-01 Thread burton miller
I tried that - and nothing.  I have a pretty heavy app here - with a
LOT of native code, and the screen in question is mostly a bitmap
rendered on the native side

So - I made  dopey test app (in 5 minutes) and you are right - the
code works fine in the normal case (in whatever function you call it
in).  Just not in my more complex application!

Thanks, anyway - and sorry for wasting your time.  I never post on
these groups until I've put in some real time on a problem.

On Oct 30, 12:13 pm, Dianne Hackborn  wrote:
> In theory shouldn't, but did you try moving it to your onCreate() and seeing
> if it worked?  It is possible there is a bug in the window manager causing
> it to not see a change after a window is first added.
>
> On Sat, Oct 30, 2010 at 11:41 AM, burton miller 
> wrote:
>
>
>
> > In PointerLocation, you are setting the window attributes in the
> > onCreate() call.
>
> > I am trying do this in the onResume() call.  Does that make a
> > difference?
>
> > In another case I am doing it in reponse to a seekBar setting in the
> > midst of an Activity.  It does not work there either.
>
> > On Oct 29, 6:15 pm, Dianne Hackborn  wrote:
> > > Works fine for me in PointerLocation.  *shrug*  Sorry, I don't know
> > off-hand
> > > what is going on for you.
>
> > > On Fri, Oct 29, 2010 at 4:08 PM, burton miller  > >wrote:
>
> > > > Come on Diane, Mark, Reto - help a fellow out with your words of
> > > > wisdom;)
>
> > > > On Oct 27, 4:55 pm, burton miller  wrote:
> > > > > Anybody have any idea why this is not working under 2.2?  (nexus one)
>
> > > > > WindowManager.LayoutParams lp = getWindow().getAttributes();
> > > > > lp.screenBrightness = 1.0f;
> > > > > getWindow().setAttributes(lp);
>
> > > > > And yes, the auto-brightness is disabled under settings.
>
> > > > --
> > > > You received this message because you are subscribed to the Google
> > > > Groups "Android Developers" group.
> > > > To post to this group, send email to
> > android-developers@googlegroups.com
> > > > To unsubscribe from this group, send email to
> > > > android-developers+unsubscr...@googlegroups.com
> > 
>
> > > > For more options, visit this group at
> > > >http://groups.google.com/group/android-developers?hl=en
>
> > > --
> > > Dianne Hackborn
> > > Android framework engineer
> > > hack...@android.com
>
> > > Note: please don't send private questions to me, as I don't have time to
> > > provide private support, and so won't reply to such e-mails.  All such
> > > questions should be posted on public forums, where I and others can see
> > and
> > > answer them.
>
> > --
> > You received this message because you are subscribed to the Google
> > Groups "Android Developers" group.
> > To post to this group, send email to android-developers@googlegroups.com
> > To unsubscribe from this group, send email to
> > android-developers+unsubscr...@googlegroups.com
> > For more options, visit this group at
> >http://groups.google.com/group/android-developers?hl=en
>
> --
> Dianne Hackborn
> Android framework engineer
> hack...@android.com
>
> Note: please don't send private questions to me, as I don't have time to
> provide private support, and so won't reply to such e-mails.  All such
> questions should be posted on public forums, where I and others can see and
> answer them.

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


[android-developers] Re: Screen Brightness on 2.2

2010-11-01 Thread burton miller
Mystery solved.

In both cases where I was trying to change the local brightness, I was
inside a tab container - and I guess you have to call getWindow() on
the container - not on the Activity inside a particular tab.

Thanks again.

On Nov 1, 10:48 am, burton miller  wrote:
> I tried that - and nothing.  I have a pretty heavy app here - with a
> LOT of native code, and the screen in question is mostly a bitmap
> rendered on the native side
>
> So - I made  dopey test app (in 5 minutes) and you are right - the
> code works fine in the normal case (in whatever function you call it
> in).  Just not in my more complex application!
>
> Thanks, anyway - and sorry for wasting your time.  I never post on
> these groups until I've put in some real time on a problem.
>
> On Oct 30, 12:13 pm, Dianne Hackborn  wrote:
>
> > In theory shouldn't, but did you try moving it to your onCreate() and seeing
> > if it worked?  It is possible there is a bug in the window manager causing
> > it to not see a change after a window is first added.
>
> > On Sat, Oct 30, 2010 at 11:41 AM, burton miller 
> > wrote:
>
> > > In PointerLocation, you are setting the window attributes in the
> > > onCreate() call.
>
> > > I am trying do this in the onResume() call.  Does that make a
> > > difference?
>
> > > In another case I am doing it in reponse to a seekBar setting in the
> > > midst of an Activity.  It does not work there either.
>
> > > On Oct 29, 6:15 pm, Dianne Hackborn  wrote:
> > > > Works fine for me in PointerLocation.  *shrug*  Sorry, I don't know
> > > off-hand
> > > > what is going on for you.
>
> > > > On Fri, Oct 29, 2010 at 4:08 PM, burton miller  > > >wrote:
>
> > > > > Come on Diane, Mark, Reto - help a fellow out with your words of
> > > > > wisdom;)
>
> > > > > On Oct 27, 4:55 pm, burton miller  wrote:
> > > > > > Anybody have any idea why this is not working under 2.2?  (nexus 
> > > > > > one)
>
> > > > > > WindowManager.LayoutParams lp = getWindow().getAttributes();
> > > > > > lp.screenBrightness = 1.0f;
> > > > > > getWindow().setAttributes(lp);
>
> > > > > > And yes, the auto-brightness is disabled under settings.
>
> > > > > --
> > > > > You received this message because you are subscribed to the Google
> > > > > Groups "Android Developers" group.
> > > > > To post to this group, send email to
> > > android-developers@googlegroups.com
> > > > > To unsubscribe from this group, send email to
> > > > > android-developers+unsubscr...@googlegroups.com
> > > 
>
> > > > > For more options, visit this group at
> > > > >http://groups.google.com/group/android-developers?hl=en
>
> > > > --
> > > > Dianne Hackborn
> > > > Android framework engineer
> > > > hack...@android.com
>
> > > > Note: please don't send private questions to me, as I don't have time to
> > > > provide private support, and so won't reply to such e-mails.  All such
> > > > questions should be posted on public forums, where I and others can see
> > > and
> > > > answer them.
>
> > > --
> > > You received this message because you are subscribed to the Google
> > > Groups "Android Developers" group.
> > > To post to this group, send email to android-developers@googlegroups.com
> > > To unsubscribe from this group, send email to
> > > android-developers+unsubscr...@googlegroups.com
> > > For more options, visit this group at
> > >http://groups.google.com/group/android-developers?hl=en
>
> > --
> > Dianne Hackborn
> > Android framework engineer
> > hack...@android.com
>
> > Note: please don't send private questions to me, as I don't have time to
> > provide private support, and so won't reply to such e-mails.  All such
> > questions should be posted on public forums, where I and others can see and
> > answer them.
>
>

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


[android-developers] Re: Screen rotation and ProgressDialog

2010-09-20 Thread Bret Foreman
But showDialog takes a resource ID and I'm creating my progress dialog
on the fly. Perhaps it's a better idea to create it statically?

On Sep 20, 12:07 pm, TreKing  wrote:
> On Mon, Sep 20, 2010 at 2:01 PM, Bret 
> Foremanbegin_of_the_skype_highlighting end_of_the_skype_highlightingwrote:
>
> > How should I handle an active ProgressDialog when the screen is rotated?
>
> If you use showDialog(), it gets managed for you.
>
> -
> TreKing  - Chicago
> transit tracking app for Android-powered devices

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


[android-developers] Re: Screen rotation and ProgressDialog

2010-09-20 Thread Bret Foreman
But a ProgressDialog object does not have a setId method. So how would
I identify the dialog?

On Sep 20, 12:27 pm, TreKing  wrote:
> On Mon, Sep 20, 2010 at 2:18 PM, Bret 
> Foremanbegin_of_the_skype_highlighting end_of_the_skype_highlightingwrote:
>
> > But showDialog takes a resource ID
>
> It's not a resource ID. That id is to ID the dialog itself. It can be
> whatever you need it to be to ID that particular dialog.
>
> -
> TreKing  - Chicago
> transit tracking app for Android-powered devices

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


[android-developers] Re: Screen rotation and ProgressDialog

2010-09-20 Thread Bret Foreman
Yeah, I read this first but was pretty confused. Now I've read it
again after the discussion here and it makes more sense. I've got it
working now.

On Sep 20, 1:05 pm, TreKing  wrote:
> On Mon, Sep 20, 2010 at 2:37 PM, Bret 
> Foremanbegin_of_the_skype_highlighting end_of_the_skype_highlightingwrote:
>
> > But a ProgressDialog object does not have a setId method. So how would I
> > identify the dialog?
>
> I think you should review 
> this:http://developer.android.com/guide/topics/ui/dialogs.html
>
> -
> TreKing  - Chicago
> transit tracking app for Android-powered devices

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


[android-developers] Re: Screen Sizes and Densities

2011-03-25 Thread William Ferguson
*Bump*

Surely there is some more recent info on screen sizing than Aug 2010.
According to this, it looks like there are no large or extra-large
screens.
So I guess I'm just imagining all those tablets.

This document is referenced in Supporting Screen Sizes in the
developer doco.
Which is istelf a little behind the times as it makes no reference to
the WXGA skin that shipped with the 3.0 emulator update.



On Mar 14, 8:38 pm, William Ferguson 
wrote:
> Is there any better data on the ratio ofscreensizesanddensities
> than
>  http://developer.android.com/resources/dashboard/screens.html
> which was last updated on 2 August 2010?
>
> William

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


[android-developers] Re: Screen Sizes and Densities

2011-03-25 Thread William Ferguson
I was kind of hoping that Dianne or someone else on the inside might
be able to kick the lever that would get those stats updated.
Because you're right, its needs to be a holistic data set.

On Mar 26, 5:53 am, Chris Stewart  wrote:
> > So I guess I'm just imagining all those tablets.
>
> In many ways, you are.  Just ask Motorola... :o
>
> But seriously, I don't know of any concrete numbers.  The best we could do
> for you is a Google search or to share statistics from our own apps with
> you.  Not sure the latter is what you're after as most of our apps aren't
> mega popular and therefore aren't covering the general landscape of the
> market.
>
> --
> Chris Stewarthttp://chriswstewart.com
>
> On Fri, Mar 25, 2011 at 3:41 PM, William Ferguson 
> gmail.com> wrote:
> > *Bump*
>
> > Surely there is some more recent info on screen sizing than Aug 2010.
> > According to this, it looks like there are no large or extra-large
> > screens.
> > So I guess I'm just imagining all those tablets.
>
> > This document is referenced in Supporting Screen Sizes in the
> > developer doco.
> > Which is istelf a little behind the times as it makes no reference to
> > the WXGA skin that shipped with the 3.0 emulator update.
>
> > On Mar 14, 8:38 pm, William Ferguson 
> > wrote:
> > > Is there any better data on the ratio ofscreensizesanddensities
> > > than
> > >  http://developer.android.com/resources/dashboard/screens.html
> > > which was last updated on 2 August 2010?
>
> > > William
>
> > --
> > You received this message because you are subscribed to the Google
> > Groups "Android Developers" group.
> > To post to this group, send email to android-developers@googlegroups.com
> > To unsubscribe from this group, send email to
> > android-developers+unsubscr...@googlegroups.com
> > 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 android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en


Re: [android-developers] Re: screen flickering in GLSurfaceView

2010-03-18 Thread Andres Colubri



What happens in your case is the following (as far as i can tell). In
the first onDrawFrame() call you render some elements to the initially
black back buffer. The front buffer is also black. Now you leave
onDrawFrame() and the back buffer gets presented while the front
buffer becomes your new back buffer. But the new back buffer does not
contain the elements you just rendered! So you render your new
elements to a completely black back buffer this time so the final
image is not a composition of the first onDrawFrame and the second
one. As the buffers are constantly swaped they never have the same
content as half of the elements is in one buffer and the others are in
the other buffer.
  
Thanks for the explanation, this makes the source of the problem 
perfectly clear.



There might be a way to disable double buffering in the GLSurfaceView
if you use that. 
  
That would be nice, I wonder if it is possible to do at all... After a 
quick look at the source code of GLSurfaceView, it seems to me that the 
double buffering is hard coded into the EglHelper class.



Otherwise you will need to use EGL directly to setup
your OpenGL surface without double buffering. 
I'd like to avoid this, since it basically means implementing my own 
GLSurfaceView...



On the other hand i wonder why you don't compose your complete scene in a single
onDrawFrame call.
  
Because the goal is to have an interactive drawing application 
controlled by the user input (brushes strokes, etc).


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


Re: [android-developers] Re: screen flickering in GLSurfaceView

2010-03-18 Thread Andres Colubri

ok, I see... thanks for the link.

So I guess that finding a way to disable the double buffering, at least 
temporarily, should be the best way to go then...


Mario Zechner wrote:

oh, i tried that once with OpenGL ES. I didn't use the backbuffer but
drew directly to a texture using an intermediate Bitmap as the drawing
surface and reuploading only those parts of the texture that changed.
You can find a video and an apk of that at
http://apistudios.com/hosted/marzec/badlogic/wordpress/?cat=10. The
problem is that if you update to much of the texture at once you get
100ms interruptions which might be visible to the user.

On 18 Mrz., 14:46, Andres Colubri  wrote:
  

What happens in your case is the following (as far as i can tell). In
the first onDrawFrame() call you render some elements to the initially
black back buffer. The front buffer is also black. Now you leave
onDrawFrame() and the back buffer gets presented while the front
buffer becomes your new back buffer. But the new back buffer does not
contain the elements you just rendered! So you render your new
elements to a completely black back buffer this time so the final
image is not a composition of the first onDrawFrame and the second
one. As the buffers are constantly swaped they never have the same
content as half of the elements is in one buffer and the others are in
the other buffer.
  

Thanks for the explanation, this makes the source of the problem
perfectly clear.



There might be a way to disable double buffering in the GLSurfaceView
if you use that.
  

That would be nice, I wonder if it is possible to do at all... After a
quick look at the source code of GLSurfaceView, it seems to me that the
double buffering is hard coded into the EglHelper class.



Otherwise you will need to use EGL directly to setup
your OpenGL surface without double buffering.
  

I'd like to avoid this, since it basically means implementing my own
GLSurfaceView...



On the other hand i wonder why you don't compose your complete scene in a single
onDrawFrame call.
  

Because the goal is to have an interactive drawing application
controlled by the user input (brushes strokes, etc).



  


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


Re: [android-developers] Re: screen flickering in GLSurfaceView

2010-03-18 Thread amsale zelalem
thank you so much for ur precious advice. that is what we were looking for

--- On Thu, 3/18/10, Andres Colubri  wrote:

From: Andres Colubri 
Subject: Re: [android-developers] Re: screen flickering in GLSurfaceView
To: android-developers@googlegroups.com
Date: Thursday, March 18, 2010, 6:46 AM


> What happens in your case is the following (as far as i can tell). In
> the first onDrawFrame() call you render some elements to the initially
> black back buffer. The front buffer is also black. Now you leave
> onDrawFrame() and the back buffer gets presented while the front
> buffer becomes your new back buffer. But the new back buffer does not
> contain the elements you just rendered! So you render your new
> elements to a completely black back buffer this time so the final
> image is not a composition of the first onDrawFrame and the second
> one. As the buffers are constantly swaped they never have the same
> content as half of the elements is in one buffer and the others are in
> the other buffer.
>   
Thanks for the explanation, this makes the source of the problem perfectly 
clear.

> There might be a way to disable double buffering in the GLSurfaceView
> if you use that.   
That would be nice, I wonder if it is possible to do at all... After a quick 
look at the source code of GLSurfaceView, it seems to me that the double 
buffering is hard coded into the EglHelper class.

> Otherwise you will need to use EGL directly to setup
> your OpenGL surface without double buffering. 
I'd like to avoid this, since it basically means implementing my own 
GLSurfaceView...

> On the other hand i wonder why you don't compose your complete scene in a 
> single
> onDrawFrame call.
>   
Because the goal is to have an interactive drawing application controlled by 
the user input (brushes strokes, etc).

-- You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
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 android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

Re: [android-developers] Re: screen flickering in GLSurfaceView

2010-03-26 Thread Andres Colubri

Hi,

I just wanted to mention that I found a method that solves the 
flickering problem in continuous drawing applications:
* right after the frame has been completely drawn, but before doing the 
buffer swap, copy the screen image into a texture using 
glCopyTexImage2D. This texture should be rgba, have a size coinciding 
with the screen resolution, and minification and magnification filtering 
set to nearest.
* before starting the drawing of the next frame, render the texture so 
it covers the whole screen.


Does this make sense?

ac

Mario Zechner wrote:

oh, i tried that once with OpenGL ES. I didn't use the backbuffer but
drew directly to a texture using an intermediate Bitmap as the drawing
surface and reuploading only those parts of the texture that changed.
You can find a video and an apk of that at
http://apistudios.com/hosted/marzec/badlogic/wordpress/?cat=10. The
problem is that if you update to much of the texture at once you get
100ms interruptions which might be visible to the user.

On 18 Mrz., 14:46, Andres Colubri  wrote:
  

What happens in your case is the following (as far as i can tell). In
the first onDrawFrame() call you render some elements to the initially
black back buffer. The front buffer is also black. Now you leave
onDrawFrame() and the back buffer gets presented while the front
buffer becomes your new back buffer. But the new back buffer does not
contain the elements you just rendered! So you render your new
elements to a completely black back buffer this time so the final
image is not a composition of the first onDrawFrame and the second
one. As the buffers are constantly swaped they never have the same
content as half of the elements is in one buffer and the others are in
the other buffer.
  

Thanks for the explanation, this makes the source of the problem
perfectly clear.



There might be a way to disable double buffering in the GLSurfaceView
if you use that.
  

That would be nice, I wonder if it is possible to do at all... After a
quick look at the source code of GLSurfaceView, it seems to me that the
double buffering is hard coded into the EglHelper class.



Otherwise you will need to use EGL directly to setup
your OpenGL surface without double buffering.
  

I'd like to avoid this, since it basically means implementing my own
GLSurfaceView...



On the other hand i wonder why you don't compose your complete scene in a single
onDrawFrame call.
  

Because the goal is to have an interactive drawing application
controlled by the user input (brushes strokes, etc).



  


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

To unsubscribe from this group, send email to 
android-developers+unsubscribegooglegroups.com or reply to this email with the words 
"REMOVE ME" as the subject.


[android-developers] Re: Screen/Pattern Lock application invocation

2009-04-20 Thread Dianne Hackborn
You can't do this with the SDK, sorry.

On Mon, Apr 20, 2009 at 8:54 AM, dilit  wrote:

>
> Hello,
>
> We are writing our own application to substitute G1 standard screen
> lock (where you have to draw a pattern between the dots on the
> screen).  Unfortunately,  I have been unable to find documents on how
> to hook our application in, so that it would be called instead of the
> standard G1 screen lock.
>
> Is there a broadcast sent when the standard lock is activated?
> Any information would be much appreciated.
> Dmitriy
>
> >
>


-- 
Dianne Hackborn
Android framework engineer
hack...@android.com

Note: please don't send private questions to me, as I don't have time to
provide private support, and so won't reply to such e-mails.  All such
questions should be posted on public forums, where I and others can see and
answer them.

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



[android-developers] Re: Screen/Pattern Lock application invocation

2009-04-20 Thread dilit

Thank you very much for the prompt reply!
The only thing that can salvage our idea is if we can open
the screen lock programmatically.  Is that possible?

Can we know within the program, if screen lock is on?
What user events can we capture from behind the screen lock?

Could you stir us in the right direction in that respect?
Thank you again!
Dmitiry

On Apr 20, 2:35 pm, Dianne Hackborn  wrote:
> You can't do this with the SDK, sorry.
>
> On Mon, Apr 20, 2009 at 8:54 AM, dilit  wrote:
>
> > Hello,
>
> > We are writing our own application to substitute G1 standard screen
> > lock (where you have to draw a pattern between the dots on the
> > screen).  Unfortunately,  I have been unable to find documents on how
> > to hook our application in, so that it would be called instead of the
> > standard G1 screen lock.
>
> > Is there a broadcast sent when the standard lock is activated?
> > Any information would be much appreciated.

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



[android-developers] Re: Screen/Pattern Lock application invocation

2009-04-20 Thread Mark Murphy

dilit wrote:
> Thank you very much for the prompt reply!
> The only thing that can salvage our idea is if we can open
> the screen lock programmatically.  Is that possible?

With the proper permissions, you can disable the screen lock.

> Can we know within the program, if screen lock is on?

android.provider.Settings.System -- you want the LOCK_PATTERN_ENABLED
setting.

-- 
Mark Murphy (a Commons Guy)
http://commonsware.com | http://twitter.com/commonsguy

_The Busy Coder's Guide to Android Development_ Version 2.0 Available!

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



[android-developers] Re: Screen/Pattern Lock application invocation

2009-04-20 Thread dilit

Can you tell me what classes would allow me to disable the lock from
within the program?
Is it KeyguardManager, KeyguardLock?

Thanks

On Apr 20, 7:48 pm, Mark Murphy  wrote:
> dilit wrote:
> > Thank you very much for the prompt reply!
> > The only thing that can salvage our idea is if we can open
> > the screen lock programmatically.  Is that possible?
>
> With the proper permissions, you can disable the screen lock.
>
> > Can we know within the program, if screen lock is on?
>
> android.provider.Settings.System -- you want the LOCK_PATTERN_ENABLED
> setting.
>
> --
> Mark Murphy (a Commons 
> Guy)http://commonsware.com|http://twitter.com/commonsguy
>
> _The Busy Coder's Guide to Android Development_ Version 2.0 Available!
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers-unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] Re: Screen/Pattern Lock application invocation

2009-04-21 Thread Mark Murphy

dilit wrote:
> Can you tell me what classes would allow me to disable the lock from
> within the program?
> Is it KeyguardManager, KeyguardLock?

It is android.provider.Settings.System -- you want the
LOCK_PATTERN_ENABLED setting.

-- 
Mark Murphy (a Commons Guy)
http://commonsware.com | http://twitter.com/commonsguy

Android App Developer Training: http://commonsware.com/training.html

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



[android-developers] Re: Screen/Pattern Lock application invocation

2009-04-21 Thread dilit

Mark,

Calling
System.Settings.putInt(getContentResolver(),
System.Settings.LOCK_PATTERN_ENABLED, 1);
System.Settings.putInt(getContentResolver(),
System.Settings.LOCK_PATTERN_VISIBLE, 1);
on emulator does not seem to activate the pattern, even after having
configured the lock pattern.
Later I call KeyGuardManager.reenableLock() ...

I am going to try it on a real phone and report it.
This, however, seems like a configuration change versus unlocking
(here is the right word :)) the phone from a program.
I guess it might work.

Thanks!

On Apr 21, 5:51 am, Mark Murphy  wrote:
> dilit wrote:
> > Can you tell me what classes would allow me to disable the lock from
> > within the program?
> > Is it KeyguardManager, KeyguardLock?
>
> It is android.provider.Settings.System -- you want the
> LOCK_PATTERN_ENABLED setting.
>
> --
> Mark Murphy (a Commons 
> Guy)http://commonsware.com|http://twitter.com/commonsguy
>
> Android App Developer Training:http://commonsware.com/training.html
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers-unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] Re: Screen/Pattern Lock application invocation

2009-04-21 Thread dilit

Apologize for the confusion.
I meant to ask how I can UNLOCK the phone from inside a program
after it is locked with a screen lock?
Is there interface to Pattern/Screen lock?

What is KeyguardManager for?
Thanks!
D

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



[android-developers] Re: screen compatibility not quite right

2009-11-21 Thread rukiman
I thought I'd create my own specialized LinearLayout so that I can
calculate the aspect ratio and center vertically. My game is only
designed to be played in portrait mode. However this code doesn't seem
to work. Spot what I am doing wrong?

import android.content.Context;
import android.util.AttributeSet;
import android.view.ViewGroup;
import android.widget.LinearLayout;

public class SpecialLinearLayout extends LinearLayout {

private final Context context;

public SpecialLinearLayout(Context context, AttributeSet attrs) {
super(context, attrs);
this.context = context;
}

protected void onLayout(boolean changed, int l, int t, int r, int
b) {
int width = r - l;
int height = b - t;
float aspect = 480.0f / 320.0f;
int newheight = (int) Math.floor((float) width * (float)
aspect);
if(newheight != height) {
// create top margins to center vertically
ViewGroup.MarginLayoutParams margin = new
ViewGroup.MarginLayoutParams(this.getLayoutParams());
margin.setMargins(0, 40, 0, 50);
this.setLayoutParams(new LinearLayout.LayoutParams
(margin));
}
}
}


On Nov 22, 11:26 am, Mark Murphy  wrote:
> rukiman wrote:
> > This is working almost 90% for my game except when testing in WVGA
> > screen resolution, all my images are scaled incorrectly, it is longer
> > vertically than horizontally. I was expecting the screen compatibility
> > to maintain aspect ratios as that of HVGA.
>
> No.
>
> "DROID has been optimized to display wide-screen multimedia (movie)
> content at its native aspect ratio of 16/9. This is different from the
> HVGA aspect ratio of 3/2, which is the traditional computer screen
> format. What this means is that when content is scaled up to "full
> screen", the horizontal (X*1.5) and vertical (Y*1.77) scaling factors
> are different. As a result, when displaying the same bitmap as a full
> screen background, round circles can appear as ovals, and squares are
> elongated to rectangles."
>
> http://developer.motorola.com/docstools/library/Support_for_Multiple_...
>
> I have no reason to believe this is DROID-specific, but rather is how
> Android scales things in WVGA800/WVGA854, when you do not supply your
> own pre-scaled resources.
>
> > Also in my layout I have a scrollview and it is designed in such a way
> > that in HVGA when it is not scrolled down, the items are hidden away,
> > however now in WVGA those things are shown. If the aspect ratio of
> > HVGA is maintained I won't have this issue.
>
> > How can I make sure the aspect ratio is maintained?
>
> You cannot control the aspect ratio, as that is dictated by the physical
> parameters of the screen. AFAIK, there is no Android equivalent of
> "letterbox" that would put black bars on either side of your app and
> give you a smaller virtual screen with 3/2 aspect ratio.
>
> > Also in my layout I am positioning some items using pixel positions.
> > Should I convert these to dpi?
>
> If you mean dip (density-independent pixels), perhaps. It depends on
> what the pixels represent. There is no hard-and-fast rule.
>
> > How do I calculate what dpi they should be?
>
> 1px = 1dip at 160dpi (i.e., traditional "normal" screen density).
>
> --
> Mark Murphy (a Commons 
> Guy)http://commonsware.com|http://twitter.com/commonsguy
>
> _Android Programming Tutorials_ Version 1.0 Available!

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


[android-developers] Re: screen compatibility not quite right

2009-11-21 Thread rukiman
I just put harcoded fake values for time being, instead of centering.
I was expecting everything embedded with the linearlayout which is my
main layout to be shrunk by the top and bottom margins I specified.

On Nov 22, 1:25 pm, rukiman  wrote:
> I thought I'd create my own specialized LinearLayout so that I can
> calculate the aspect ratio and center vertically. My game is only
> designed to be played in portrait mode. However this code doesn't seem
> to work. Spot what I am doing wrong?
>
> import android.content.Context;
> import android.util.AttributeSet;
> import android.view.ViewGroup;
> import android.widget.LinearLayout;
>
> public class SpecialLinearLayout extends LinearLayout {
>
>     private final Context context;
>
>     public SpecialLinearLayout(Context context, AttributeSet attrs) {
>         super(context, attrs);
>         this.context = context;
>     }
>
>     protected void onLayout(boolean changed, int l, int t, int r, int
> b) {
>         int width = r - l;
>         int height = b - t;
>         float aspect = 480.0f / 320.0f;
>         int newheight = (int) Math.floor((float) width * (float)
> aspect);
>         if(newheight != height) {
>             // create top margins to center vertically
>             ViewGroup.MarginLayoutParams margin = new
> ViewGroup.MarginLayoutParams(this.getLayoutParams());
>             margin.setMargins(0, 40, 0, 50);
>             this.setLayoutParams(new LinearLayout.LayoutParams
> (margin));
>         }
>     }
>
> }
>
> On Nov 22, 11:26 am, Mark Murphy  wrote:
>
> > rukiman wrote:
> > > This is working almost 90% for my game except when testing in WVGA
> > > screen resolution, all my images are scaled incorrectly, it is longer
> > > vertically than horizontally. I was expecting the screen compatibility
> > > to maintain aspect ratios as that of HVGA.
>
> > No.
>
> > "DROID has been optimized to display wide-screen multimedia (movie)
> > content at its native aspect ratio of 16/9. This is different from the
> > HVGA aspect ratio of 3/2, which is the traditional computer screen
> > format. What this means is that when content is scaled up to "full
> > screen", the horizontal (X*1.5) and vertical (Y*1.77) scaling factors
> > are different. As a result, when displaying the same bitmap as a full
> > screen background, round circles can appear as ovals, and squares are
> > elongated to rectangles."
>
> >http://developer.motorola.com/docstools/library/Support_for_Multiple_...
>
> > I have no reason to believe this is DROID-specific, but rather is how
> > Android scales things in WVGA800/WVGA854, when you do not supply your
> > own pre-scaled resources.
>
> > > Also in my layout I have a scrollview and it is designed in such a way
> > > that in HVGA when it is not scrolled down, the items are hidden away,
> > > however now in WVGA those things are shown. If the aspect ratio of
> > > HVGA is maintained I won't have this issue.
>
> > > How can I make sure the aspect ratio is maintained?
>
> > You cannot control the aspect ratio, as that is dictated by the physical
> > parameters of the screen. AFAIK, there is no Android equivalent of
> > "letterbox" that would put black bars on either side of your app and
> > give you a smaller virtual screen with 3/2 aspect ratio.
>
> > > Also in my layout I am positioning some items using pixel positions.
> > > Should I convert these to dpi?
>
> > If you mean dip (density-independent pixels), perhaps. It depends on
> > what the pixels represent. There is no hard-and-fast rule.
>
> > > How do I calculate what dpi they should be?
>
> > 1px = 1dip at 160dpi (i.e., traditional "normal" screen density).
>
> > --
> > Mark Murphy (a Commons 
> > Guy)http://commonsware.com|http://twitter.com/commonsguy
>
> > _Android Programming Tutorials_ Version 1.0 Available!

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


[android-developers] Re: screen compatibility not quite right

2009-11-22 Thread tomei.ninge...@gmail.com
I have to say that Android's screen compatibility worked out really
well for me. My app specifies all positions using DIPs, and it worked
on the DROID without any change (or even recompilation -- the app was
built using SDK 1.1).

Essentially all screen coordinates were scaled by 1.5, and bitmaps
were also scaled by 1.5, in BOTH directions.

The only problem I still have is with WebView + JavaScript. The
coordinates returned by obj.offsetTop, etc, in JavaScript are "shrunk
by 1.5x" when running on DROID, even if I specified the following in
AndroidManifest.xml:



That wasn't too hard to work around, but I wonder if there's a
"disable compability mode" switch in WebView 


On Nov 22, 12:16 am, Dianne Hackborn  wrote:
> On Sat, Nov 21, 2009 at 4:26 PM, Mark Murphy wrote:
>
>
>
>
>
> > "DROID has been optimized to display wide-screen multimedia (movie)
> > content at its native aspect ratio of 16/9. This is different from the
> > HVGA aspect ratio of 3/2, which is the traditional computer screen
> > format. What this means is that when content is scaled up to "full
> > screen", the horizontal (X*1.5) and vertical (Y*1.77) scaling factors
> > are different. As a result, when displaying the same bitmap as a full
> > screen background, round circles can appear as ovals, and squares are
> > elongated to rectangles."
>
> >http://developer.motorola.com/docstools/library/Support_for_Multiple_...
>
> > I have no reason to believe this is DROID-specific, but rather is how
> > Android scales things in WVGA800/WVGA854, when you do not supply your
> > own pre-scaled resources.
>
> I think what they are trying to say is correct, but probably misleading.
>
> First, scaling is only done based on density, and does NOT change aspect
> ratio.  If you are on a high density device, and your assets are medium
> density, they will be scaled by 1.5 in both width and height, period, end of
> story.
>
> What this Motorola doc is describing is what I would consider a special
> case.  If you make a layout that is fill parent for both width and height,
> then on a WVGA of course it will be taller than on HVGA because the screen
> you are filling is taller.  Now if you set a drawable as its background, the
> View class draws its background by simply stretching the drawable to fill
> its contents, so your bitmap will be stretched to fill whatever aspect ratio
> your layout has ended up being.  This is just a matter of accounting for the
> screen being different sizes and designing your layout to adjust
> accordingly.
>
> > You cannot control the aspect ratio, as that is dictated by the physical
> > parameters of the screen. AFAIK, there is no Android equivalent of
> > "letterbox" that would put black bars on either side of your app and
> > give you a smaller virtual screen with 3/2 aspect ratio.
>
> We actually do a "postage stamp" for apps on large screens, since we found
> that a significant number of them broke when given so much extra space.
>  However, the vast majority of existing apps work reasonably well when
> presented with a WVGA screen, so rather than cause all of the existing ones
> to not be able to use that space, we decided to not provide compatibility
> for that and live with the small handful that did have significant problems.
>
> But for someone writing an app today, this is fairly irrelevant, because if
> your app really can't use anything more than an HVGA screen then you really
> just need to design your layout to center or whatever you want your content
> in whatever screen you are running on.
>
> > Also in my layout I am positioning some items using pixel positions.
> > > Should I convert these to dpi?
> > If you mean dip (density-independent pixels), perhaps. It depends on
> > what the pixels represent. There is no hard-and-fast rule.
>
> But the vast majority of time, yes, you do want to use dpis.
>
> However!  The original post showed that the app was actually saying it can't
> deal with densities.  This means the system will emulate a medium density
> screen on whatever density the device  is, so 1 px == 1 dip.  However, you
> really should not be saying that you don't support densities -- there are
> artifacts that can happen when doing this, such as font metrics not being
> quite right.
>
> If you are writing an app today, you really want to not put yourself in
> compatibility mode, and just write the app correctly.
>
> --
> Dianne Hackborn
> Android framework engineer
> hack...@android.com
>
> Note: please don't send private questions to me, as I don't have time to
> provide private support, and so won't reply to such e-mails.  All such
> questions should be posted on public forums, where I and others can see and
> answer them.

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
F

[android-developers] Re: screen compatibility not quite right

2009-11-22 Thread rukiman
Thanks for the info. OK I figured out instead of using fill_parent in
width and height of my main LinearLayouts, I instead hardcode the HVGA
size of 320 x 480px the aspect ratio is ok.
The game is looking much better in compatible mode.

Except seems like in compatible mode gravity of center_vertically is
not working correctly?  The container of the textview I am trying to
center vertically is in a LinearLayout with height = 480px however it
is still centering within the WVGA screen height.
What can I do to fix this?

I have to rely on compatible mode unfortunately as there is too many
graphics to redraw for different resolutions and no money to pay the
designer :D





On Nov 22, 7:16 pm, Dianne Hackborn  wrote:
> On Sat, Nov 21, 2009 at 4:26 PM, Mark Murphy wrote:
>
>
>
> > "DROID has been optimized to display wide-screen multimedia (movie)
> > content at its native aspect ratio of 16/9. This is different from the
> > HVGA aspect ratio of 3/2, which is the traditional computer screen
> > format. What this means is that when content is scaled up to "full
> > screen", the horizontal (X*1.5) and vertical (Y*1.77) scaling factors
> > are different. As a result, when displaying the same bitmap as a full
> > screen background, round circles can appear as ovals, and squares are
> > elongated to rectangles."
>
> >http://developer.motorola.com/docstools/library/Support_for_Multiple_...
>
> > I have no reason to believe this is DROID-specific, but rather is how
> > Android scales things in WVGA800/WVGA854, when you do not supply your
> > own pre-scaled resources.
>
> I think what they are trying to say is correct, but probably misleading.
>
> First, scaling is only done based on density, and does NOT change aspect
> ratio.  If you are on a high density device, and your assets are medium
> density, they will be scaled by 1.5 in both width and height, period, end of
> story.
>
> What this Motorola doc is describing is what I would consider a special
> case.  If you make a layout that is fill parent for both width and height,
> then on a WVGA of course it will be taller than on HVGA because the screen
> you are filling is taller.  Now if you set a drawable as its background, the
> View class draws its background by simply stretching the drawable to fill
> its contents, so your bitmap will be stretched to fill whatever aspect ratio
> your layout has ended up being.  This is just a matter of accounting for the
> screen being different sizes and designing your layout to adjust
> accordingly.
>
> > You cannot control the aspect ratio, as that is dictated by the physical
> > parameters of the screen. AFAIK, there is no Android equivalent of
> > "letterbox" that would put black bars on either side of your app and
> > give you a smaller virtual screen with 3/2 aspect ratio.
>
> We actually do a "postage stamp" for apps on large screens, since we found
> that a significant number of them broke when given so much extra space.
>  However, the vast majority of existing apps work reasonably well when
> presented with a WVGA screen, so rather than cause all of the existing ones
> to not be able to use that space, we decided to not provide compatibility
> for that and live with the small handful that did have significant problems.
>
> But for someone writing an app today, this is fairly irrelevant, because if
> your app really can't use anything more than an HVGA screen then you really
> just need to design your layout to center or whatever you want your content
> in whatever screen you are running on.
>
> > Also in my layout I am positioning some items using pixel positions.
> > > Should I convert these to dpi?
> > If you mean dip (density-independent pixels), perhaps. It depends on
> > what the pixels represent. There is no hard-and-fast rule.
>
> But the vast majority of time, yes, you do want to use dpis.
>
> However!  The original post showed that the app was actually saying it can't
> deal with densities.  This means the system will emulate a medium density
> screen on whatever density the device  is, so 1 px == 1 dip.  However, you
> really should not be saying that you don't support densities -- there are
> artifacts that can happen when doing this, such as font metrics not being
> quite right.
>
> If you are writing an app today, you really want to not put yourself in
> compatibility mode, and just write the app correctly.
>
> --
> Dianne Hackborn
> Android framework engineer
> hack...@android.com
>
> Note: please don't send private questions to me, as I don't have time to
> provide private support, and so won't reply to such e-mails.  All such
> questions should be posted on public forums, where I and others can see and
> answer them.

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options,

  1   2   >