Welcome!

Welcome to the official BlackBerry Support Community Forums.

This is your resource to discuss support topics with your peers, and learn from each other.

inside custom component

Adobe AIR Development

Reply
Developer
Developer
CMY
Posts: 1,122
Registered: ‎02-10-2009
My Device: 8130 / 8350 / 9530 / 9550 / 9850 / PlayBook
My Carrier: Verizon
Accepted Solution

BBM ANE questions..............

[ Edited ]

I've got about 60% of the BBM Social Platform headers files ported over in a 1:1 manner (just a c/as wrapper combo that calls the same function in the BBM SP) but I've hit a few roadblocks. I haven't quite figured out how to convert and pass classes/structs between the native code and as3 (supposedly it's possible) and feel it may take another week or so to do that, but I want to be able to get this out this week since the 10K and BFBB deadlines have been pushed back. I haven't used the BBM SP much in native or java and am largely unfamiliar with it, so I wanna ask in on its uses. I can figure there isn't much need for more than one of the BPS or BBMSP event structs unless you needed multithreaded capabilities, but for the rest of the structs: image, profile, contact, contact list; is there a large need for more than one instance of each object? And if there is, will the amount vary greatly or will it usually be a small or consistent number? I ask this so I can decide whether to create an array of the structs and manage the creation/deletion of them myself and assing object ids to be passed back instead of success for a number of the functions or should I go with one of the c++ data structs (map, hash table, etc) and lett the system manage it?

Please use plain text.
Developer
jtegen
Posts: 6,541
Registered: ‎10-27-2010
My Device: HTC One, PlayBook, LE Z10, DE Q10
My Carrier: Verizon

Re: BBM ANE questions..............

Congrats in doing this!

Probably best to have it running in a thread so events can be received without blocking the AIR thread.

You might to have to map it up and down between AIR, but probably best to reach out to jdolce at RIM (best to tweet him). He said he could give advice if someone ever got around to do a BBM ANE.

Use cases for me would be:
* change status
* share app data
* share information so others could be prompt to download the app.
* receive app data async

Once you get close, I would be happy to help test things out in a dummy app.

Very exciting...!!!
Please use plain text.
Developer
Developer
CMY
Posts: 1,122
Registered: ‎02-10-2009
My Device: 8130 / 8350 / 9530 / 9550 / 9850 / PlayBook
My Carrier: Verizon

Re: BBM ANE questions..............

I will do that. But if I'm understanding you correctly, there isn't a way to map up/down the structs between as/c since they are not defined in the header files; they only have stubs for the structs.

I will start on adding threads once I get the functions down, but I did figure out the hard way that some of them are not done async.

I get some of the uses, what I am more interested in is how likely are you to need several instances of the data structs at once. Some functions say they are limited to returning a certain number of values if I remember correctly but all dont. So I'm asking because I don't want to get stuck having to manually add remove and adjust object ids for an array that can increase from 10 to 1000 objects and be randomly accessed.
Please use plain text.
Developer
jtegen
Posts: 6,541
Registered: ‎10-27-2010
My Device: HTC One, PlayBook, LE Z10, DE Q10
My Carrier: Verizon

Re: BBM ANE questions..............

I am not 100% familiar with BBM and its API. Simple is better most of the time. If the client AIR apps wants to manage all these data objects, let them do it.

The other thought if you're going to cache data objects, is that C/C++ is more efficient in doing this then AS3 (traversal), and if it is a request/reply thing, it can be done in the thread of the ANE with little overhead to the AIR app.

These are good questions to ask jdolce. He has a lot more experience with ANEs can is better suited to ask how to best manage the data objects.
Please use plain text.
Developer
Developer
CMY
Posts: 1,122
Registered: ‎02-10-2009
My Device: 8130 / 8350 / 9530 / 9550 / 9850 / PlayBook
My Carrier: Verizon

Re: BBM ANE questions..............

I'll send him a tweet. Is his twitter tag @jdolce? It'll prob be later tonight before I can work on it anymore as I'm starting on my way back home from DC and its a 7 hour drive. But i'll post here what direction i'll take after speaking with him.

I also agree the c/c++ imp will be a lot faster that AS3 and will prob stick with just passing object ids back and forth instead of actual objects. Would be the more correct approach probably anyway; let the user just worry about accessing what they need and not how its done. Either way though I plan to publish all of the files and classes as well along with the ANE when I'm done.
Please use plain text.
Developer
jtegen
Posts: 6,541
Registered: ‎10-27-2010
My Device: HTC One, PlayBook, LE Z10, DE Q10
My Carrier: Verizon

Re: BBM ANE questions..............

If you want someone to test it before the release to give feedback, just me know; otherwise, look forward to when it is ready. You might want to send the source to jdolce as well, because he can do a good code review and suggest better/easier ways to do things.
Please use plain text.
Developer
Developer
CMY
Posts: 1,122
Registered: ‎02-10-2009
My Device: 8130 / 8350 / 9530 / 9550 / 9850 / PlayBook
My Carrier: Verizon

Re: BBM ANE questions..............

[ Edited ]

After speaking with jdolce and doing a little more reasearch it seems that it would be almost impossible to do a direct 1-1 mapping ANE with just the functions because of the need for threads to keep from blocking and the possibility of multiple objects in use of each type at once. So I am going to start adding in the threads now. I hope to have the registration and possibly image and profile functions/threading done by tomorrow afternoon and will post that for review/testing as soon as i do.

Please use plain text.
Developer
jtegen
Posts: 6,541
Registered: ‎10-27-2010
My Device: HTC One, PlayBook, LE Z10, DE Q10
My Carrier: Verizon

Re: BBM ANE questions..............

Looking forward to it. When you do post, please make it possible to easily download the ANE file. It makes it harder to test when you have to recompile everything.
Please use plain text.
Developer
Developer
CMY
Posts: 1,122
Registered: ‎02-10-2009
My Device: 8130 / 8350 / 9530 / 9550 / 9850 / PlayBook
My Carrier: Verizon

Re: BBM ANE questions..............

[ Edited ]

Well seems i've hit another roadblock. You can include the bbplatformbbmsp library in the ANE but you cannot grant permission to the library since there is no bar-descriptor.xml file with an ANE. Im going to message jdolce to see if there is a way around this, but if not, we'll have to wait on RIM for a solution.

 

 

*************************** EDIT *******************************

I found out the issue, I had the wrong library linked. There is a libbbmsp (BlackBerry Messenger Social Platform) and a libbbplatformbbm (BlackBerry Social Platform BBM); the first one is the correct one but I was linking the second. So its linking now, so hopefully I'll get something done for testing by monday.

Please use plain text.
Trusted Contributor
bdaemon
Posts: 152
Registered: ‎02-23-2011
My Device: dev alpha playbook 9500 8300
My Carrier: uc

Re: BBM ANE questions..............

I am also interesting in working bbm with air,
Please use plain text.