Skip to content

Commit

Permalink
Merge pull request blackberry#15 from jhoffmannrim/next
Browse files Browse the repository at this point in the history
update NDK-Samples for BB 10.0.04
  • Loading branch information
jhoffmannrim committed May 1, 2012
2 parents add7366 + c4dd34f commit 9747854
Show file tree
Hide file tree
Showing 89 changed files with 639 additions and 545 deletions.
12 changes: 6 additions & 6 deletions Accelerometer/bar-descriptor.xml
@@ -1,17 +1,16 @@
<?xml version="1.0" encoding="utf-8" standalone="no"?>
<qnx xmlns="http://www.qnx.com/schemas/application/1.0">

<!-- BlackBerry Tablet OS application descriptor file.
Specifies parameters for identifying, installing, and launching native applications on BlackBerry Tablet OS.
<!-- BlackBerry® 10 application descriptor file.
Specifies parameters for identifying, installing, and launching native applications on BlackBerry® 10 OS.
-->

<!-- A universally unique application identifier. Must be unique across all BlackBerry Tablet OS applications.
<!-- A universally unique application identifier. Must be unique across all BlackBerry® 10 applications.
Using a reverse DNS-style name as the id is recommended. (Eg. com.example.ExampleApplication.) Required. -->
<id>com.example.Accelerometer</id>

<!-- The name that is displayed in the BlackBerry Tablet OS application installer.
<!-- The name that is displayed in the BlackBerry® 10 application installer.
May have multiple values for each language. See samples or xsd schema file. Optional. -->
<name>Accelerometer</name>

Expand All @@ -27,7 +26,7 @@
<!-- A string value (such as "v1", "2.5", or "Alpha 1") that represents the version of the application, as it should be shown to users. Optional. -->
<!-- <versionLabel></versionLabel> -->

<!-- Description, displayed in the BlackBerry Tablet OS application installer.
<!-- Description, displayed in the BlackBerry® 10 application installer.
May have multiple values for each language. See samples or xsd schema file. Optional. -->
<description>The Accelerometer application</description>

Expand Down Expand Up @@ -93,6 +92,7 @@
<!-- <action>post_notification</action> -->
<!-- <action>set_audio_volume</action> -->
<!-- <action>read_device_identifying_information</action> -->
<!-- <action>access_led_control</action> -->

<!-- Ensure that shared libraries in the package are found at run-time. -->
<env var="LD_LIBRARY_PATH" value="app/native/lib"/>
Expand Down
27 changes: 15 additions & 12 deletions Accelerometer/main.c
Expand Up @@ -54,11 +54,13 @@ display_accelerometer_reading(float x, float y, float z)
}

/**
* A sample application demonstrates the BlackBerry Native APIs for
* accelerometer. The sample initializes and reads the accelerometer
* periodically until a NAVIGATOR_EXIT event is received. The application also
* listens for window state changes from the navigator so that it can stop
* reading the accelerometer when the application is no longer visible.
* A sample application demonstrates the BlackBerry(R) 10 Native SDK APIs for
* accelerometer.
*
* The sample initializes and reads the accelerometer periodically until a
* NAVIGATOR_EXIT event is received. The application also listens for window
* state changes from the navigator so that it can stop reading the
* accelerometer when the application is no longer visible.
*/
int
main(int argc, char *argv[])
Expand All @@ -69,8 +71,8 @@ main(int argc, char *argv[])
float force_x, force_y, force_z;

/*
* Before we can listen for events from the BlackBerry Tablet OS platform
* services, we need to initialize the BPS infrastructure
* Before we can listen for events from the BlackBerry Platform Services, we
* need to initialize the BPS infrastructure
*/
bps_initialize();

Expand All @@ -81,11 +83,12 @@ main(int argc, char *argv[])

/*
* Once the BPS infrastructure has been initialized we can register for
* events from the various BlackBerry Tablet OS platform services. The
* Navigator service manages and delivers application life cycle and
* visibility events.
* For this sample, we request Navigator events so we can track when
* the system is terminating the application (NAVIGATOR_EXIT event). This allows
* events from the various BlackBerry Platform Services. The Navigator
* service manages and delivers application life cycle and visibility
* events.
*
* For this sample, we request Navigator events so we can track when the
* system is terminating the application (NAVIGATOR_EXIT event). This allows
* us to clean up application resources.
*/
navigator_request_events(0);
Expand Down
4 changes: 2 additions & 2 deletions Accelerometer/manifest.properties
Expand Up @@ -34,8 +34,8 @@
# path.other-file.xml: resources/misc/stuff.xml
#

