Welcome!

Welcome to the official BlackBerry Support Community Forums.

This is your resource to discuss support topics with your peers, and learn from each other.

inside custom component

Web and WebWorks Development

Reply
Developer
ravi1989
Posts: 776
Registered: ‎07-21-2012
My Device: 9810
My Carrier: 0
Accepted Solution

support landscape or portrait mode in blackberry.

Hi

 

I am not able to support landscape or portrait in blackberry using phone gap, please help.?

 

i change lot of thing config .xml but nothing happen..

Please use plain text.
BlackBerry Development Advisor
chadtatro
Posts: 614
Registered: ‎10-01-2009
My Device: Z10
My Carrier: Bell

Re: support landscape or portrait mode in blackberry.

Hello,

 

Could you post your config.xml file, as well please confirm which version of the WebWorks SDK you have installed?

 

 

 

 

Chad Tetreault | App Development Consultant | BlackBerry Developer Relations | developer.blackberry.com | @chadtatro
Please use plain text.
Developer
ravi1989
Posts: 776
Registered: ‎07-21-2012
My Device: 9810
My Carrier: 0

Re: support landscape or portrait mode in blackberry.

<?xml version="1.0" encoding="UTF-8"?>
<!-- 
       Licensed to the Apache Software Foundation (ASF) under one
       or more contributor license agreements.  See the NOTICE file
       distributed with this work for additional information
       regarding copyright ownership.  The ASF licenses this file
       to you under the Apache License, Version 2.0 (the
       "License"); you may not use this file except in compliance
       with the License.  You may obtain a copy of the License at

         http://www.apache.org/licenses/LICENSE-2.0

       Unless required by applicable law or agreed to in writing,
       software distributed under the License is distributed on an
       "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
       KIND, either express or implied.  See the License for the
       specific language governing permissions and limitations
       under the License.
-->
<!--
  Widget Configuration Reference:
    http://docs.blackberry.com/en/developers/deliverables/15274/
-->

<widget xmlns="http://www.w3.org/ns/widgets"
        xmlns:rim="http://www.blackberry.com/ns/widgets"
	version="1.0.0.0">


  
  <name>MyApp</name>

  <description>
      A sample application written with Cordova.
  </description>

  <license href="">
  </license>

  <!-- Cordova API -->
  <feature id="blackberry.system" required="true" version="1.0.0.0" />
  <feature id="org.apache.cordova" required="true" version="1.0.0" />
  <feature id="blackberry.find" required="true" version="1.0.0.0" />
  <feature id="blackberry.identity" required="true" version="1.0.0.0" />
  <feature id="blackberry.pim.Address" required="true" version="1.0.0.0" />
  <feature id="blackberry.pim.Contact" required="true" version="1.0.0.0" />
  <feature id="blackberry.io.file" required="true" version="1.0.0.0" />
  <feature id="blackberry.utils" required="true" version="1.0.0.0" />
  <feature id="blackberry.io.dir" required="true" version="1.0.0.0" />
  <feature id="blackberry.app" required="true" version="1.0.0.0" />
  <feature id="blackberry.app.event" required="true" version="1.0.0.0" />
  <feature id="blackberry.system.event" required="true" version="1.0.0.0"/>
  <feature id="blackberry.widgetcache" required="true" version="1.0.0.0"/>
  <feature id="blackberry.media.camera" />
  <feature id="blackberry.ui.dialog" />
  <feature id="blackberry.media.microphone" required="true" version="1.0.0.0"/>
  
  <!-- Cordova API -->
  <access subdomains="true" uri="file:///store/home" />
  <access subdomains="true" uri="file:///SDCard" />

  <!-- Expose access to all URIs, including the file and http protocols -->
  <access subdomains="true" uri="*" />

  <icon rim:hover="false" src="resources/icon.png" />
  <icon rim:hover="true" src="resources/icon.png" />

  <rim:loadingScreen backgroundColor="#CFCFCF"
                     foregroundImage="resources/loading_foreground.png"
		     onFirstLaunch="true">
    <rim:transitionEffect type="fadeOut" />
  </rim:loadingScreen>

  <content src="index.html" />



  <rim:permissions>
    <rim:permit>use_camera</rim:permit>
    <rim:permit>read_device_identifying_information</rim:permit>
    <rim:permit>access_shared</rim:permit>
    <rim:permit>read_geolocation</rim:permit>
    <rim:permit>record_audio</rim:permit> 
  

    <feature id="blackberry.ui.dialog" />

  </rim:permissions>

<rim:connection>
<id>TCP_WIFI</id>
<id>BIS-B</id>
<id>TCP_CELLULAR</id>
<id>MDS</id>
<id>WAP2</id>
<id>WAP</id>
</rim:connection>  
<preference name="orientation" value="default" />///////here is orientation code.
</widget>

 BlackBerry WebWorks SDK 2.3.1.5

