How to implement headless app with BlackBerry 10.2 OS - blackberry-10

I want to get an idea of how to implement a long running headless application with BlackBerry 10.2 OS. I don't need any complex function to happen in the background. I need only to print a Console out-put.
I have used the QTimer class and at this moment it prints a console out put when the application in foreground and in thumbnail mode.
connect(timer, SIGNAL(timeout()), this, SLOT(update()));
But when I exit from the application, the whole application destroyed. The above code and the update() function is in a separate C++ class that is not interacting with a UI.
I have given following permissions in the bar-descriptor.xml file too.
<permission>run_when_backgrounded</permission>
<permission system="true">_sys_run_headless</permission>
<permission system="true">_sys_headless_nostop</permission>
How to make this app run in background even when the application destroyed?
Thanks

See this: http://developer.blackberry.com/native/documentation/cascades/device_platform/headless_apps/
The long and short of it is that what you're trying to do (have an application run indefinitely) requires analysis and approval by BlackBerry.
If on the other hand, it is acceptable to have your application triggered in response to a system event (e.g. E-mail received) then this is possible.

There is a Push Enabled Headless App Example, in Github Cascades Samples but I couldn't make it works.
On the other hand, there is a pretty Tic-Tac-Toe Headless App Example and it works fine for me:
Source:
https://github.com/blackberry/Cascades-Samples/tree/master/xandos
https://github.com/blackberry/Cascades-Samples/tree/master/xandosdroid
I just had to add reference the project 'Xandosdroid' to the project 'Xandos'. Before it giving me this error when packaging and deploying 'Xandos' project to the device:
Packaging failed: 1 Error: Invalid asset path
"../xandosdroid/arm/o.le-v7-g/xandosdroid"

Related

possible way to run actual application

I am making a testing scenarios using Ogurets framework which is cucumber + gherking combination.
The tests are for Flutter application written in Dart language.
I recently figured out that test driver does not execute actual app. For example in my case:
I have and app where is a Login feature. After navigating to Logout and clicking on it, app does not return the login screen(it does back-end work though), but when I execute actual app through main.dart file and not using Ogurets configuration everything works as expected.
So I was wondering,
Is there any possible way to execute actual app during testing scenario? Lets say It can execute release version of the app.
Not sure if it makes sense.
Thx for possible tips
So when Ogurets runs, it will execute a command to "flutter run" your application, and using the standard mechanism for Flutter Driver, it will create a tcp link between your running application and the Ogurets code. But to do this, you have to have the extra Flutter Driver code enabled in your application, so it is not possible to run your "actual app", otherwise this TCP link will not form.
Over this TCP link standard Flutter Driver commands are executed and you can also execute extra commands. So your actual app is being executed as if you are running it using "flutter run" - and you can even run it on a real device this way, but it can never be your released application as it will not have this extra TCP link code.
If you are having trouble understanding why your application is operating like this, the documentation for Ogurets Flutter does indicate how you can run and debug the two sides of the application, so you can be running your Flutter App in debug mode and then run your tests, have it connect and automate the app and then debug why it isn't coming back to your login page. This is what I would recommend you do.

Changes made to app are not being retained once run session ends

Let's say I'm connected to an actual device, making multiple changes to my app and hot-reload/restart is doing its thing and life's all good. Once I'm satisfied with changes I hit the stop button.
Now, if I pick up the phone and launch the app - it will be an older version of the app that doesn't contain the changes just implemented.
In order to get most recent changes I have to uninstall app from the phone and then go back into the IDE (VSC) and run the app once more to get the latest changes.
Is there a configuration setting that allows you to avoid having to do this?
It is my understanding that while you are developing, and hot-reloading/restarting, you are working on the Dart Virtual Machine. So if you don't make a full build and install the APK on your device then once you close the development build you are working on the VM closes and the code that was running on it is lost.
To answer your question, there is no configuration that you can set to have what is running on the VM to be on the APK without a full build.

How can you detect runtime errors on flutter applications and log them while testing the app on iOS platform?

We tried to use speech recognition package - https://pub.dev/packages/speech_recognition in our flutter application along with other packages. The app was built successfully and installed, but we could see only a white screen on the iOS device. There was no error log that could tell us that this package created a problem. Once this module was removed we were able to see the application on the phone. This was done by manually checking for each package. I wanted to know if there is any runtime error handling methodology that could be used to log runtime errors and generate a logfile.
We are still researching on this issue, so we havent executed anything. Any suggestions would be welcome.

The app could not be located

i integrated crashlytics into my unity game, everything worked fine, but then i had to change my package name and my working mail, since then whenever i open the dashboard it gives me an alert "Sorry the app could not be located".
I reinstalled the crashlytics sdk in unity, used new login in prepare fabric tab, but the issue is still there, although the crashlytics seems to be working.
Thanks. Usually this means we aren't detecting the build and run event. Please make sure you are building and running in the relevant IDE. Also, clean your app and dependencies in the native IDE to make sure the bundle ID is updated in all locartions. If you still run into issues, you will need to contact support as your app may be in a weird state in our system.

MonoTouch on Device - Vibrates at launch?

I just deployed my app to my iPhone for the first time. Every time it launches it vibrates before running, and it runs fine. The build is a Debug | iPhone one of my app.
Any ideas why it vibrates when it launches and how to stop that? It's definitely not something I coded up and I don't have any exceptions or issues when running in the simulator.
The vibration happens when you build the application in debug mode, and run the application without a debugger waiting. The MonoTouch soft debugger vibrates to inform you that it couldn't find the debugger.
Running the app in Release | iPhone mode solves this.
The number of vibrations is used to notify the user of a problem setting up debugging at startup. The full list (that will be maintained as we expand or modify it) is here:
http://monotouch.net/index.php?title=Documentation/Debugging
As of today:
Device Diagnostics
An application compiled with debug mode that has been deployed on the iPhone will try to contact MonoDevelop on startup on the IP address and port that MonoDevelop had at the time of the build.
If there is an error setting up the debugger, it will vibrate one of more times:
One vibration: The application was compiled with debugging support, but it is unable to reach MonoDevelop on the specified IP address and port to setup stdout/stderr
Two vibrations: It is unable to parse the address configured.
Three vibrations: Could not setup stdout/stderr to the application.