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
New Contributor
gesinger
Posts: 3
Registered: ‎12-20-2010
My Device: Not Specified
Accepted Solution

blackberry-airpackager with js instead of swf (working .air project)

I have a .air project HelloWorld.air.  It installs and runs perfectly (simply prints Hello World to the console and creates an html window with Hello World as its prinout).  It has 3 files: HelloWorld-app.xml, HelloWorld.html, and AIRAliases.js.

 

The code for HelloWorld-app.xml:

 

 

  1 <?xml version="1.0" encoding="utf-8" standalone="no"?>
  2 <application xmlns="http://ns.adobe.com/air/application/2.5">
  3    <id>com.sample.HelloWorld</id> <!-- of the form com.company.AppName -->
  4    <filename>HelloWorld</filename>
  5    <name>HelloWorld</name>
  6    <versionNumber>1.0.0</versionNumber>
  7    <initialWindow>
  8       <content>HelloWorld.html</content> <!-- identifies root HTML -->
  9       <visible>true</visible>
 10       <!-- <width>400</width> -->
 11       <!-- <height>200</height> -->
 12    </initialWindow>
 13 </application>

 

The code for HelloWorld.html: 

 

 

  1 <html>
  2 <head>
  3    <title>Hello World</title>
  4    <script src="AIRAliases.js" type="text/javascript"></script>
  5    <script type="text/javascript">
  6    function appLoad() {
  7       air.trace("Hello World"); // Prints to command console using ADL
  8    }
  9    </script>
 10 </head>
 11 <body onLoad="appLoad()">
 12    <h1>Hello World</h1>
 13 </body>
 14 </html>

 

Packaging and running the .air file is fine.  When I try to package a .bar file using:
 
blackberry-airpackager -package HelloWorld.bar -installApp -launchApp HelloWorld-app.xml HelloWorld.html AIRAliases.js -device 192.168.94.128
 
it will install successfully, but as soon as the app launches, I get a result::Terminated, and the app will quit (before showing any windows).
 
I tried some other programs available, and those which have an xml file and an swf file will work perfectly.  Is an swf file necessary (I would prefer to just use HTML and JavaScript)?
Thank you in advance.

 

 

Developer
JRab
Posts: 2,462
Registered: ‎11-04-2010
My Device: Bold 9700

Re: blackberry-airpackager with js instead of swf (working .air project)

hey gesinger,

 

at the current moment the playbook supports only Flash/AIR which means you must provide a SWF in order for your application to run. here is a really good explanation why this is the case:

 

http://supportforums.blackberry.com/t5/Tablet-OS-SDK-for-Adobe-AIR/basic-question-about-AIR-implemen...

 

hope that clears things up. good luck!

J. Rab (Blog) (Twitter)
--
1. If you liked my post or found it useful please click on the thumbs up and provide a Like!
2. If my post solved your problem please click on the Accept as Solution button. Much appreciated!

Approved Apps: OnTrack | ssShots | Hangman
New Developer
New Developer
Yoz
Posts: 15
Registered: ‎11-03-2010
My Device: Not Specified

Re: blackberry-airpackager with js instead of swf (working .air project)

hi gesinger,

 

could you please provide your command for compiling .air file? I am only able to compile .swf file, command containing .air file instead of .swf one would help me a lot

 

thank you