Tutorial - Gen Y Edu

sploshtribeSoftware and s/w Development

Dec 14, 2013 (3 years and 10 months ago)

84 views


Sample Apps Tutorial



Native SDK















Batch
No.
1:
:

Alpha Course
2013








Native SDK Tutorials


1
.
Simple app Tutorial:

Create a Basic 3D app

In this tutorial, we'll show you how to create a 3
-
D, rotating, multicolored
cube using
OpenGL ES 1.1 or OpenGL ES 2.0. We'll cover several concepts such
as defining the geometry of the cube, initializing our model in both versions,
adjusting the model per frame, and how this is called from
our

main()

function.

If you want to complete the tut
orial using OpenGL ES 1.1, when you create a
new

BlackBerry C/C++ project

in the QNX Momentics IDE, and choose
the

BlackBerry 10 OS OpenGL ES 1.1 Application Template Project. Or, if you
want to use OpenGL ES 2.0 for the tutorial, when you create a newBlac
kBerry
C/C++ project

in the QNX Momentics IDE, and choose the

BlackBerry 10 OS
OpenGL ES 2.0 Application Template Project. Both of these template projects,
you get an OpenGL ES application that displays a square on the screen. We'll
change this template to

display a cube instead of a square.



You will learn to



Create and configure your project



Create and color your cube



Draw the cube with OpenGL ES 1.1



Draw the cube with OpenGL ES 2.0


Step1:
Before you begin



Create your project



Configure your project


Step
2:
Create the cube


Step3:
Draw the cube with OpenGL ES 1.1



Initialize the model



Rotate the model


Step4:
Draw the cube with OpenGL ES 2.0




Initialize the model



Rotate the model


Refer:
http://goo.gl/6Io6c


Source Code:
http://goo.gl/Y8Ddf


2
.
Sample app Tutorial:
Create Good Citizen app

In this tutorial, we'll explore the Good Citizen sample application that is
included with the BlackBerry 10 Native SDK. This application demonstrates
how

to perform common tasks, such as handling events, working with
application data, and rendering content on the screen.


You will learn to



Create the Good Citizen project



Initialize OpenGL ES and application data



Set up a main application loop



Handle
screen and navigator events



Update application data and render the scene



Read from a file and save to a file




Clean up application resources




Step1:

Before you begin



Create your project



Using the app


Step2:

Initialize the app


Step3:

Create the main application loop



Handle
events



Update the application data



Render the scene

Refer:
http://goo.gl/D7t5o


Source Code:

http://goo.gl/nBy4q


3. Multimedia Tutorial:
Play
a .wav file


The PlayWav sample application shows you how to play a .wav file using the
libasound library. The BlackBerry 10 Native SDK provides the

QNX Sound
Architecture (QSA)

for handling audio files. The QSA provides several
multimedia libraries, but this tutorial will focus handling on a .wav file
with the libasound library.




You will learn to



Open a .wav file in your appli
cation



Determine the properties of a .wav sound file



Prepare a .wav sound file for playback



Handle audio device events



Handle audio buffer underruns


Step1:
Before you begin



Create your own project or Load the Playwav sample app



PlayWav library
requirements



Configure your linker settings for the libraries



Allow audio in your app



Specify a .wav file as an asset



Location of the audio file


Step2:
Structure of .wav file



Structure of .wav file format



The .riff chunk descriptor



Format sub
-
chunk



Data s
ub
-
chunk



Handling .wav audio



Step3:
Initial audio setup and additional components



Audio variables and macros



Local scope of the calling function



Additional components



Handle audio device events



Obtain the .wav file path in the directory



Open the .wav file

Step4:
Parse the .wav audio file



Handle the RIFF descriptor



Handle chunk tags



Handle the format chunk


Step5:
Set up libasound audio mixer and PCM components



QNX Sound Architecture



Set up the libasound mixer and PCM components



Call our setup_snd() function


Step6:
Set up the main event and audio loop



Main event and audio loop conditions



Inside the main event loop



Inside the main audio loop



Successful and unsuccessful runs of main()


Refer:
http://goo.gl/2RhZp