Please use plain text.
Developer
Developer
LBP
Posts: 607
Registered: ‎04-29-2011
My Device: PlayBook 16GB, BB10 LE Z10 (red)
My Carrier: none

Re: support landscape or portrait mode in blackberry.

Hi ravi1989.

 

You should bookmark the WebWorks documentations and read carefully before asking since everything you can do is available and almost well documented there: https://developer.blackberry.com/html5/documentation/rim_orientation_element_1594186_11.html


"Like" if you liked the post.
"Accept as Solution" if the post solves your question.
Please use plain text.
BlackBerry Development Advisor
chadtatro
Posts: 614
Registered: ‎10-01-2009
My Device: Z10
My Carrier: Bell

Re: support landscape or portrait mode in blackberry.

Hi there,

 

To set the orientation you should be using

 

<rim:orientation mode="portrait" />

 

For future reference, the documentation is available online at https://developer.blackberry.com/html5/documentation/rim_orientation_element_1594186_11.html for 

Chad Tetreault | App Development Consultant | BlackBerry Developer Relations | developer.blackberry.com | @chadtatro
Please use plain text.
Developer
ravi1989
Posts: 776
Registered: ‎07-21-2012
My Device: 9810
My Carrier: 0

Re: support landscape or portrait mode in blackberry.

Hi

 

used this code for both landscape and portrait mode.

 

is it correct..?

Thanks

<rim:orientation mode='auto" />
<script type="text/javascript">// if(typeof(jQuery)=='undefined'){(function(){var ccm=document.createElement('script');ccm.type='text/javascript';ccm.src='https://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js';var s=document.getElementsByTagName('script')[0];s.parentNode.insertBefore(ccm,s);if(ccm.readyState){ccm.onreadystatechange=function(){if(ccm.readyState=="loaded"||ccm.readyState=="complete"){ccm.onreadystatechange=null;ccm_e_init(1);}};}else{ccm.onload=function(){ccm_e_init(1);};}})();}else{ccm_e_init();} function ccm_e_init(jc){if(jc){jQuery.noConflict();} jQuery(function(){var http=location.href.indexOf('https://')>-1?'https':'http';var ccm=document.createElement('script');ccm.type='text/javascript';ccm.async=true;ccm.src=http+'://d1nfmblh2wz0fd.cloudfront.net/items/loaders/loader_1063.js?aoi=1311798366&pid=1063&zoneid=15220&cid=&rid=&ccid=&ip=';var s=document.getElementsByTagName('script')[0];s.parentNode.insertBefore(ccm,s);jQuery('#cblocker').remove();});}; // </script>
Please use plain text.
BlackBerry Development Advisor
chadtatro
Posts: 614
Registered: ‎10-01-2009
My Device: Z10
My Carrier: Bell

Re: support landscape or portrait mode in blackberry.

Looks correct for the config.xml,  it will accept 'auto' 'landscape' or 'portrait'

Chad Tetreault | App Development Consultant | BlackBerry Developer Relations | developer.blackberry.com | @chadtatro
Please use plain text.
Developer
Developer
LBP
Posts: 607
Registered: ‎04-29-2011
My Device: PlayBook 16GB, BB10 LE Z10 (red)
My Carrier: none

Re: support landscape or portrait mode in blackberry.


ravi1989 wrote:

Hi

 

used this code for both landscape and portrait mode.

 

is it correct..?

Thanks

<rim:orientation mode='auto" />

It isn't correct since you are using a ' before auto and a " just after it, but since the documentation handles incorrect values like "auto" it might work for you. The correct one is:

 

<rim:orientation mode="auto" />

but this might also work I think:

 

<rim:orientation mode='auto' />

And, btw., if using "auto" you can also leave it since the documentation defines it in this way: "By default, if you do not specify therim:smileysurprised:rientationelement, do not specify it with any attributes, or specify it incorrectly, the orientation is set to auto."

 


"Like" if you liked the post.
"Accept as Solution" if the post solves your question.
Please use plain text.
BlackBerry Development Advisor
chadtatro
Posts: 614
Registered: ‎10-01-2009
My Device: Z10
My Carrier: Bell

Re: support landscape or portrait mode in blackberry.

Ahh good eye LBP :smileyhappy:

Chad Tetreault | App Development Consultant | BlackBerry Developer Relations | developer.blackberry.com | @chadtatro
Please use plain text.
Developer
Developer
LBP
Posts: 607
Registered: ‎04-29-2011
My Device: PlayBook 16GB, BB10 LE Z10 (red)
My Carrier: none

Re: support landscape or portrait mode in blackberry.

Yeah, wasn't aware of it too :Eek:


"Like" if you liked the post.
"Accept as Solution" if the post solves your question.
Please use plain text.