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
asteroidg
Posts: 52
Registered: ‎11-21-2009
My Device: Not Specified
Accepted Solution

How to create a library for playbook ?

Hi to everyone.

I have a question:

What is the process to create a library which will be used inside different apps by calling for example LibOpen, LibClose methods and also if it will be replaced by another new version then new features will be available for this app ?

 

For example for bb was easy one *cod file with calls of mehtods from the library and another *.cod file for the library.

 

How about playbook process achieving the same thind describe for bb or even how to cover these process ?

 

Thank in advance.

Developer
jtegen
Posts: 6,541
Registered: ‎10-27-2010
My Device: HTC One, PlayBook, LE Z10, DE Q10

Re: How to create a library for playbook ?

You can create AS libraries, but they would be considered "static" since they get compiled with the main application.

 

It sounds like you want to create a "runtime" library that your application links against at runtime.  In the UNIX world, these are called "shared objects" or "SO" files, not to be confused with shared objects in AS.  Since the OS is UNIX based, there is not a concept of runtime libraries for AS applications like there is for UNIX (or Windows) based applications.

Developer
asteroidg
Posts: 52
Registered: ‎11-21-2009
My Device: Not Specified

Re: How to create a library for playbook ?

How about 2 *.bar files one will be the library and another one will be the app whihch is using methods from that library.

 

Or as for Android in the *.bar file we can have another file which can be changed by unzip the *.bar file and then replace it with a new file - represent a new library.

 

Is that possible or not ?

BlackBerry Development Advisor
elena_laskavaia
Posts: 417
Registered: ‎10-27-2010
My Device: PlayBook

Re: How to create a library for playbook ?

You cannot created 2 bar files - one application cannot access resources of another application. If you have two apps using the same library just package this library in each one.

Developer
jtegen
Posts: 6,541
Registered: ‎10-27-2010
My Device: HTC One, PlayBook, LE Z10, DE Q10

Re: How to create a library for playbook ?

If you're looking at loading different behavior, you could look into Modules and define a clear Interface that each module needs to implement.  You can then load the desired module at runtime and communicate to the module via the interface defined.  Not certain if this is supported in the PB, but would be very easy to test.  But modules, like SWF cannot be shared across application install boundaries.

Developer
asteroidg
Posts: 52
Registered: ‎11-21-2009
My Device: Not Specified

Re: How to create a library for playbook ?

Hi Elena.

I know that if the *.bar file is unzipped then inside we could find 3 files *.swf, *.png and *.xml file. Is there possible to add another file as a library (*.swc) or even other file which could be replaced then *.bar file zip it back and used as a new built  ?

 

BlackBerry Development Advisor
elena_laskavaia
Posts: 417
Registered: ‎10-27-2010
My Device: PlayBook

Re: How to create a library for playbook ?

You can put whatever you want there (in the bar). In command line you just add extra argument - library.swc file, in FB you need to put it in src so it will end up in bin-debug. Or more proper approach would be to add a cusom builder which would copy this library to bin-debug or bin-release folder of the main project when you re-compile your library project.

Developer
asteroidg
Posts: 52
Registered: ‎11-21-2009
My Device: Not Specified

Re: How to create a library for playbook ?

Hi Elena. Other files are comes out after compilation , but *.swc file doesn't come . If the *.swc file was in the lib folder or even was added to flex lib path then the project was compiled ok. But I am looking for scenarion when if the bar file is unzipped then I can remove the old swc file with a new one and as a result I will have a new bar file wihtout compiling it again, that is my target to achieve . Any ideas ?

Developer
asteroidg
Posts: 52
Registered: ‎11-21-2009
My Device: Not Specified

Re: How to create a library for playbook ?

Hi Jtegen.

 

I don't wanna create a "runtime library" (RSL) , and I don't wanna the app to be linked against at runtime. The only thing I want is:

1) Unzip the *.bar file

2) Change the *.swc library with a new version

3) zip ti *.bar file back

4) sign it

5) push it to playbook

 

To achieve that I have created a flex *.swc library. Then inside the app for flex buld path I have added the *.swc file and the project was compiled OK. But in output folder , even in *.bar file this file is not present, I found an article about library types:

http://help.adobe.com/en_US/flashbuilder/using/WS6f97d7caa66ef6eb1e63e3d11b6c4d0d21-7fe6.html

which explain about 3 types of library. But no chanse to get that *.swc library inside the *.bar file , also I have used the second type external but no *.swc file was created inside the *.bar file and also it seems that my app doesn't work showing just a gray stage ...

 

 

Also if that process is not gonna work , how about another *.swf file as a library inside the app src folder , but how to use those *.as classes like I did by using *.swc file: newPage:LibrarySprite= new LibrarySprite(sw, sh)  ?

Any suggestion from your experince will be nice.

 

Thank you in advance.

BlackBerry Development Advisor
elena_laskavaia
Posts: 417
Registered: ‎10-27-2010
My Device: PlayBook

Re: How to create a library for playbook ?

You can do it all though command line.

Copy all files you need (or unzip if you wish), including swc in a directory x, and invoke blackberry-airpackager to package it all. Signing is not needed now. To install into Simulator add couple more options to airpackager (such as -installApp and -launchApp). If you want to deploy existing bar file you can use blackberry-deploy tool.