Source Code:

http://goo.gl/pIhPs



4.
Gaming App Tutorial:
Belligerent Blocks

Importing, Debugging and Running of app is similar to the above apps.

Source Code:

http://goo.gl/n3ojG


5.
Communicatio
n App

Tutorial
:

HTTP proxies



The HTTP Proxy sample is an application that is designed to retrieve the
proxy

information of the device that was set by the user.



When you run the application, the application queries the device for the
proxy

information a
nd uses libcurl to retrieve a URL.


Source Code:

http://goo.gl/G3WsO


6.
Communication App

Tutorial
:

Network Status


The Network Status sample is an application that is designed to retrieve the

network status of the
device.



When you run the application, the application queries the device for the

network status, prints the status to the console, and listens for changes to

the status.


Source Code:
http://goo.gl/qmikM


7.
Device App

Tutorial
:
Geolocation

The Geolocation sample is an application that demonstrates how to retrieve

geolocation specific information, such as the latitude, longitude, altitude,

and bearing of the device.




When you run the application, geolocation data is d
isplayed in a dialog.




Source Code:
http://goo.gl/1G4qH


8.
Device App

Tutorial
:
Keyboard

The Keyboard sample is an application that is designed to show you how to

handle key presses on the virtual keyboard.



When you run the application, different behaviors are triggered depending
on

the key that is pressed. The key presses are also output to the debug console.


Source Code:
http://goo.gl/uGyhl


9.
Device App

Tutorial
:
Loca
le

The Locale sample is an application that is designed to show you how to

retrieve locale information from the device.



When you run the application, the application queries the device for the

current locale, and prints the country and language to the
console.


Source Code:
http://goo.gl/ggfyt



10.
Graphics & Windowing App
Tutorial
:
Dialogs


The Dialog Sample is an application that is designed to show you how to
display

a dialog in your application. This sample uses
the dialog service, which is a

service in the BlackBerry Platform Services library. You can use the dialog

service to create various dialogs and set the properties for these dialogs,

such as title, message, available buttons, and so on. You can also use th
is


service to retrieve information about the dialog button that a user pressed.



When you run the application, it starts with an alert dialog already present.


After you have closed the alert dialog, you can later display another alert

dialog by swiping

down from the top of the screen. An alert dialog is a simple

dialog that contains a title, message, and buttons.


Source Code:
http://goo.gl/ri1UH


11.
Graphics & Windowing App
Tutorial
:
Text Rendering (HelloWorldDisplay
)

The HelloWorldDisplay sample is an application that is designed to show you

basic application setup and how to render text on the screen.



When you run the application, a customized "Hello World" message is
displayed

on the screen.


Source Code:
http://goo.gl/ousU8


12.
Monetization App
Tutorial
:
Advertising Service


Step1:

Setup your project

Step2:

Display Ad banner on your screen


Refer:

http://goo.gl/zISt7


Source Code:

http://goo.gl/987ld



13.
Monetization App
Tutorial
:
Payment Service


The Payment Service Sample is an application that is designed to show you
how

to support purchase requests in your applications using the Payment Service,

which is a service in the BlackBerry Platform Services library. You can

register digital goods in the vendor portal for BlackBerry App World and
allow

users to purchase these digital goods in your applications.



When you run the application it starts wit
h the simulation of a purchase

already initiated. Once you're done, you can simulate another purchase by

swiping down from the top of the screen. The simulated purchase request is

performed in local mode, meaning that no information is sent to the Payment


Service server and a simulated purchase response is received.


Source Code:
http://goo.gl/jIVGT


14
.
Multimedia App
Tutorial
:
Audio Settings


The Audio Control Sample is an application that is designed to show you
how to

query the device for audio control settings, such as headphone volume,
speaker

volume, input gain, and mute status. This sample uses the audio mixer
service,

which is a service
in the BlackBerry Platform Services library.



When you run the application, you can change one of the properties of the
audio

mixer and the updated audio mixer status is printed to the console.


Source Code:
goo.gl/fUQZ
G


In the Source Code link you can find Description of the app, Features,
Requirements and Importing of App.