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
jtegen
Posts: 6,541
Registered: ‎10-27-2010
My Device: HTC One, PlayBook, LE Z10, DE Q10
My Carrier: Verizon

More qnx.pps::PPS could not be found errors

Trying to build a class to monitor and show battery activity.  Since that might be a App World condition as partly suggested in a recent web cast (just preparing).

 

However, when trying to access a singleton from either the class Device or QNXApplication, AIR desktop application throws our favorite exception.  Most likely it will work on the simulator (like the AlertDialog classes seem to do).

 

For those doing this, only work around is to place them in a try/catch block like:

try
{	
	this._device = Device.device;
	this._device.batteryMonitoringEnabled = true;
	this._device.addEventListener(DeviceBatteryEvent.LEVEL_CHANGE, BatteryLevelChanged );
	this._device.addEventListener(DeviceBatteryEvent.STATE_CHANGE, BatteryStateChanged );
	this._state = this._device.batteryState;
			 
	//this._app = QNXApplication.qnxApplication;
	//this._app.addEventListener(DeviceBatteryEvent.LEVEL_CHANGE, BatteryLevelChanged );
	//this._app.addEventListener(DeviceBatteryEvent.STATE_CHANGE, BatteryStateChanged );
}
catch( err : Error )
{
}

 Note also, the application should listen to the Device class fo battery state changes, not the QNXApplication.  If you do, you get the PPS error even if it is inside a try/catch block.

Please use plain text.
Developer
mplacona
Posts: 80
Registered: ‎03-17-2011
My Device: Playbook Tablet
My Carrier: -

Re: More qnx.pps::PPS could not be found errors

Did you ever find an answer to this one?

 

Thanks

Marcos Placona
www.placona.co.uk
My Playbook Apps:
Bonjour | Time Traveller | Magic Ball
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: More qnx.pps::PPS could not be found errors

Added logic so that it only get used while on the device and in AIR, It does nothing.
Please use plain text.
Developer
mplacona
Posts: 80
Registered: ‎03-17-2011
My Device: Playbook Tablet
My Carrier: -

Re: More qnx.pps::PPS could not be found errors

Something like this?

if(Capabilities.os.indexOf("PlayBook") > -1){

 

Because that doesn't seem to stop it erroring, even a try/catch block won't stop it.

 

Marcos Placona
www.placona.co.uk
My Playbook Apps:
Bonjour | Time Traveller | Magic Ball
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: More qnx.pps::PPS could not be found errors

I use:

public function addBatteryLevelListener( func : Function ) : void
{
	if( this.isAir )return;
	Device.device.addEventListener( qnx.events.DeviceBatteryEvent.LEVEL_CHANGE, func );
}

 Where isAir:

////////////////////////////////////////////////////////////////////////
public function getOS() : String
{
	return Capabilities.os;
}
		
/////////////////////////////////////////////////////////////////////////
public function get isPlayBook() : Boolean
{
	return this.getOS().toLowerCase().indexOf( 'playbook' ) > 0 ? true : false;
}
		
/////////////////////////////////////////////////////////////////////////
public function get isAir() : Boolean
{
	return !this.isPlayBook;
}

 

Please use plain text.
Developer
CoCopia
Posts: 231
Registered: ‎05-03-2011
My Device: PlayBook V1 and proud of it :-)
My Carrier: Legs

Re: More qnx.pps::PPS could not be found errors

[ Edited ]

If interested Renaun has a workaround to have the messaging system working through the desktop

 

Renaun's PPS Workaround

Keep the Forum productive and useful for all. Click Kudos button if I've helped you. Select Solved to help everyone.

PlayBook qualifying app - Pandoras' Lights
Blog - CoCopia.co.uk Catch me on Twitter cocopia_apps
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: More qnx.pps::PPS could not be found errors

I believe that workaround it just to fake out the runtime in AIR to think there is a PPS, but it does not provide a runtime PPS on windows.
Please use plain text.
Developer
CoCopia
Posts: 231
Registered: ‎05-03-2011
My Device: PlayBook V1 and proud of it :-)
My Carrier: Legs

Re: More qnx.pps::PPS could not be found errors

Yes, but it would allow you to test in the desktop environment, I've not run this so no idea if it's anygood.

Keep the Forum productive and useful for all. Click Kudos button if I've helped you. Select Solved to help everyone.

PlayBook qualifying app - Pandoras' Lights
Blog - CoCopia.co.uk Catch me on Twitter cocopia_apps
Please use plain text.
Developer
mplacona
Posts: 80
Registered: ‎03-17-2011
My Device: Playbook Tablet
My Carrier: -

Re: More qnx.pps::PPS could not be found errors

 


jtegen wrote:

I use:

public function addBatteryLevelListener( func : Function ) : void
{
	if( this.isAir )return;
	Device.device.addEventListener( qnx.events.DeviceBatteryEvent.LEVEL_CHANGE, func );
}

 Where isAir:

////////////////////////////////////////////////////////////////////////
public function getOS() : String
{
	return Capabilities.os;
}
		
/////////////////////////////////////////////////////////////////////////
public function get isPlayBook() : Boolean
{
	return this.getOS().toLowerCase().indexOf( 'playbook' ) > 0 ? true : false;
}
		
/////////////////////////////////////////////////////////////////////////
public function get isAir() : Boolean
{
	return !this.isPlayBook;
}

 


Wonderful! Thanks a lot for that...

Marcos Placona
www.placona.co.uk
My Playbook Apps:
Bonjour | Time Traveller | Magic Ball
Please use plain text.