template.name: BlackBerry Tablet OS Example Accelerometer Project
template.description: Create a new BlackBerry Tablet OS Example project to work with the accelerometer.
template.name: BlackBerry® 10 OS Example Accelerometer Project
template.description: Create a new BlackBerry® 10 OS Example project to work with the accelerometer.

project.name: Accelerometer

Expand Down
6 changes: 3 additions & 3 deletions Accelerometer/readme.txt
Expand Up @@ -16,10 +16,10 @@ Sample Description:
========================================================================
Requirements:

- BlackBerry Native SDK for Tablet OS 2.0 or later
- BlackBerry® 10 Native SDK
- One of the following:
- BlackBerry PlayBook tablet running BlackBerry Tablet OS 2.0 or later
- BlackBerry Tablet Simulator 2.0 or later
- BlackBerry® 10 device
- BlackBerry® 10 simulator

========================================================================
Importing a project into the Native SDK:
Expand Down
12 changes: 6 additions & 6 deletions AudioControl/bar-descriptor.xml
@@ -1,17 +1,16 @@
<?xml version="1.0" encoding="utf-8" standalone="no"?>
<qnx xmlns="http://www.qnx.com/schemas/application/1.0">

<!-- BlackBerry Tablet OS application descriptor file.
Specifies parameters for identifying, installing, and launching native applications on BlackBerry Tablet OS.
<!-- BlackBerry® 10 application descriptor file.
Specifies parameters for identifying, installing, and launching native applications on BlackBerry® 10 OS.
-->

<!-- A universally unique application identifier. Must be unique across all BlackBerry Tablet OS applications.
<!-- A universally unique application identifier. Must be unique across all BlackBerry® 10 applications.
Using a reverse DNS-style name as the id is recommended. (Eg. com.example.ExampleApplication.) Required. -->
<id>com.example.AudioControl</id>

<!-- The name that is displayed in the BlackBerry Tablet OS application installer.
<!-- The name that is displayed in the BlackBerry® 10 application installer.
May have multiple values for each language. See samples or xsd schema file. Optional. -->
<name>AudioControl</name>

Expand All @@ -27,7 +26,7 @@
<!-- A string value (such as "v1", "2.5", or "Alpha 1") that represents the version of the application, as it should be shown to users. Optional. -->
<!-- <versionLabel></versionLabel> -->

<!-- Description, displayed in the BlackBerry Tablet OS application installer.
<!-- Description, displayed in the BlackBerry® 10 application installer.
May have multiple values for each language. See samples or xsd schema file. Optional. -->
<description>The AudioControl application</description>

Expand Down Expand Up @@ -93,6 +92,7 @@
<!-- <action>post_notification</action> -->
<!-- <action>set_audio_volume</action> -->
<!-- <action>read_device_identifying_information</action> -->
<!-- <action>access_led_control</action> -->

<!-- Ensure that shared libraries in the package are found at run-time. -->
<env var="LD_LIBRARY_PATH" value="app/native/lib"/>
Expand Down
2 changes: 1 addition & 1 deletion AudioControl/common.mk
Expand Up @@ -26,7 +26,7 @@ CCFLAGS+=-fstack-protector-all -D_FORTIFY_SOURCE=2 \
LDFLAGS+=-Wl,-z,relro -Wl,-z,now $(if $(filter g so shared,$(VARIANTS)),,-pie)

# Basic libraries required by most native applications
LIBS+=bps
LIBS+=bps screen

include $(MKFILES_ROOT)/qtargets.mk

Expand Down
8 changes: 4 additions & 4 deletions AudioControl/main.c
Expand Up @@ -94,16 +94,16 @@ print_audio_event(bps_event_t *event)


