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
Highlighted
Developer
Posts: 1,632
Registered: ‎07-14-2008
My Device: Z10
My Carrier: Fido

Re: Unable to get headless apps working


Royster86 wrote:
Thanks smiley, good to know I'm not the only one Smiley Happy

I've to struggling with headless apps for months now.  My apps still does not restart at times and users have reported that the Headless apps crashes after 10 hours and yet on my Z10 and Z30 and it runs fine.  Hopefully 10.3 will fix some of the issues.

Developer
Posts: 68
Registered: ‎03-18-2014
My Device: Z10
My Carrier: T-Mobile

Re: Unable to get headless apps working

[ Edited ]

Hi,

 

If I may ask, I also have the same issue: I have no difficulties to start the headless application in debug mode, but in release it does not start.

 

I saw the solution on page 2, but there is something I dont understand:

 

in my headless app, if I have something like this:

    <configuration name="Device-Release">
       <entryPointType>Qnx/Cascades</entryPointType>
       <platformArchitecture>armle-v7</platformArchitecture>
       <asset path="arm/o.le-v7/Headless.so" entry="true" type="Qnx/Elf">Headless.so</asset>
    </configuration>

 

Then it build a ".so" file.

 

And then I wont be able to do something like this in the UI bar descriptor:

    <configuration name="Device-Release">
       <entryPointType>Qnx/Cascades</entryPointType>
       <platformArchitecture>armle-v7</platformArchitecture>
       <asset entryPointId="UI" path="arm/o.le-v7/UI.so" entry="true" type="Qnx/Elf">UI.so</asset>
       <asset entryPointId="Headless" path="../Headless/arm/o.le-v7/Headless" type="Qnx/Elf">Headless</asset> 
    </configuration>

 which is what is described in page 2 and in the examples in the documentation, because it complains that "Headless" does not exists. Which is true. "Headless.so" exists, but not "Headless".

 

So if I tried to update the bar-descriptor of the UI to 

    <configuration name="Device-Release">
       <entryPointType>Qnx/Cascades</entryPointType>
       <platformArchitecture>armle-v7</platformArchitecture>
       <asset entryPointId="UI" path="arm/o.le-v7/UI.so" entry="true" type="Qnx/Elf">UI.so</asset>
       <asset entryPointId="Headless" path="../Headless/arm/o.le-v7/Headless.so" type="Qnx/Elf">HeadlessHg</asset> 
    </configuration>

 I just added the extension ".so". In that case it stops complaining, and install the application on the device. But the headless process does not start... 

 

Am I missing something? 

 

Thanks a lot!

 

 

You can also find my complete bar-descriptor there:

UI: https://github.com/amonchakai/Hg10/blob/master/bar-descriptor.xml

Headless: https://github.com/amonchakai/HeadlessHg/blob/master/bar-descriptor.xml

 

 

 

Developer
Posts: 188
Registered: ‎09-03-2012
My Device: Blackberry 10

Re: Unable to get headless apps working

[ Edited ]

The crash is usually due to memory leak.

 

Track it on your eclipse and see the memory level after you do certain massive operation.

Developer
Posts: 188
Registered: ‎09-03-2012
My Device: Blackberry 10

Re: Unable to get headless apps working

You can download the example and copy what they do?
Developer
Posts: 188
Registered: ‎09-03-2012
My Device: Blackberry 10

Re: Unable to get headless apps working

In the headless: should be .so

In the main app:

<entryPoint id="appnameheadless">
<name>appnameheadless</name>
<entryPointType>Qnx/Elf</entryPointType>
</entryPoint>

In device release section:

<asset entryPointId="appnameheadless" path="${workspace_loc:/appnameHeadless/arm/appnameheadless}" type="Qnx/Elf" >appnameheadless</asset>

In invoke target section:

<invoke-target id="com.companyname.appnameheadless">
<invoke-target-type>application.headless</invoke-target-type>
<invoke-target-name>appnameHeadless</invoke-target-name>
<entry-point-id>appnameheadless</entry-point-id>
... filter section
Developer
Posts: 68
Registered: ‎03-18-2014
My Device: Z10
My Carrier: T-Mobile

Re: Unable to get headless apps working

Thanks for your reply. 

 

However it is already what I am doing. 

 

I would like to add that the configuration in other sections than release seems good, because when I compile & deploy in debug, the headless start on the device.

Therefore I believe things related to entryPoint & invoke-target are OK since they do not depend on the relase/debug mode. 

 

 

But for release mode, if I provide the path:

${workspace_loc:/appnameHeadless/arm/appnameheadless}

 

in the device section, I will refuse to make the ".bar" file because in releae the file

${workspace_loc:/appnameHeadless/arm/appnameheadless}

does not exists, but

${workspace_loc:/appnameHeadless/arm/appnameheadless.so}

does

 

If I choose to give a url:

${workspace_loc:/appnameHeadless/arm-g/appnameheadless}

Then it works, because in debug mode the build is "appnameheadless", not "appnameheadless.so". 

But in that case, I have the UI in release mode and headless is the result of a compilation in debug mode... 

 

In my view, what momentic does make sense. I understand that it rejects the path:

${workspace_loc:/appnameHeadless/arm/appnameheadless}

And I am suprise that you & the doc say it should be like this...

 

And if I provide something like this for the path:

${workspace_loc:/appnameHeadless/arm/appnameheadless.so}

Then it accepts it, will build the bar, but the headless won't start. 

 

I hope you understand my point. 

 

Thanks a lot for the help

Retired
Posts: 249
Registered: ‎07-14-2008
My Device: Not Specified

Re: Unable to get headless apps working

Have you tried creating a headless project using the headless template in the IDE? You can do so by doing File > New BB Project > Headless.

I mention this because then you can compare the two bar descriptors and see if there is anything wrong that we might be missing so far.

If the issue is still not resolved, please send an email to headlessdevsupport@blackberry.com with the bar-descriptor file. I will take a look.

Thanks.

Shadid
Developer
Posts: 68
Registered: ‎03-18-2014
My Device: Z10
My Carrier: T-Mobile

Re: Unable to get headless apps working

Thanks a lot for your reply.

 

I did as you recommended and created a new headless project. This way, I got an example of the bar-descriptor. 

I did not see a difference with what I was doing, but I think another issue was related to the way I created the headless application.

 

Since I added the headless as an incremental step in the development of my project, I created the headless project using a cascade "standard empty project", that I changed as it is described in the doc to get an headless app'. 

 

And maybe I missed something while doing it...

 

 

So in the end, I created a headless project using the IDE. Which setup both UI, and headless part. Added my files into this new project, and now everything looks fine. Moreover, now it handle much better the dependencies between the two projects, which make the overall work much easier. 

 

So thanks again for the help, now everything seems solved. 

 

Cheers