07-25-2012 07:19 AM
Hi, all.
I've created ANE-project. HalloWorld, for example. It's builded .SO file. How to export to .ANE file?
I've selected in Main Menu of QNX Momentics IDE File->Export->BlackBerry Tablet OS->AIR Native Extension...
Question one:
What should I write to the fields in AIR Components group box?
Question two:
I want to use some features of NativeSDK (the existing ANSI C src) in Adobe AIR application for playbook. For it's purpose I'm trying to use the ANE project. I'm on the right track?
P.S.: Sorry, for the stupid question and bad my English. I'm just learning to developing for BlackBarry.
07-25-2012 09:00 AM
07-25-2012 09:59 AM
There is an excellent step-by-step guide to creating ANE's for PlayBook and BB10:
07-25-2012 12:24 PM
Thanks!
I've done all the steps on the link...
At now the new problem here: debugger says:
ArgumentError: Error #3500: The extension context does not have a method with the name sayHello.
at flash.external::ExtensionContext/_call()
at flash.external::ExtensionContext/call()
at com.example::NativeAS3/sayHello()[D:\dsn\AIR\nativ
at MainSubWindow/GOTestOnClick()[D:\dsn\AIR\RDesktop\
My googling is not to fix bug...
I've trying export to release and run...
I've trying call ...this._ctx.call("sayHello", null) instead of ...this._ctx.call("sayHello") ...
I've used Win_7, NDK_2 and FlashBuilder 4.7
Help me, please ![]()
07-25-2012 12:27 PM
Sorry, FlashBuilder 4.6
07-25-2012 01:13 PM
Check your contextInitializer function (on the native side) and make sure you've added sayHello to functionNames and functionPtrs.
07-25-2012 01:34 PM
sayHello is added to functionNames and functionPtrs
My contextInitializer is copy/paste from example:
void contextInitializer(void* extData, const uint8_t* ctxType,
FREContext ctx, uint32_t* numFunctionsToSet,
const FRENamedFunction** functionsToSet) {
fprintf(stdout, "[nativecode.c] - SampleContextInitializer Begins\n");
fflush(stdout);
const char *functionNames[] = { "sayHello", NULL };
FREFunction functionPtrs[] = { sayHello, NULL };
// count number of functions
*numFunctionsToSet = 0;
while (functionPtrs[*numFunctionsToSet] != NULL) {
(*numFunctionsToSet)++;
}
FRENamedFunction *functionSet= calloc (*numFunctionsToSet, sizeof(FRENamedFunction));
char *temp = NULL;
int i;
for (i = 0; i < *numFunctionsToSet; i++) {
int bufferSize = sizeof(char) * (strlen(functionNames[i]) + 1);
temp = (char*) malloc(bufferSize);
strncpy(temp, functionNames[i], bufferSize);
temp[strlen(functionNames[i])] = '\0';
functionSet[i].name = (uint8_t*) temp;
functionSet[i].functionData = NULL;
functionSet[i].function = functionPtrs[i];
}
*functionsToSet = functionSet;
fprintf(stdout, "[nativecode.c] - SampleContextInitializer Ends\n");
fflush(stdout);
}
07-25-2012 01:37 PM
I've tested it on Playbook and Simulator - the result is same.
07-27-2012 08:15 AM
The 3500 error has to do because the "bps" library is not linked in with your app. You have to do this for "[All Configuration]" or you will get the same error depending on your deployment. This has changed in the latest build of the IDE (thanks to RIM who helped find this out).
C/C++ Build / Settings
Configuration: [All configurations]
Select QCC Linker / Libraries. Under Libraries (-l) "add" "bps"