{"id":1439,"date":"2011-11-15T12:55:37","date_gmt":"2011-11-15T03:55:37","guid":{"rendered":"http:\/\/www.codedojo.com\/?p=1439"},"modified":"2011-11-27T09:17:21","modified_gmt":"2011-11-27T00:17:21","slug":"playbook-ndk-developer-tips","status":"publish","type":"post","link":"https:\/\/www.codedojo.com\/?p=1439","title":{"rendered":"Playbook NDK developer tips"},"content":{"rendered":"<p>Ok, I&#8217;ve now submitted an app (shh, under NDA) on Playbook (NDK, not Air\/etc) and here are some tips.\u00a0 Most of this is Windows-centric.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/graphics8.nytimes.com\/images\/2010\/09\/27\/technology\/personaltech\/27gadgetwise-playbook\/27gadgetwise-playbook-blogSpan.jpg\" alt=\"\" width=\"480\" height=\"325\" \/><\/p>\n<h5>1.\u00a0 Use their special version of Eclipse<\/h5>\n<p>It&#8217;s actually pretty good and coming from an old school MSVC&#8217;er that&#8217;s saying something.\u00a0\u00a0 It makes setting up your RIM dev account, certificates, device debug token, simulator, etc very easy.<\/p>\n<p>The Simulator, run through VMWare is very quick (1000+ fps for a simple gl app) and Eclipse does full debugging with it.<\/p>\n<p>I wasn&#8217;t able to get debugging working on the real device, but I didn&#8217;t try very hard and it might have been because I think I only tried it with wifi and not usb.\u00a0 No biggie because the Simulator was very good and the bugs were already gone.<\/p>\n<p>Although, one thing to note is you know how in the simulator, you see the wrong gl surface when thumb-nailing the app?\u00a0 The real device doesn&#8217;t have that problem, so don&#8217;t waste time trying to fix it.. like I did.<\/p>\n<h5>2.\u00a0 You can include a folder of assets<\/h5>\n<p>Just something that&#8217;s good to know &#8211; put your assets in a folder tree and you won&#8217;t have to worry about adding\/removing stuff as you work on your app.\u00a0 iOS&#8217;s xcode can do the same thing, for instance.\u00a0 You can hand edit the bar-descriptor.xml or use the editor built-into Eclipse which makes it easy.<\/p>\n<h5>3.\u00a0 OpenAL won&#8217;t work on the 1.X sim or device unless you manually include the libraries with your app.<\/h5>\n<p>Yeah, weird.\u00a0\u00a0 You can add those libraries as assets by doing something like this in your bar-descriptor.xml:<\/p>\n<pre>&lt;asset path=\"${QNX_TARGET}\\..\\target-override\\armle-v7\\usr\\lib\\libOpenAL.so.1\" type=\"Qnx\/Elf\"&gt;lib\/libOpenAL.so.1&lt;\/asset&gt;\r\n&lt;asset path=\"${QNX_TARGET}\\..\\target-override\\armle-v7\\usr\\lib\\libalut.so.1\" type=\"Qnx\/Elf\"&gt;lib\/libalut.so.1&lt;\/asset&gt;<\/pre>\n<p>You can check their BelligerentBlocks example if you grab it with git, they do it there.\u00a0 So what happens if OS 2.x comes with new libs and&#8230; uhh.. gotta run.<\/p>\n<address>(Huh, sorry about the bad formatting above, just cut and paste somewhere if you can&#8217;t see the text right..)<\/address>\n<h5>4.\u00a0 How to fix:\u00a0 Error: Unable to resolve path variable &#8220;QNX_TARGET&#8221;<\/h5>\n<p>Sorry, but if you did what I said above, you&#8217;ll get this error if you try to package your app from the command line, which I found for the final &#8220;signed&#8221; build I had to do as I couldn&#8217;t figure out how to get the IDE to not add -debugMode.<\/p>\n<p>Anyway, there actually IS a QNX_TARGET defined in windows (it&#8217;s set in bbndk-env.bat) which might confuse you &#8211; it&#8217;s not talking about that, it&#8217;s talking about the ${QNX_TARGET} we used above.\u00a0 The IDE has this defined but on the command line it isn&#8217;t.\u00a0 I tried the -env parm to no avail..\u00a0 so as a work around, you can replace it with the actual path.\u00a0 (You know a better way?\u00a0 Let me know, I don&#8217;t want hardcoded paths in my bar-descriptor.xml!)<\/p>\n<h5>5.\u00a0 How to sign your NDK app for final publishing<\/h5>\n<p>Currently, most of the docs about publishing on App World assume you are an Air or WebWorks app and have confusing differences.\u00a0 (Like, I don&#8217;t think you can use\u00a0BlackBerryGraphicalAid) To do your final build, just use the command line.\u00a0 Here is an example .bat of how to do it, assuming you&#8217;ve already built your app with Eclipse or a makefile:<\/p>\n<pre>call c:\\pro\\bbndk\\bbndk-env.bat\r\n&lt;note: Next two lines should be one line..&gt;\r\ncall blackberry-nativepackager.bat -configuration com.qnx.qcc.configuration.exe.release.1153117490\r\n \u00a0-package Device-Release\/MyAppName.bar bar-descriptor.xml\r\ncall blackberry-signer\u00a0-storepass &lt;yourpassword&gt; Device-Release\/MyAppName.bar\r\ncall blackberry-signer -verify Device-Release\/MyAppName.bar\r\npause<\/pre>\n<p>Ok, see that crazy &#8220;com.qnx.qcc.configuration.exe.release.1153117490&#8221; up there?\u00a0 I pulled that out of the bar-descriptor.xml file, this is how you control which build type to package.<\/p>\n<p>If you get a &#8220;this has already been signed&#8221; error, you need to edit the bar-descriptor.xml file and increment your version #.\u00a0 (Note from peter9477: there is an option in the packager that will increment it for you .. so if you have 1.0.0, it will make 1.0.0.27 if you do -buildld 27)<\/p>\n<h5>6.\u00a0 Playbook support is coming to Proton!<\/h5>\n<p>Well, it&#8217;s actually already on the svn but I&#8217;d like to further clean it up before declaring it done.\u00a0\u00a0 What&#8217;s <a href=\"http:\/\/www.protonsdk.com\">Proton<\/a>?\u00a0 It&#8217;s my open source C++ framework that lets you target iOS\/Android\/Win\/OS X\/webOS and now Playbook with the same code.<\/p>\n<p>And that&#8217;s it.<\/p>\n<p>Thanks to the guys from #playbook-dev on freenode for helping me out.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Ok, I&#8217;ve now submitted an app (shh, under NDA) on Playbook (NDK, not Air\/etc) and here are some tips.\u00a0 Most of this is Windows-centric. 1.\u00a0 Use their special version of Eclipse It&#8217;s actually pretty good and coming from an old school MSVC&#8217;er that&#8217;s saying something.\u00a0\u00a0 It makes setting up your RIM dev account, certificates, device [&hellip;]<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[3,6],"tags":[],"class_list":["post-1439","post","type-post","status-publish","format-standard","hentry","category-development","category-tech-tips"],"_links":{"self":[{"href":"https:\/\/www.codedojo.com\/index.php?rest_route=\/wp\/v2\/posts\/1439","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.codedojo.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.codedojo.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.codedojo.com\/index.php?rest_route=\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/www.codedojo.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=1439"}],"version-history":[{"count":13,"href":"https:\/\/www.codedojo.com\/index.php?rest_route=\/wp\/v2\/posts\/1439\/revisions"}],"predecessor-version":[{"id":1473,"href":"https:\/\/www.codedojo.com\/index.php?rest_route=\/wp\/v2\/posts\/1439\/revisions\/1473"}],"wp:attachment":[{"href":"https:\/\/www.codedojo.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=1439"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.codedojo.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=1439"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.codedojo.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=1439"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}