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

Native Development

Reply
Developer
peter9477
Posts: 6,473
Registered: ‎12-08-2010
My Device: PlayBook, Z10

Re: Unable to get headless apps working


Royster86 wrote:
OK, tried another device - worked fine - my Dev Alpha C for some reason refuses to run background processes? All background permissions are OK and the debug token is fine.

At the risk of suggesting the obvious... reboot?  (You didn't say you had, so with any luck that will fix it.)


Peter Hansen -- (BB10 and dev-related blog posts at http://peterhansen.ca.)
Author of White Noise and Battery Guru for BB10 and for PlayBook | Get more from your battery!
Developer
Royster86
Posts: 102
Registered: ‎03-13-2012
My Device: 9360, P'9981, Z10

Re: Unable to get headless apps working

Thanks - worked after a reboot!
Developer
Royster86
Posts: 102
Registered: ‎03-13-2012
My Device: 9360, P'9981, Z10

Re: Unable to get headless apps working

Hi Shadid,

 

Any updates on the workaround for the Device-Release configuration? I too am having issues running background processes in release mode -

 

Thanks -

Developer
nhuanvd
Posts: 21
Registered: ‎12-11-2012
My Device: Blackberry Z10

Re: Unable to get headless apps working

I have modified file bar-descriptor.xml of my app for the same with headlessservice example. it works with device-debug but it doesn't work with device-release.

 

Is there any update for the Device-Release configuration?

Developer
peter9477
Posts: 6,473
Registered: ‎12-08-2010
My Device: PlayBook, Z10

Re: Unable to get headless apps working


nhuanvd wrote:

I have modified file bar-descriptor.xml of my app for the same with headlessservice example. it works with device-debug but it doesn't work with device-release.

 

Is there any update for the Device-Release configuration?


It will be coming shortly... remember, it is the weekend right now. ;-)


Peter Hansen -- (BB10 and dev-related blog posts at http://peterhansen.ca.)
Author of White Noise and Battery Guru for BB10 and for PlayBook | Get more from your battery!
BlackBerry Development Advisor
shaque
Posts: 237
Registered: ‎07-14-2008
My Device: Not Specified

Re: Unable to get headless apps working

Attaching the correct bar-descriptor for both xandos and headlessservice sample. We are updating the docs and github as well.

 

xandos

<?xml version="1.0" encoding="utf-8" standalone="no"?>
<!--
  
   Copyright (c) 2011, 2012, 2013 Research In Motion Limited.
  
   Licensed 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.
  
-->
<qnx xmlns="http://www.qnx.com/schemas/application/1.0">

<!-- BlackBerry 10 application descriptor file.

    Specifies parameters for identifying, installing, and launching native applications on BlackBerry 10.

-->

    <!-- A universally unique application identifier. Must be unique across all BlackBerry 10 applications.
         Using a reverse DNS-style name as the id is recommended. (Eg. com.example.ExampleApplication.) Required. -->
    <id>com.example.xandos</id>

    <!-- The name that is displayed in the BlackBerry 10 application installer. 
         May have multiple values for each language. See samples or xsd schema file. Optional. -->
    <name>xandos</name>
    
    <!-- A string value of the format <0-999>.<0-999>.<0-999> that represents application version which can be used to check for application upgrade. 
         Values can also be 1-part or 2-part. It is not necessary to have a 3-part value.
         An updated version of application must have a versionNumber value higher than the previous version. Required. -->
    <versionNumber>1.0.0</versionNumber>

    <!-- Fourth digit segment of the package version. First three segments are taken from the 
         <versionNumber> element.  Must be an integer from 0 to 2^16-1 -->
    <buildId>1</buildId>
                 
    <!-- A string value (such as "v1", "2.5", or "Alpha 1") that represents the version of the application, as it should be shown to users. Optional. -->
    <!-- <versionLabel></versionLabel> -->

    <!-- Description, displayed in the BlackBerry 10 application installer.
         May have multiple values for each language. See samples or xsd schema file. Optional. -->
    <description>The xandos application</description>

    <!-- Copyright information. Optional. -->
    <!-- <copyright></copyright> -->

    <!--  Name of author which is used for signing. Must match the developer name of your development certificate. -->
    <author>Example Inc.</author>
    <configuration name="Device-Debug">
       <platformArchitecture>armle-v7</platformArchitecture>
       <asset entryPointId="XandOs" path="arm/o.le-v7-g/xandos" entry="true" type="Qnx/Elf">xandos</asset>
       <asset entryPointId="XandOsDroid" path="../xandosdroid/arm/xandosdroid" type="Qnx/Elf">xandosdroid</asset>
    </configuration>
    <configuration name="Device-Release">
       <entryPointType>Qnx/Cascades</entryPointType>
       <platformArchitecture>armle-v7</platformArchitecture>
       <asset entryPointId="XandOs" path="arm/o.le-v7/xandos.so" entry="true" type="Qnx/Elf">xandos.so</asset>
       <asset entryPointId="XandOsDroid" path="../xandosdroid/arm/xandosdroid" type="Qnx/Elf">xandosdroid</asset>
    </configuration>
    <configuration name="Device-Profile">
       <platformArchitecture>armle-v7</platformArchitecture>
       <asset entryPointId="XandOs" path="arm-p/o.le-v7-g/xandos" entry="true" type="Qnx/Elf">xandos</asset>
       <asset entryPointId="XandOsDroid" path="../xandosdroid/arm-p/xandosdroid" type="Qnx/Elf">xandosdroid</asset>
    </configuration>
    <configuration name="Simulator-Debug">
       <platformArchitecture>x86</platformArchitecture>
       <asset entryPointId="XandOs" path="x86/o-g/xandos" entry="true" type="Qnx/Elf">xandos</asset>
       <asset entryPointId="XandOsDroid" path="../xandosdroid/x86/xandosdroid" type="Qnx/Elf">xandosdroid</asset>
    </configuration>
    
    <!--  Unique author ID assigned by signing authority. Required if using debug tokens. -->
    <!-- <authorId>ABC1234YjsnUk235h</authorId> -->
   
    <initialWindow>
        <aspectRatio>portrait</aspectRatio>
        <autoOrients>false</autoOrients>
        <systemChrome>none</systemChrome>
        <transparent>false</transparent>
    </initialWindow>
    
    <cascadesTheme>dark</cascadesTheme>
    
    <!--  The icon for the application, which should be 114x114. -->
    <icon>
        <image>icon.png</image>
    </icon>

    <asset path="icon.png">icon.png</asset>
    <asset path="assets">assets</asset>
    
    <!-- Locale support -->
    <asset path="translations" dest="qm">
        <include name="*.qm"/>
    </asset>
    
    <!-- Request permission to execute native code.  Required for native applications. -->
    <permission system="true">run_native</permission>
    <permission system="true">_sys_run_headless</permission>
    <env var="LD_LIBRARY_PATH" value="app/native/lib:/usr/lib/qt4/lib"/>
    
    <entryPoint id="XandOs">
        <name>XandOs</name>
    </entryPoint>
    
    <entryPoint id="XandOsDroid">
        <name>Headless XandOs Droid</name>
        <entryPointType>Qnx/Elf</entryPointType>
    </entryPoint>
    
    <invoke-target id="com.example.xandos.droid">
      <invoke-target-type>application.headless</invoke-target-type>
       <invoke-target-name>Headless xandos droid</invoke-target-name>
       <entry-point-id>XandOsDroid</entry-point-id>      
       <filter>
             <action>bb.action.START</action>
             <mime-type>*</mime-type>
             <property var="uris" value="headless:"/>
       </filter>
       <filter>
             <action>bb.action.STOP</action>
             <mime-type>*</mime-type>
             <property var="uris" value="headless:"/>
       </filter>
    </invoke-target>
</qnx>

 

headlessservice

<?xml version="1.0" encoding="utf-8" standalone="no"?>
<!--
  
   Copyright (c) 2011, 2012, 2013 Research In Motion Limited.
  
   Licensed 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.
  
-->
<qnx xmlns="http://www.qnx.com/schemas/application/1.0">

<!-- BlackBerry 10 application descriptor file.

    Specifies parameters for identifying, installing, and launching native applications on BlackBerry 10.

-->

    <!-- A universally unique application identifier. Must be unique across all BlackBerry 10 applications.
         Using a reverse DNS-style name as the id is recommended. (Eg. com.example.ExampleApplication.) Required. -->
    <id>com.example.headlesserviceui</id>

    <!-- The name that is displayed in the BlackBerry 10 application installer. 
         May have multiple values for each language. See samples or xsd schema file. Optional. -->
    <name>headlesserviceui</name>
    
    <!-- A string value of the format <0-999>.<0-999>.<0-999> that represents application version which can be used to check for application upgrade. 
         Values can also be 1-part or 2-part. It is not necessary to have a 3-part value.
         An updated version of application must have a versionNumber value higher than the previous version. Required. -->
    <versionNumber>1.0.0</versionNumber>

    <!-- Fourth digit segment of the package version. First three segments are taken from the 
         <versionNumber> element.  Must be an integer from 0 to 2^16-1 -->
    <buildId>1</buildId>
                 
    <!-- A string value (such as "v1", "2.5", or "Alpha 1") that represents the version of the application, as it should be shown to users. Optional. -->
    <!-- <versionLabel></versionLabel> -->

    <!-- Description, displayed in the BlackBerry 10 application installer.
         May have multiple values for each language. See samples or xsd schema file. Optional. -->
    <description>The headlesserviceui application</description>

    <!-- Copyright information. Optional. -->
    <!-- <copyright></copyright> -->

    <!--  Name of author which is used for signing. Must match the developer name of your development certificate. -->
    <author>Example Inc.</author>
    <configuration name="Device-Debug">
       <platformArchitecture>armle-v7</platformArchitecture>
       <asset entryPointId="HeadlesserviceUi" path="arm/o.le-v7-g/headlesserviceui" entry="true" type="Qnx/Elf">headlesserviceui</asset>
       <asset entryPointId="Headlesservice" path="../headlesservice/arm/headlesservice" type="Qnx/Elf">headlesservice</asset>
    </configuration>
    <configuration name="Device-Release">
       <entryPointType>Qnx/Cascades</entryPointType>
       <platformArchitecture>armle-v7</platformArchitecture>
       <asset entryPointId="HeadlesserviceUi" path="arm/o.le-v7/headlesserviceui.so" entry="true" type="Qnx/Elf">headlesserviceui.so</asset>
       <asset entryPointId="Headlesservice" path="../headlesservice/arm/headlesservice" type="Qnx/Elf">headlesservice</asset>
    </configuration>
    <configuration name="Device-Profile">
       <platformArchitecture>armle-v7</platformArchitecture>
       <asset entryPointId="HeadlesserviceUi" path="arm-p/o.le-v7-g/headlesserviceui" entry="true" type="Qnx/Elf">headlesserviceui</asset>
       <asset entryPointId="Headlesservice" path="../headlesservice/arm-p/headlesservice" type="Qnx/Elf">headlesservice</asset>
    </configuration>
    <configuration name="Simulator-Debug">
       <platformArchitecture>x86</platformArchitecture>
       <asset entryPointId="HeadlesserviceUi" path="x86/o-g/headlesserviceui" entry="true" type="Qnx/Elf">headlesserviceui</asset>
       <asset entryPointId="Headlesservice" path="../headlesservice/x86/headlesservice" type="Qnx/Elf">headlesservice</asset>
    </configuration>
    
    <!--  Unique author ID assigned by signing authority. Required if using debug tokens. -->
    <!-- <authorId>ABC1234YjsnUk235h</authorId> -->
   
    <initialWindow>
        <autoOrients>true</autoOrients>
        <systemChrome>none</systemChrome>
        <transparent>false</transparent>
    </initialWindow>
    
    <!--  The icon for the application, which should be 114x114. -->
    <icon>
        <image>icon.png</image>
    </icon>

    <asset path="icon.png">icon.png</asset>
    <asset path="assets">assets</asset>
    
    <!-- Locale support -->
    <asset path="translations" dest="qm">
        <include name="*.qm"/>
    </asset>
    
    <entryPoint id="HeadlesserviceUi">
        <name>HeadlesserviceUi</name>
    </entryPoint>
    <entryPoint id="Headlesservice">
        <name>Headlesservice</name>
        <entryPointType>Qnx/Elf</entryPointType>        
    </entryPoint> 
    
    <invoke-target id="com.example.headlesservice">
      <invoke-target-type>application.headless</invoke-target-type>
       <invoke-target-name>Headless Service</invoke-target-name>
       <entry-point-id>Headlesservice</entry-point-id>
      <filter>
             <action>bb.action.system.STARTED</action>
             <mime-type>application/vnd.blackberry.system.event.STARTED</mime-type>
             <property var="uris" value="data&colon;//local"/>
       </filter>
    </invoke-target>
    
    <!-- Request permission to execute native code.  Required for native applications. -->
    <permission system="true">run_native</permission>
    <permission system="true">_sys_run_headless</permission>
    <permission system="true">_sys_headless_nostop</permission>
    <permission>access_led_control</permission>
    <env var="LD_LIBRARY_PATH" value="app/native/lib:/usr/lib/qt4/lib"/>
</qnx>

 

 

 

Shadid

New Developer
Shiryu
Posts: 13
Registered: ‎09-26-2013
My Device: z10

Re: Unable to get headless apps working

It works now

 

Thank you Shadid :Clap:

Contributor
bryanwang
Posts: 22
Registered: ‎03-01-2010
My Device: Z10

Re: Unable to get headless apps working

Hi Shadid,

 

When I add  cascades10 to my service project config and build the release build, the make file template changed from app to lib. It works fine in debug build but the releae build (.so) will not start on the device. We need cascades10 for sql library and from the compiler output it seems some of the bb library needs cascades as well. Please advise, thanks!

 

Regards,

Bryan

Developer
Royster86
Posts: 102
Registered: ‎03-13-2012
My Device: 9360, P'9981, Z10

Re: Unable to get headless apps working

Bryan, have you tried using just cascades and not cascades10? I do some DB stuff via and external library and it seems to work.
Contributor
bryanwang
Posts: 22
Registered: ‎03-01-2010
My Device: Z10

Re: Unable to get headless apps working

Hi Royster86,

 

Yes! It works, thanks a lot!.

 

Cheers,

Bryan