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!
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.
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 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);
arguments << "brightness" << "set_brightness" << "display" << "50"; (50 is the value you want).
PS. You may need to connect SINGAL readyReadStandardError(), readyReadStandardOutput() and finished(int, QProcess::ExitStatus) in order to get the output error or result. :)
-- Updated 2014-07-04 --
If you downloaded the sample project yesterday, you need to re-download the project.
This version fix the "applicationUI.hpp" can't be found problem.
And, don't forget this or your will got an erro of "cannot find -lSmaatoSDKDevice"
The Smaato static library included within the sample is from Smaato SDK for BlackBery 10 v1.1.2. To ensure you are running the latest, please download the latest SDK for Smaato's website and replace the SmaatoSDK folder within the project.
BlackBerry announced Smaato as their new Advertisement service partner on BlackBerry 10.
I've used Smaato in my apps for a long time (since 2013/10, after Jam Asia).
Let's see how to integrated Smaato SDK into your Cascades apps!
1. Read the introduction about Smaato!
2. Download the Smaato sample project from BlackBerry Github
3. Download the Smaato SDK
4. Build the project and see how the AD works!
5. Input your own adSpaceId and publisherId and check the advertisements in your apps!
That's it! Actually it is really an easy way to put Ads in your apps.
You can also add more filters/ restrictions to help they provide much more precisely ads for your apps.
Sometimes due to the fillrate or regional issue, you may not receive ads...
Don't worry, try to change the category of ads you'd like to show.
Enjoy this new AD Service on BlackBerry 10!
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...
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!
As a developer, I think many other developers may think how to teach users to use my application
We provide screenshots of the apps when we upload to any app markets, some devs will also record a video to tell users who to operate.
The most common way is to put a "Guide Page" inside the app, not just "Tips", but a continuous information to let user understand the major features.
There are three kinds of implementations here.
1. Use a scrollview with a super large image
You can simply scroll from left to right, put a button at the last page to close this Guide Page.
The image may be too large, and hard to change / modify parts.
2. Use a scrollview with several images
You can simply scroll from left to right, put a button at the last page to close this Guide Page, can change parts easier than first method.
Still hard to change / modify parts.
3. Use a scrollview with custom containers
Custom containers are much more flexible
I don't know, haha!
Here are the sample from Github
For Cascades 10.1 /10.2 SDK
For Cascades 10.3 SDK
In AppGuidePageDesignUnit project, I rewrite the project with design unit to support even Q30 (Passport), not just pixel related.
If you also want to learn use design unit, you can also check this project :D
If you have any problem, just send me a mail!
Hope you will enjoy the sample!
Developing on BlackBerry 10 is very easy in many phases.
By Native C/C++, HTML5, Adobe AIR, or Android, developers can easily bring their apps to this new platform.
I like to create "Hybrid App" on BlackBerry 10, whichcontains HTML5 and the native Cascades UI Framework.
The reason why I choose using hybrid apps are because by HTML5 I can do some drawing things, and by Cascades framework I can make my apps have uniformed UI and also the awesome native APIs!
Basically hybrid apps are using webview to load html files, but how can we debug the HTML code when them be wrapped into webview?
The answer is very easy! Use the WebInspector!
Check the QML properties of WebView component, checked the "Web Inspector Enabled".
Next, you can simply connect your devices / simulator to the computer, open the browser and type:
For USB connection: 169.254.0.1:1337
For Simulator of Wifi conection: IP + port 1337
The view of connecting to webinspector
Click into it and you can see the console!
See, is that easy?
Come and try to debug in WebInspector now :D
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
std::fprintf(stdout, "%s\n", msg);
Second：Inset snippet after Application app(argc, argv);
Here are the whole code snippets
Enjoy all your dubeg messages! ^^
How To Squash ‘Unresponsive’ or ‘Unable To Terminate’ Errors When Debugging your BB10 App on Device
THERE ARE TWO WAYS TO RESOLVE THESE ERRORS
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
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.
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
M4A: audio/m4a, audio/mp4
MIDI: audio/midi, audio/mid, audio/x-midi, audio/x-mid
WAV: audio/wav, audio/x-wav
In C++, need to import LIBS += -lbbsystem
byte = text.toLocal8Bit();
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 :)