You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@cordova.apache.org by "Tim Kim (JIRA)" <ji...@apache.org> on 2012/10/24 03:40:11 UTC

[jira] [Commented] (CB-1678) Create native extensions for bb10

    [ https://issues.apache.org/jira/browse/CB-1678?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13482901#comment-13482901 ] 

Tim Kim commented on CB-1678:
-----------------------------

Alrighty, I got some preliminary work done and is semi-working with an example echo plugin. 

Latest and greatest in this commit to get something decent going: https://git-wip-us.apache.org/repos/asf?p=incubator-cordova-blackberry-webworks.git;a=commit;h=939ad4e51a6928312d01ea6aea97ac4929521a71

Idea:
The ext folders in the blackberry repo are for creating custom extensions that run in native code on the various bb platforms. While most developers can probably write most of their app's needs using webworks, having the ability to write your own plugins with webworks makes everything better times a billion. :D:D:D

So for bb10, the ext-qnx folder structure will be similar to the other ext-*/ folders in that there will be a top level cordova folder containing the various classes. Inside each class folder should contain this structure:

Echo plugin:
cordova/
|echo/
||common.mk // main makefile to do stuff in
|| 
||js/ // js files to define the plugin within webworks
|||client.js
|||index.js
|||manifest.json
||Makefile
||
||nto/
|||arm/
||||so.le-v7 //.so objects generated here for device
||||Makefile
|||Makefile
||
||public/
|||plugin.cpp
|||plugin.h
|||tokenizer.cpp
|||tokenizer.h
||
||src/
|||echo.cpp
|||echo.hpp

So the idea is to write all the plugin's source within the src folder and have that plugin inherit from public/plugin.cpp. Then write the plugin definition within the js/ folder. After, cd into the cordova/echo/ folder, run make*. This will create the .so file (needs to be renamed to match JNext object made in index.js) within nto/arm/so.le-v7. 

Right now, I don't have scripts to auto create a nice folder structure (ie takes all of the js/ and the .so file that gets finally placed in the www/ext-qnx folder) so some manual copying is needed after the make step.

For those wondering, the final output should look something like:
www/
|ext-qnx/
||cordova.echo/
|||client.js
|||index.js
|||manfest.json
|||
|||device/
||||echoJNext.so
|||
|||simulator/
||||echoJNext.so

* Need native bb10 ndk and then run "source path_to_bb10_ndk/bbndk-env.sh"

So that's where I am right now. The next step is to figure out when and how to populate the www/ext-qnx folder. After that, I'll look into getting the JavaScript more tightly coupled with the cordova framework as opposed to the webworks framework. 
                
> Create native extensions for bb10
> ---------------------------------
>
>                 Key: CB-1678
>                 URL: https://issues.apache.org/jira/browse/CB-1678
>             Project: Apache Cordova
>          Issue Type: Bug
>          Components: BlackBerry
>    Affects Versions: 2.2.0
>         Environment: blackberry 10
>            Reporter: Tim Kim
>            Assignee: Tim Kim
>             Fix For: 2.3.0
>
>
> Currently with the webworks blackberry repo, there is no possibility to make a native extension for bb10 (this is because bb10 is now qnx with a c++ implementation). By making the infrastructure to support this, a developer would then be able to make their own plugins on the bb10 platform. 

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira