App development guidelines
When you develop core apps for the BlackBerry 10 OS, it's important that your apps don't consume unnecessary resources on a BlackBerry 10 device. Apps that don't follow these guidelines may be removed from the BlackBerry World storefront.
Best practices for app behavior
The following list provides examples of best practices for app behavior.
- Change the app orientation when the BlackBerry 10 device rotates.
- Show the application menu when the user swipes down from the top bezel.
- Perform clean-up of system resources upon exiting, such as freeing allocated memory, stopping all processes used by your app, removing temporary files, closing file descriptors, and so on.
- Stop the rendering of graphics when your app isn't active or when the device enters sleep mode.
- React in a timely manner to events such as being minimized or deactivated. In addition, ignore events that aren't applicable to your app. This practice protects your app if new events are generated in future releases of the OS.
- Handle cases where other apps consume device resources.
- Handle cases where the audio buffer underruns in your app to avoid audio PCM playback issues. For example, see the PlayWav sample.
- Save the state of your app in the sandbox, where applicable, so your app can resume from the previous state.
- Handle app life-cycle events to ensure a longer battery life. For example, you should handle the WINDOW_INACTIVE event to place the app in a suspended state.
- Use a unique window group name when using Screen APIs.
- Check the audio hardware block sizes to ensure that block sizes match when audio data is written for playback. Don't assume that the block size remains static between releases.
Best practices for testing
The following list provides examples of best practices for testing. You can also review the Built for BlackBerry checklists and testing plans.
- Test your app under a high system load to ensure that it handles the high loads correctly.
- Monitor files and devices that your app uses to ensure that it behaves as expected.
- Test your app under different system states, such as orientation changes, heavy stress conditions, and minimization, to ensure that your app behaves as expected.
- Monitor CPU load and memory usage when your app is running and when in an inactive state to ensure that your app behaves as expected.
Best practices for submitting your app to BlackBerry World
The following list provides best practices for submitting your app to BlackBerry World. To understand the criteria for submitting your app to BlackBerry World, see Built for BlackBerry Criteria.
- Compile your app with the relevant compiler defenses, such as PIC/PIE and -fstack-protector flags to enhance security. For more information, see Using compiler and linker defenses.
- Compile your app without debug information before submitting it. If you compile your app with debug information, your app may be slower.
- Sign your app. For more information, see Signing apps.
- Specify an icon for the app.
- Build application binaries for the armle-v7 architecture. Current devices use the armle-v7 architecture, while the BlackBerry 10 Device Simulator uses the x86 architecture.
Prohibited app behavior
Your app must not disrupt service to, or prevent the operation of, other apps. In addition, your app must not gather information that leads to exploitation or loss of privacy. Your app must not gain unauthorized access to system resources or otherwise operate in any manner that may be considered intrusive or abusive. The following list identifies some prohibited app behavior.
- Don't read or write files outside of the application sandbox, unless your app makes calls to public APIs.
- Don't manipulate process information. Process information includes priority, thread priority, process user ID, group ID, process group, parent process, and so on.
- Don't store nonessential files in the shared directory. For example, don't store executable code (including libraries and interpreted code), temporary files, and private files (such as files that only your app reads).
- Don't change the file permissions.
- Don't prevent the dimming of the backlight or prevent the device from entering sleep mode unnecessarily.
- Don't show disturbing or adult graphics or play sounds without user consent.
- Don't create busy loops.
- Don't try to acquire information by phishing. For example, don't ask for device password, PIN, or other confidential information.
- Don't operate in a manner that could breach user privacy without user consent or authorization, such as sending information to Internet servers or listening to sockets.
- Don't manipulate Persistent Publish/Subscribe (PPS) objects directly. The use of PPS objects with the BlackBerry 10 Native SDK isn't supported. Instead, use the BlackBerry Platform Services (BPS) library APIs.
- Don't statically link your apps against the system libraries. Statically linked system libraries may cause your apps to stop responding.
- Don't use undocumented APIs. Undocumented APIs are unsupported and can cause your app to crash unexpectedly when users upgrade the BlackBerry 10 OS.
Last modified: 2014-06-24