How To Squash ‘Unresponsive’ or ‘Unable To Terminate’ Errors When Debugging your BB10 App on Device
THERE ARE TWO WAYS TO RESOLVE THESE ERRORS
1) Restart your BB10 Dev Alpha, then turn Dev Mode on (take a few mins)
2) Kill the app manually via Momentics IDE I will show you how to quickly kill the app using the following steps. Follow along. (take a few seconds)
Open Target Navigator
Window - Show View - Target Navigator
Locate Device Process
Go Under Device Ip - Select Process
Send Signal To Application
Go Under Device Ip - Select Process - Right Click - Click Deliver Signal
Terminal Process/App Manually
Select SIGTERM option - Press OK
That’s it!
After you send the SIGTERM (Signal Terminate) your unresponsive app will disappear from the BB10 device. Success! Now, build (CTRL+B), deploy (CTRL+11) and test again.
Debug BB10 Headless Apps is really a hard topic for developers.
Before the latest Momentics update, debug is even harder..
By Momentics 2.1.2, developers can follow this instruction to debug your headless apps.
https://developer.blackberry.com/native/documentation/dev/tools/debugging_headless_apps.html
Here I am going to share my experience for debugging headless apps.
I put the logs into notification and show them in Hub!
If you have some problems on debugging headless apps on BlackBerry 10, maybe this trick can help you and save lots of time! :)
GOGOGO, keep developing on BlackBerry 10!
Sometimes we need to keep our app always awake (not dim due to the Screen timeout).
How to make this happen?
The answer is ver simple :D
Jusy put the code into your QML file
Application.mainWindow.screenIdleMode = 1
(1 means KeepAwake, and 0 means Default).
Please be careful, this effect only works when the app is in full screen mode
Once you minimize the app (in Active Frame mode), the screen will still follow the screen timeout rule to dim.
Hope you enjoy this trick!
Simon
Sometimes we may need to change the brightness of screen in code.
How to make it happen?
Using the QProcess can help you to do that!
QString program = "bkltctl";
QProcess myProcess = new QProcess(this);
QStringList arguments;
arguments << "brightness" << "set_brightness" << "display" << "50"; (50 is the value you want).
myProcess->start(program, arguments);
PS. You may need to connect SINGAL readyReadStandardError(), readyReadStandardOutput() and finished(int, QProcess::ExitStatus) in order to get the output error or result. :)
Enjoy it!
In C++, need to import LIBS += -lbbsystem
QString text;
bb::system::Clipboard clipboard;
clipboard.clear();
QByteArray byte;
byte = text.toLocal8Bit();
clipboard.insert(“text/plain”,byte);
Remember, the Clipboard need insert QByteArray type.
We can define the String as QByteArray in order to use the Clipboard.
If you need to use some special characters, don't forget to use this line
byte = text.toLocal8Bit();
Here is the official API reference :)
http://developer.blackberry.com/cascades/reference/bb__system__clipboard.html