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

Native Development

Reply
Contributor
bryanh99
Posts: 43
Registered: ‎06-30-2012
My Device: Bold 9900
My Carrier: T-Mobile

How to determine if side loaded vs Appworld

[ Edited ]

All,

 

Using the NDK, is there a way to determine if an app was loaded via AppWorld (vs side loaded) on the PB (os 2.x)?

 

Thank you

Bryan

 

Please use plain text.
Developer
WebCreep
Posts: 236
Registered: ‎07-27-2012
My Device: BlaclBerry PlayBook 16gb, BlackBerry dev alpha
My Carrier: Airtel

Re: How to determine if side loaded vs Appworld

Open app world and there go to my world. There you will be having only apps which were downloaded from app world. Sideloaded apps won't appear in my world 

Please use plain text.
Developer
obone
Posts: 162
Registered: ‎01-11-2012
My Device: BlackBerry 9790, BlackBerry PlayBook 64Gb, BlackBerry 10 Dev Alpha
My Carrier: MTS

Re: How to determine if side loaded vs Appworld

Hi WebCreep,

I think that Bryan has asked quite a different question. How to make sure (directly from your own app) that the app isn't installed as side loaded?
Respectfully,
Oleg

Developer, QNX RTOS, BlackBerry 10 and PlayBook
Follow me on Twitter (in Russian)
St.Petersburg BlackBerry Dev. Group
Please use plain text.
Developer
WebCreep
Posts: 236
Registered: ‎07-27-2012
My Device: BlaclBerry PlayBook 16gb, BlackBerry dev alpha
My Carrier: Airtel

Re: How to determine if side loaded vs Appworld

@obone please can u elaborate it and make it clear
Please use plain text.
Developer
obone
Posts: 162
Registered: ‎01-11-2012
My Device: BlackBerry 9790, BlackBerry PlayBook 64Gb, BlackBerry 10 Dev Alpha
My Carrier: MTS

Re: How to determine if side loaded vs Appworld

WebCreep,

It's the Developer Support Forum. So I think that Bryan asks about sample code or something along those lines to use it in his own apps.
Respectfully,
Oleg

Developer, QNX RTOS, BlackBerry 10 and PlayBook
Follow me on Twitter (in Russian)
St.Petersburg BlackBerry Dev. Group
Please use plain text.
Contributor
bryanh99
Posts: 43
Registered: ‎06-30-2012
My Device: Bold 9900
My Carrier: T-Mobile

Re: How to determine if side loaded vs Appworld

Yes, I am trying to determine a method in C++ (NDK) to determine if my app was installed via AppWorld or via sideloaded.  In this way I can stop the app from running if it was sideloaded.

 

There is talk of using "/pps/system/installer/registeredapps/applications" but that does not seem to work in C++.

 

 

Any other ideas?

 

 

Please use plain text.
Developer
peter9477
Posts: 6,473
Registered: ‎12-08-2010
My Device: PlayBook, Z10
My Carrier: none

Re: How to determine if side loaded vs Appworld

bryanh99, that file would work perfectly well, if used properly.

What does "does not seem to work" mean here? If you can read it from the command line (e.g. using "cat") you can certainly open it from C++ if the permissions allow it which, if you check, they will.

Peter Hansen -- (BB10 and dev-related blog posts at http://peterhansen.ca.)
Author of White Noise and Battery Guru for BB10 and for PlayBook | Get more from your battery!
Please use plain text.
Contributor
bryanh99
Posts: 43
Registered: ‎06-30-2012
My Device: Bold 9900
My Carrier: T-Mobile

Re: How to determine if side loaded vs Appworld

Peter.

 

When I said it "does not seem to work" I mean the following

 

1) Open the file with a QFile, with and without using both a QTextStream or a QDataStream.  The file opends (with read permissions).  call read() readline(), readdataline() all return 0.  No error just 0, and the pos() of the file does not move.  I even tried using seek() to move the file position pointer ahead one byte at a time and still no bytes are ever written.

 

2) Open the file with a FILE (pure C), all of the above is still true.

 

So, I am at a total loss.

 

 

 

Here is one sample of code:

 

QFile InFile("/pps/system/installer/registeredapps/applications");
if (InFile.open(QIODevice::Text | QIODevice::ReadOnly) == false)
return;

while (InFile.atEnd() == false)
{
LineIn = InFile.readLine();

qDebug()<< LineIn;
}

 

(prints "" for ever as the position pointer is not moved in that example as it is always reading 0 chars)

 

 

Please use plain text.
Contributor
bryanh99
Posts: 43
Registered: ‎06-30-2012
My Device: Bold 9900
My Carrier: T-Mobile

Re: How to determine if side loaded vs Appworld

Over a year old and still the same question.  Any new Ideas?

 

Bryan

 

Please use plain text.
Developer
BBSJdev
Posts: 5,948
Registered: ‎07-05-2012
My Device: Playbook, Z10 LE, Dev Alpha C
My Carrier: Orange

Re: How to determine if side loaded vs Appworld

Are you worried about piracy?

 

I'm not sure there is a difference and probably only someone from BlackBerry OS team would know if there is.

 


If you've been helped click on Like Button, if you've been saved buy the app. :smileyhappy:

Developer of stokLocker, Sympatico and Super Sentences.
Please use plain text.