/**
* A sample application that demonstrates the BlackBerry Native APIs for
* managing audio control. The sample queries for the current speaker output
* A sample application that demonstrates the BlackBerry(R) 10 Native SDK APIs
* for managing audio control. The sample queries for the current speaker output
* level, sets the speaker output level and then waits for updates to any audio
* levels.
*/
int
main(int argc, char *argv[])
{
/*
* Before we can listen for events from the BlackBerry Tablet OS platform
* Before we can listen for events from the BlackBerry(R) 10 OS platform
* services, we need to initialize the BPS infrastructure
*/
bps_initialize();
Expand All @@ -116,7 +116,7 @@ main(int argc, char *argv[])

/*
* Once the BPS infrastructure has been initialized we can register for
* events from the various BlackBerry Tablet OS platform services. The
* events from the various BlackBerry(R) 10 OS platform services. The
* Navigator service manages and delivers application life cycle and
* visibility events.
* For this sample, we request Navigator events so that we can track when
Expand Down
6 changes: 3 additions & 3 deletions AudioControl/manifest.properties
Expand Up @@ -34,8 +34,8 @@
# path.other-file.xml: resources/misc/stuff.xml
#

template.name: BlackBerry Tablet OS Example Audio Control Project
template.description: Create a new BlackBerry Tablet OS Example project to show how to manage the audio controls.
template.name: BlackBerry® 10 OS Example Audio Control Project
template.description: Create a new BlackBerry® 10 OS Example project to show how to manage the audio controls.

project.name: AudioControl

Expand All @@ -45,7 +45,7 @@ splashscreen.portrait: sample-splashscreen-portrait.png

open.file: bar-descriptor.xml

libs: bps
libs: bps screen

sources: main.c dialogutil.c dialogutil.h

Expand Down
6 changes: 3 additions & 3 deletions AudioControl/readme.txt
Expand Up @@ -18,10 +18,10 @@ Sample Description:
========================================================================
Requirements:

- BlackBerry Native SDK for Tablet OS 2.0 or later
- BlackBerry® 10 Native SDK
- One of the following:
- BlackBerry PlayBook tablet running BlackBerry Tablet OS 2.0 or later
- BlackBerry Tablet Simulator 2.0 or later
- BlackBerry® 10 device
- BlackBerry® 10 simulator

========================================================================
Importing a project into the Native SDK:
Expand Down
6 changes: 3 additions & 3 deletions BelligerentBlocks/README.txt
Expand Up @@ -19,12 +19,12 @@ Sample Description:
========================================================================
Requirements:

- BlackBerry Native SDK for Tablet OS 2.0 or later
- BlackBerry PlayBook tablet running BlackBerry Tablet OS 2.0 or later
- BlackBerry® 10 Native SDK
- BlackBerry® 10 device
- Box2D installed or added as a project dependency

========================================================================
Importing a project into the Native SDK:
Importing a project into the BlackBerry® 10 Native SDK:

1. From the the Sample apps page, download and extract the sample application.
2. Launch the Native SDK.
Expand Down
12 changes: 6 additions & 6 deletions Channels/bar-descriptor.xml
@@ -1,17 +1,16 @@
<?xml version="1.0" encoding="utf-8" standalone="no"?>
<qnx xmlns="http://www.qnx.com/schemas/application/1.0">

<!-- BlackBerry Tablet OS application descriptor file.
Specifies parameters for identifying, installing, and launching native applications on BlackBerry Tablet OS.
<!-- BlackBerry® 10 application descriptor file.
Specifies parameters for identifying, installing, and launching native applications on BlackBerry® 10 OS.
-->

<!-- A universally unique application identifier. Must be unique across all BlackBerry Tablet OS applications.
<!-- A universally unique application identifier. Must be unique across all BlackBerry® 10 applications.
Using a reverse DNS-style name as the id is recommended. (Eg. com.example.ExampleApplication.) Required. -->
<id>com.example.Channels</id>

<!-- The name that is displayed in the BlackBerry Tablet OS application installer.
<!-- The name that is displayed in the BlackBerry® 10 application installer.
May have multiple values for each language. See samples or xsd schema file. Optional. -->
<name>Channels</name>

Expand All @@ -27,7 +26,7 @@
<!-- A string value (such as "v1", "2.5", or "Alpha 1") that represents the version of the application, as it should be shown to users. Optional. -->
<!-- <versionLabel></versionLabel> -->

<!-- Description, displayed in the BlackBerry Tablet OS application installer.
<!-- Description, displayed in the BlackBerry® 10 application installer.
May have multiple values for each language. See samples or xsd schema file. Optional. -->
<description>The Channels application</description>

Expand Down Expand Up @@ -94,6 +93,7 @@
<!-- <action>post_notification</action> -->
<!-- <action>set_audio_volume</action> -->
<!-- <action>read_device_identifying_information</action> -->
<!-- <action>access_led_control</action> -->

<!-- Ensure that shared libraries in the package are found at run-time. -->
<env var="LD_LIBRARY_PATH" value="app/native/lib"/>
Expand Down
6 changes: 3 additions & 3 deletions Channels/main.c
Expand Up @@ -15,7 +15,7 @@
*/

/**
* Sample showing how to use BlackBerry Native APIs for channels to
* Sample showing how to use BlackBerry(R) 10 Native SDK APIs for channels to
* allow different threads to handle events from different services.
*
* Note that the main purpose of this sample is to show channels working
Expand Down Expand Up @@ -222,7 +222,7 @@ main(int argc, char *argv[])
int rc;

/*
* Before we can listen for events from the BlackBerry Tablet OS platform
* Before we can listen for events from the BlackBerry(R) 10 OS platform
* services, we need to initialize the BPS infrastructure
*/
bps_initialize();
Expand All @@ -238,7 +238,7 @@ main(int argc, char *argv[])

/*
* Once the BPS infrastructure has been initialized we can register for
* events from the various BlackBerry Tablet OS platform services. The
* events from the various BlackBerry(R) 10 OS platform services. The
* Navigator service manages and delivers application life cycle and
* visibility events.
*
Expand Down
2 changes: 1 addition & 1 deletion Channels/manifest.properties
Expand Up @@ -34,7 +34,7 @@
# path.other-file.xml: resources/misc/stuff.xml
#

template.name: BlackBerry Tablet OS Example Channels Project
template.name: BlackBerry® 10 OS Example Channels Project
template.description: Combine elements of Geolocation and Accelerometer sample application to show how to use Channels.

project.name: Channels
Expand Down
12 changes: 6 additions & 6 deletions Channels/readme.txt
Expand Up @@ -7,13 +7,13 @@ Sample Description:
sending events through channels.

We retrieve and display geolocation specific information, such as the latitude,
longitude, altitude, and bearing of the tablet from the default channel of the
longitude, altitude, and bearing of the device from the default channel of the
main thread. This thread also listens for the navigator's event telling it to
exit. Before joining on the child thread, it sends a custom event to the child
thread's channel letting it know that it should exit.

We retrieve and display the x, y and z values of the accelerometer device of
the tablet from the default channel of the child thread.
We retrieve and display the x, y and z values of the accelerometer of the
device from the default channel of the child thread.

When the application is executed, geolocation data is displayed in a dialog and
accelerometer data is displayed in another.
Expand All @@ -25,10 +25,10 @@ Sample Description:
========================================================================
Requirements:

- BlackBerry Native SDK for Tablet OS 2.0 or later
- BlackBerry® 10 Native SDK
- One of the following:
- BlackBerry PlayBook tablet running BlackBerry Tablet OS 2.0 or later
- BlackBerry Tablet Simulator 2.0 or later
- BlackBerry® 10 device
- BlackBerry® 10 simulator

========================================================================
Importing a project into the Native SDK:
Expand Down
13 changes: 7 additions & 6 deletions CubeRotate/bar-descriptor.xml
@@ -1,17 +1,16 @@
<?xml version="1.0" encoding="utf-8" standalone="no"?>
<qnx xmlns="http://www.qnx.com/schemas/application/1.0">

<!-- BlackBerry Tablet OS application descriptor file.
Specifies parameters for identifying, installing, and launching native applications on BlackBerry Tablet OS.
<!-- BlackBerry® 10 application descriptor file.
Specifies parameters for identifying, installing, and launching native applications on BlackBerry® 10 OS.
-->

<!-- A universally unique application identifier. Must be unique across all BlackBerry Tablet OS applications.
<!-- A universally unique application identifier. Must be unique across all BlackBerry® 10 applications.
Using a reverse DNS-style name as the id is recommended. (Eg. com.example.ExampleApplication.) Required. -->
<id>com.example.CubeRotate</id>

<!-- The name that is displayed in the BlackBerry Tablet OS application installer.
<!-- The name that is displayed in the BlackBerry® 10 application installer.
May have multiple values for each language. See samples or xsd schema file. Optional. -->
<name>CubeRotate</name>

Expand All @@ -27,7 +26,7 @@
<!-- A string value (such as "v1", "2.5", or "Alpha 1") that represents the version of the application, as it should be shown to users. Optional. -->
<!-- <versionLabel></versionLabel> -->

<!-- Description, displayed in the BlackBerry Tablet OS application installer.
<!-- Description, displayed in the BlackBerry® 10 application installer.
May have multiple values for each language. See samples or xsd schema file. Optional. -->
<description>The CubeRotate application</description>

Expand Down Expand Up @@ -92,6 +91,8 @@
<!-- <action>post_notification</action> -->
<!-- <action>set_audio_volume</action> -->
<!-- <action>read_device_identifying_information</action> -->
<!-- <action>access_led_control</action> -->
<!-- <action>access_led_control</action> -->

<!-- Ensure that shared libraries in the package are found at run-time. -->
<env var="LD_LIBRARY_PATH" value="app/native/lib"/>
Expand Down
2 changes: 1 addition & 1 deletion CubeRotate/common.mk
Expand Up @@ -29,7 +29,7 @@ CCFLAGS+=-fstack-protector-all -D_FORTIFY_SOURCE=2 \
LDFLAGS+=-Wl,-z,relro -Wl,-z,now $(if $(filter g so shared,$(VARIANTS)),,-pie)

# Basic libraries required by most native applications
LIBS+=bps screen EGL GLESv1_CM freetype png
LIBS+=bps screen EGL GLESv1_CM freetype png m

include $(MKFILES_ROOT)/qtargets.mk

Expand Down

0 comments on commit 9747854

Please sign in to comment.