• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

How to force landscape under all circumstances?

 
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi. I'm using eclipse... I've set up my manifest file with this android:screenOrientation="landscape"... inside the activity tag...

This works fine if I'm using an HVGA, HVGA-P or a QVGA-P android virtual device... but when I use an HVGA-L device or a QVGA-L device, it doesn't work... if I change the manifest file with screenOrientation="portrait", then it works correctly for these 2 cases...

So how can I get the project to be landscape, under all circumstances. Appreciate any help. Thanks.

-Ameet
 
Rancher
Posts: 1369
1
Android Eclipse IDE Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I think, the definition of "portrait" or "landscape" wouldn't change for different screen configurations. Try putting this in your manifest, if not already, and see if it works:

<supports-screens
android:normalScreens="true"
android:smallScreens="true"
android:largeScreens="true"
/>
 
Monu Tripathi
Rancher
Posts: 1369
1
Android Eclipse IDE Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Also, do not remove/change the android:screenOrientation="landscape" attribute from your activity tags.
 
Ameet Sharma
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Monu. Thanks for the reply. It still doesn't work.

I tried changing the sdk version also... it didn't work. Perhaps the target's OS version is the problem? I have them on 1.5.
 
Monu Tripathi
Rancher
Posts: 1369
1
Android Eclipse IDE Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Ameet Sharma wrote:Hi Monu. Thanks for the reply. It still doesn't work.

I tried changing the sdk version also... it didn't work. Perhaps the target's OS version is the problem? I have them on 1.5.



The <supports-screens> tag also has a android:anyDensity attribute which is false by default for API versions < 4 and true for API versions 4 and higher. I tried these settings on 2.0(API level 5; android:minSdkVersion="5") so you could try the following and see if it helps.


Reference: <supports-screen>
 
Ameet Sharma
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Monu. If I have a target with 1.6 or higher... the HVGA-L option is no longer available...

I guess I'm confused as to how to deal with different devices, vs different OS's...

For example, how do I make sure the app will run the same way on a portrait-style android phone... and a landscape-style android gaming device like this:

http://www.hardkernel.com/products.html

 
Monu Tripathi
Rancher
Posts: 1369
1
Android Eclipse IDE Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I have only worked with HTC Hero and G1 phone and both have same screen size. I have only "read" about multiple screen supports and what you should do to support different screen sizes.
I guess, what I am trying to say is that I cannot answer your question.

However, I can point to some of the material I think you should read:
  • Support for additional Screen sizes
  • <supports-screens> tag in Manifest
  • Android Manifest: Supporting multiple screen sizes and SDK versions
  • Complications due to Screen Sizes
  • Discussion: Will Android be hurt with different screen sizes
  •  
    Ameet Sharma
    Greenhorn
    Posts: 4
    • Mark post as helpful
    • send pies
      Number of slices to send:
      Optional 'thank-you' note:
    • Quote
    • Report post to moderator

    Monu Tripathi wrote:I have only worked with HTC Hero and G1 phone and both have same screen size. I have only "read" about multiple screen supports and what you should do to support different screen sizes.
    I guess, what I am trying to say is that I cannot answer your question.

    However, I can point to some of the material I think you should read:

  • Support for additional Screen sizes
  • <supports-screens> tag in Manifest
  • Android Manifest: Supporting multiple screen sizes and SDK versions
  • Complications due to Screen Sizes
  • Discussion: Will Android be hurt with different screen sizes


  • Thanks. Appreciate it.
     
    With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
    reply
      Bookmark Topic Watch Topic
    • New Topic