Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TIMOB-14745 added native module support to README #158

Merged
merged 3 commits into from
Aug 16, 2013
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
16 changes: 16 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,22 @@
Release Notes
=============

GA Release (3.1.2)
----------------------------------------------------

THURS AUG 15, 2013

* Database.install Support
* Platform.createUUID Support
* GeoLocation.getCurrentPosition Support
* Native Module Support
* Updated and Integrated BlackBerry SDK into Documentation

Notes on Using 3.1.2
--------------------

See the developer blog post at http://developer.appcelerator.com/blog/2013/08/announcing-titanium-3-1-2-production-release.html

Beta Release (3.1.1)
----------------------------------------------------

Expand Down
44 changes: 41 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ Titanium Mobile BlackBerry is the Titanium platform support for the latest Black
Current Status
--------------

* 2013-06-17 - _BETA 3.1.1_
* 2013-08-15 - _GA 3.1.2_

Release Notes
-------------
Expand Down Expand Up @@ -77,8 +77,8 @@ To build V8 you will need to have Python and Scons available.
- Build src/tibb and test/native/tibbtest. When the builds are finished "Debug As" C/C++ Application. Also you need to setup the simulator using the Debug Configuration panel. Make sure to have the simulator running, you should see the simulator in the list of debug targets.


How to Update BlackBerry SDK to latest Night Build
--------------------------------------------------
How to Update BlackBerry SDK to latest Nightly Build
----------------------------------------------------

To get the latest prepackaged Titanium SDK including BlackBerry follow the steps below.

Expand All @@ -99,6 +99,44 @@ How to Build and Deploy the Titanium BlackBerry SDK (Native Platform Drop-In)

This will create a build folder with the blackberry sdk folder in it. The blackberry folder can be dropped into a current Titanium SDK. If and when you are ready to contribute use the instructions at https://help.github.com/articles/using-pull-requests to issue a 'pull request' and make sure you have signed the CLA as described in Contributing below.

How to Create, Test, and Publish BlackBerry Native Modules
----------------------------------------------------------

- Create Native Module:

By running the module create command will you generate a stub BlackBerry module including documentation that you can use as a starting point to building your own Titanium BlackBerry extension. The project created is to be used by the QNX Momentics IDE (QDE). The IDE should have been installed when you installed the BlackBerry NDK.

titanium create -p blackberry --id <MODULE_ID> -n <MODULE_NAME> -t module

- Build and Extend the Module:

The QDE is the tool most often used to develop native BlackBerry 10 applications. Although the module stub generated during create has a Makefile that can be utilized by command-line tools, developers often find the Eclipse based IDE easier to use. To get started with BlackBerry 10 module development import the module project created above into the QDE. You will see a CPP source file with the same name as your <MODULE_NAME> this file is the entry point and the startup method is the hook to the BlackBerry SDK. When a module is first "required" into a running Titanium application the startup method is called. BlackBerry uses the V8 JavaScript runtime engine, and the generated stub has some simple example of extending the module by "plugging into" V8. To embedded V8 developers and Node.JS developers the code will be very familiar. Using the stub as a sample add your own BlackBerry 10 extensions and these will be available to Titanium applications. A good resource for how to work with the V8 runtime is the V8 Embedder's Guide https://developers.google.com/v8/embed.


- Testing and Debugging the Module:

Not shipping with the BlackBerry SDK but available from GitHub is an application that the BlackBerry team uses for testing modules and developing the SDK. The app name is tibbtest it is located at https://github.com/appcelerator/titanium_mobile_blackberry/tree/master/test/apps/native/tibbtest like the generated module project tibbtest is a QDE project and should be imported into the QDE. You will also need the BlackBerry SDK located at https://github.com/appcelerator/titanium_mobile_blackberry/tree/master/src/tibb. The tibb project should also be imported into the QDE. The last step is to build and make sure the V8 library is available to the QDE. V8 ships with the Titanium BlackBerry SDK and you can adjust the common.mk in tibb, and tibbtest but it is probably easier to clone the Titanium BlackBerry SDK locally and follow the instructions on how to contribute to the BlackBerry SDK, instruction can be found at https://github.com/appcelerator/titanium_mobile_blackberry#how-to-setup-build-and-test-the-titanium-blackberry-sdk. Once you have your BlackBerry environment setup then:

1) In the QDE tibbtest project's main.cpp file uncomment the #include "ReplaceWithModuleName.h", and tiRegisterModule("ReplaceWithModuleName", (TiModule*) new ReplaceWithModuleName()); lines and replace the ReplaceWithModuleName strings with you module name.

2) Edit the common.mk with the path to your module library and the library name. There are comments in the file to assist you.

3) In the tibbtest project edit the app.js JavaScript to "require" in your module and then call your exposed properties methods and hook any callbacks. See the native_module_test.js for an example of using the stub module generated in step one. Make sure to make your module header file available to the tibbtest project, probably easiest to just put a copy in the tibbtest project.

4) Run the tibbtest application to simulator or device to test out your module. You can set breakpoints in your module to make debugging easier.

- Deploying the Module:

When you created your module a QDE stub project was created and also templates of the collateral needed when "publishing" manually or to the Appcelerator Marketplace. You should look at the README file and documentation folder that was generated with your module to finish and publish your module. The stepa basically are:

1) Copy the module project folder to <PATH_TO_TITANIUM_SDK>/modules/blackberry/<MODULE_NAME>/<VERSION> make sure that the "built" module library is available in the x86 and arm folder.

2) In the application that will use the module make sure that there is a module entry:

<modules>
<module platform="blackberry"><MODULE_NAME></module>
</modules>


Feedback
--------
Expand Down