10-22-2013 03:35 PM
I've just been granted the long running app permission, however I'm not having much luck with the examples.
I firstly tried to edit my existing projects into two parts by following https://developer.blackberry.com/native/documentat
- didn't have any luck there, so I instead started with two clean projects and worked through the steps. However, I get the same result.
The background process is never invoked. I set a breakpoint on the:
qDebug() << "Hello Headless App" << endl;
line, but it is never reached. My understanding is that as I have the system started action, that this should fire off as soon as the app is debugged.
Im using the latest 10.2 SDK and the latest device software (dev alpha c).
I also looked in the device log to see if there was anything wrong, but I don't see any errors - I also do not see the background app running in the process stack in the debug view.
I feel as though I'm missing something obvious (this is my first time using the invokation framework).
I've built the background project in debug mode, and then built and debugged the main ui app.
My entire bar descriptor is below - I have also removed the assets folder and the bar descriptor from the BackgroundApp project.
<?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.ForegroundApp</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>ForegroundApp</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 ForegroundApp 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</platformArchitectu
re> <asset path="arm/o.le-v7-g/ForegroundApp" entry="true" type="Qnx/Elf">ForegroundApp</asset> <asset entryPointId="BackgroundApp" path="../BackgroundApp/arm/BackgroundApp" type="Qnx/Elf">BackgroundApp</asset> </configuration> <configuration name="Device-Release"> <entryPointType>Qnx/Cascades</entryPointType> <platformArchitecture>armle-v7</platformArchitectu re> <asset path="arm/o.le-v7/ForegroundApp.so" entry="true" type="Qnx/Elf">ForegroundApp.so</asset> </configuration> <configuration name="Device-Profile"> <platformArchitecture>armle-v7</platformArchitectu re> <asset path="arm-p/o.le-v7-g/ForegroundApp" entry="true" type="Qnx/Elf">ForegroundApp</asset> </configuration> <configuration name="Simulator-Debug"> <platformArchitecture>x86</platformArchitecture> <asset path="x86/o-g/ForegroundApp" entry="true" type="Qnx/Elf">ForegroundApp</asset> </configuration> <!-- Unique author ID assigned by signing authority. Required if using debug tokens. --> <!-- <authorId>...</authorId> --> <entryPoint id="ForegroundApp"> <name>ForegroundApp</name> </entryPoint> <entryPoint id="BackgroundApp"> <name>BackgroundApp</name> </entryPoint> <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> <!-- 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> <env var="LD_LIBRARY_PATH" value="app/native/lib:/usr/lib/qt4/lib"/> <invoke-target id="com.example.ForegroundApp"> <invoke-target-type>application</invoke-target-typ e> <invoke-target-name>ForegroundApp</invoke-target-n ame> <entry-point-id>ForegroundApp</entry-point-id> </invoke-target> <invoke-target id="com.example.BackgroundApp"> <invoke-target-type>application.headless</invoke-t arget-type> <invoke-target-name>BackgroundApp</invoke-target-n ame> <entry-point-id>BackgroundApp</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://local"/> </filter> </invoke-target> </qnx>
10-22-2013 05:14 PM
10-23-2013 04:30 AM
It works only device-debug BUT it doesn't work with device-release
I also removed "<permission system="true">_sys_headless_nostop</permission>" for testing short running app BUT still doesn't work as well.
10-23-2013 04:38 AM
10-23-2013 04:52 AM
I have tested with headless app and found that auto start headless app will work only "device-debug" with the latest firmware version 10.2.0.1793.
And thank you for your help to test in release version
10-23-2013 01:37 PM
10-23-2013 04:20 PM
OK, now I really am confused.
Since yesterday, I'm now trying to re-run the projects I created, and now none of them working.
I even re-downloaded the headlesserviceui projects and this isn't working, even in debug mode.
Yesterday when I ran the code, I got the flashing blue LED (run by the background process) and in the app GUI there was a green box, with a flash counter and a remaining count, which would decrease until the "Restart" button was pressed.
Now I get a red box with "N/A" written in it, Flashcount: 0 and RemainingCount: -1.
Hitting the reset button sets the RemainingCount to 0. There is now no blue LED.
I've tried putting different firmware on the handset, but even after reverting to the same firmware I was on yesterday, the same thing happens. I also checked my debug token and it seems correct.
10-23-2013 04:39 PM