Just use some simple steps can let you check debug messages!
Open the main.cpp in your project. Only need to add two code snippets!
-
First: Insert this before int main
void myMessageOutput(QtMsgType type, const char* msg)
{
std::fprintf(stdout, "%s\n", msg);
std::fflush (stdout);
} -
Second:Inset snippet after Application app(argc, argv);
qInstallMsgHandler(myMessageOutput);
-
Here are the whole code snippets
void myMessageOutput(QtMsgType type, const char* msg) { std::fprintf(stdout, "%s\n", msg); std::fflush(stdout); } Q_DECL_EXPORT int main(int argc, char **argv) { Application app(argc, argv); qInstallMsgHandler(myMessageOutput); // localization support QTranslator translator; QString locale_string = QLocale().name(); QString filename = QString( "YourApp_%1" ).arg( locale_string ); if (translator.load(filename, "app/native/qm")) { app.installTranslator( &translator ); } new YourApp(&app); return Application::exec(); }
Enjoy all your dubeg messages! ^^
Yesterday I saw an article about visual comparsion of iOS 8 beta and Android L from redmondpie
http://www.redmondpie.com/ios-8-beta-vs-android-l-side-by-side-visual-comparison-screenshots/
I started to think, why not add BB10 into the comparison?
After several hours hard working, I took screenshots on my BlackBerry 10.2.1.2977 OS and BlackBerry 10.3.0.700 OS...
Actually many good features on BlackBerry 10 also be implemented to iOS / Android.
But until now, I still think BlackBerry Hub is the best notification center :D
And the Instant Preview on BlackBerry 10 provide me the best way to reply messages :)
All the images below are arranged via the order :
iOS 8 beta / Android L / BlackBerry 10.2.1 / BlackBerry 10.3.0
Thanks for redmonpie's images and ... Here we go!
1. Lock Screen
2. Home Screen
3. Dialers
4. Calendar
5. Calculator
6. Keyboard
7. Quick-toogles-control
8. Setting
9. Multitasking
10. LockScreen-quickReply
11.Notification
If you want to see more comparison, just leave a comment below :)
Enjoy!
Simon
Last Friday I updated my iMac to Mac OS X 10.11 (El Capitan), a nightmare for my whole weekend..
After upgraded, BlackBerry Link no longer recognize my BlackBerry 10 devices.
From Dev Alpha B to Passport.. Just keep showing "Can't connect to your BlackBerry 10 device, press restore.." etc
And then I tried to open my Momentics IDE...
What the....
I think the problem may be the USB driver or connection.
So I did some test.
-
Reinstall Mac OS X 10.11 (El Capitan)
Still has the same problem.
-
Uninstall BlackBerry Link & Blend and reinstall them
Still has the same problem.
-
Only install BlackBerry Link
Oh my God, it works!!
I did more test, but in those tests, once you install BlackBerry Link first and then install the BlackBerry Blend, the connections will all fine!
-
If you don't need BlackBerry Link, simply uninstall it and just use your Momentics for connecting your BB10 device to debug is also a solution.
(But for me, I still need Link for backup/restore and Blend to type in Chinese... Can someone tell me why BlackBerry remove the Zhuyin input method on Passport!!)
Just a simple tips and work around for you guys may occur!
Happy Coding!
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!
MediaPlayer
Steps:
Add bb.multimedia 1.0 in qml file.
Create a MediaPlayer Object.
Set path of file for MediaPlayer. (Need permission for access_shared)
Call the play() function of MediaPlayer. (Need permission Run when background if you want to play music in background).
BlackBerry 10 can support file format below:
AAC: audio/aac, audio/x-aac
AMR: audio/amr, audio/x-amr
FLAC: audio/flac
M4A: audio/m4a, audio/mp4
MIDI: audio/midi, audio/mid, audio/x-midi, audio/x-mid
MKA: audio/x-matroska
MP3: audio/mp3
OGG: audio/ogg
QCP: audio/x-gsm
SPMID: audio/spmid
WAV: audio/wav, audio/x-wav
WMA: audio/x-ms-wma
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