Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-14467] BlackBerry: Tibbtest project needs to be enhanced to allow the running and debugging of native modules

GitHub Issuen/a
TypeNew Feature
PriorityHigh
StatusClosed
ResolutionFixed
Resolution Date2013-07-25T22:51:51.000+0000
Affected Version/sn/a
Fix Version/s2013 Sprint 15 API, 2013 Sprint 15, Release 3.1.2, Release 3.2.0
ComponentsBlackBerry
Labelsblackberry, qe-3.1.2, qe-testadded
ReporterRussell McMahon
AssigneeRussell McMahon
Created2013-07-02T18:30:16.000+0000
Updated2014-06-19T12:43:51.000+0000

Description

Test: 1) Import native module into Momentics. 2) Edit common.mk to have your static module in the search path and named. 3) Edit main.cpp to register the module. 3) Create an app.js file that requires in the module. You should be able to debug the module.

Comments

  1. Russell McMahon 2013-07-25

    git: https://github.com/appcelerator/titanium_mobile_blackberry/pull/133
  2. Russell McMahon 2013-08-13

    Test by following the instruction in the GitHub repo. - 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 -n -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 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. - 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. 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.
  3. Lokesh Choudhary 2013-08-13

    Verified the fix & it works as expected.Thus closing. Environment: Appcel Studio : 3.1.2.201308091728 Ti SDK : 3.1.2.v20130812225629 Mac OSX : 10.8.4 Alloy : 1.2.0-alpha6 CLI - 3.1.2-alpha win 7 Win 8 Z10 BB simulator : 10.0.10.822 Z10 device running 10.0.10.88

JSON Source