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
Developer
rcmaniac25
Posts: 1,805
Registered: ‎04-28-2009
My Device: Z10 (STL100-4)-10.2.1.3253, Z10 (STL100-3)-10.3.1.997 Dev OS, Z30 (STA100-5)-10.3.1.997 Dev OS, Passport (SQW100-1)-10.3.0.1418, PlayBook (16GB)-2.1.0.1917
Accepted Solution

App Player

Basic: Can we make our own "app player"?

 

Background: When RIM announced the PlayBook, they stated that it would run HTML5/WebWorks, Adobe Air, Native, and have a Android App Player and a BlackBerry App Player. When a webcast was done about the NDK, I asked "Is it possible to make our own app player?" They didn't seem to understand what an App Player was. Regardless, I really like the concept of having what would probably best be called an emulator that runs dedicated apps. So instead of opening the emulator/app player and then clicking open and opening an app, you simply click an app as it is and it will invoke the emulator automatically.

 

Detailed: So, is it possible with the NDK to make an "app player"? The best version would be the one described above, click on an icon (like any other app) and it opens and an app that would otherwise not run on the PlayBook/BBX would be able to run like any other app.

 

(Ignoring signing at this moment) The idea I thought about how it would work is to write it similar to the Android runtime and then just "package" the application to a BAR so it can be deployed.

 

Now if that is not possible, what about writing a "launcher" app so that a "packager" utility could take the app and data, combine it with the "launcher" in a BAR file, then that calls a library which has the actual "emulation" system?

 

I don't know the internal details on the Android runtime or how the different game engines work (if they use one of the above methods or something different).

 

What I would want to avoid is basically "You can write a library and then write a separate app that would then call that library".

 

But that is why I am asking. Is it either of the 2 methods mentioned? The standard library + app (which then defeats the purpose)? Or is it a RIM + partners only thing (at least right now)?

---Spends time in #blackberrydev on freenode (IRC)----
Three simple rules:
1. Please use the search bar before making new posts.
2. "Like" posts that you find helpful.
3. If a solution has been found for your post, mark it as solved.
--I code too much. Well, too bad.
Developer
jtegen
Posts: 6,541
Registered: ‎10-27-2010
My Device: HTC One, PlayBook, LE Z10, DE Q10

Re: App Player

What apps is your "app player" running? Other PB apps already on the system or apps that are packaged with your app player? From what I understand of your post, and if I put on my RIM hat, I would have concerns about security. Can you give a concrete example and why a consumer would want this?
Developer
rcmaniac25
Posts: 1,805
Registered: ‎04-28-2009
My Device: Z10 (STL100-4)-10.2.1.3253, Z10 (STL100-3)-10.3.1.997 Dev OS, Z30 (STA100-5)-10.3.1.997 Dev OS, Passport (SQW100-1)-10.3.0.1418, PlayBook (16GB)-2.1.0.1917

Re: App Player

*shrugs* This is purly conceptional right now. If I had to give a hard concept, I'm a C# dev and would love to try and get the Mono framework running on the PlayBook (or BBX for that instance). But I wouldn't want to have to store a whole bunch of files in the file system, I would perfer to be able to install an app that would have been written in C# and uses Mono. Thus making it seemless for the user to actually use the app.

 

As for security, that's why I said "ignoring signing at this moment" (though I have used the security explanation on the Java side of the forums myself). How the apps would "end up" on the PlayBook, the process I thought was "user downloads (sticking with Mono for now) a library for developing an app for the PlayBook in C# (if you don't know Mono or .Net, they can both be used for development as they are mostly cross compatable, so I'll ignore downloading that). Person develops and tests app on computer. Then using a "packager", they package the app into a BAR. The BAR file has a native program that actually invokes the player, the "real" app and it's data. The player then runs the app".

 

So for security, since something like C# would be a managed framework then a simple check can be done to determine if a "secure" API is used, then to require signing. The library can then enforce that (last thing I want is to get in trouble for making a back door). Other options is to just do it at run time (if a secure API is used and the app isn't signed for it, then it throws an exception and requires signing for it. Finally, the easiest one, just require signing regardless of what APIs are used.

---Spends time in #blackberrydev on freenode (IRC)----
Three simple rules:
1. Please use the search bar before making new posts.
2. "Like" posts that you find helpful.
3. If a solution has been found for your post, mark it as solved.
--I code too much. Well, too bad.
Developer
jtegen
Posts: 6,541
Registered: ‎10-27-2010
My Device: HTC One, PlayBook, LE Z10, DE Q10

Re: App Player

[ Edited ]

Interesting. Allowing Mono on the device would open up more apps for the system. What I meant by security was not signing, but security of the device (a key to RIM with enterprise solutions). Allowing a 3rd party player may open up security risk to the device and its data. Just like RIM controls the AIR "player" and the Android "player", I'm not certain they would allow 3rd party players without a full security review. RIM is not looking at a Java "player" for the future, so I am not certain if a .net/mono/c# environment would be allowed. As we seen with some apps, RIM gets final approval. If you think getting mono player working at the NDK level might work, dont be surprised if RIM wont approve it (or you can ask in advance, but they would never probably reply unless you were a preferred partner). If you get that to work at a pure R&D effort and then see if RIM would approve it, it would be interesting, but I would think RIM would want control over any app players that would run other apps.

Just my $0.02.

Developer
rcmaniac25
Posts: 1,805
Registered: ‎04-28-2009
My Device: Z10 (STL100-4)-10.2.1.3253, Z10 (STL100-3)-10.3.1.997 Dev OS, Z30 (STA100-5)-10.3.1.997 Dev OS, Passport (SQW100-1)-10.3.0.1418, PlayBook (16GB)-2.1.0.1917

Re: App Player

Understood. It would have to be a balancing act, how would something like Mono which can do a very large amount of things (including making applications on the fly) work on a platform that is very security conscious. But .Net (which Mono is an open source version of) has AppDomains. Applying those to BlackBerry Balance would potentially solve that issue. Have an AppDomain specifically for the consumer and another for enterprise. Now if the enterprise user says "access the memory of the consumer partition" to open/save a file, the AppDomain throws a security exception. The apps themselves would be in a BAR file and would thus be under normal BlackBerry security. Other checks can be put in place to prevent security holes.

 

The point of the thread was to see if RIM would allow something like this. Though I don't expect someone from RIM to respond, there is barely any posts here yet so it's hard to miss.

 

On an additional security through, to get the most performance out of a .Net/Mono, the JIT should be used. But this would require the ability to allocate memory, compile the .Net/Mono application to it, then to execute it. That I have almost no doubt is not and will not be possible but it is something that should be presented upfront.

---Spends time in #blackberrydev on freenode (IRC)----
Three simple rules:
1. Please use the search bar before making new posts.
2. "Like" posts that you find helpful.
3. If a solution has been found for your post, mark it as solved.
--I code too much. Well, too bad.
BlackBerry Development Advisor
elena_laskavaia
Posts: 417
Registered: ‎10-27-2010
My Device: PlayBook

Re: App Player

No you cannot do it for security and for brand protection issues. If you want to use shared library, or shared runtime (i.e. if you wrote your own java runtime lets say) you have to package is as "captive" i.e. in your own bar file.

Installing shared resources is not currently supported on platform.

Developer
rcmaniac25
Posts: 1,805
Registered: ‎04-28-2009
My Device: Z10 (STL100-4)-10.2.1.3253, Z10 (STL100-3)-10.3.1.997 Dev OS, Z30 (STA100-5)-10.3.1.997 Dev OS, Passport (SQW100-1)-10.3.0.1418, PlayBook (16GB)-2.1.0.1917

Re: App Player

Understandable, so I would, as you put, "captive" the app in my own BAR file which happens to have the library for the runtime in order for it to work.

 

As for "shared resources is not currently supported on platform", the NDK has the option to make a shared library? I expect that this has to be included with the app, but what if multiple apps use the same library? Will the OS use the most recent one or does each app use their own local copy of the library?

---Spends time in #blackberrydev on freenode (IRC)----
Three simple rules:
1. Please use the search bar before making new posts.
2. "Like" posts that you find helpful.
3. If a solution has been found for your post, mark it as solved.
--I code too much. Well, too bad.
Developer
jtegen
Posts: 6,541
Registered: ‎10-27-2010
My Device: HTC One, PlayBook, LE Z10, DE Q10

Re: App Player

Installed apps are installed in their own sandbox. Installed items cannot be shared across different sandboxes. You can have an SO, but that SO would only be run within its own sandbox. I am not certain if an application moves an SO to (say) the documents directory for another app to use it (does NDK/ANE only allow the running of SO from its own sandbox?)
Developer
rcmaniac25
Posts: 1,805
Registered: ‎04-28-2009
My Device: Z10 (STL100-4)-10.2.1.3253, Z10 (STL100-3)-10.3.1.997 Dev OS, Z30 (STA100-5)-10.3.1.997 Dev OS, Passport (SQW100-1)-10.3.0.1418, PlayBook (16GB)-2.1.0.1917

Re: App Player

[ Edited ]

I know about the sandbox, I ask because it was an issue I had on the phone side of BlackBerry. I made a couple shared libraries but people didn't really use them because BlackBerry OS wouldn't handle them in a shared library "manner" (App A with lib A. Install App B with lib A and lib A isn't added because it already exists. Uninstall App A and lib A gets removed as well.) I am really hoping they add shared library support because it would make it much easier to actually use the libraries. Because to me, if App A has version 1.0 of a library and App B has version 2.0 of the same library, why should they be isolated to just the apps using them?

 

Unrelated: Odd, I don't remember marking a solution in this thread, nor do I have the ability to unmark the solution (as you could previously).

---Spends time in #blackberrydev on freenode (IRC)----
Three simple rules:
1. Please use the search bar before making new posts.
2. "Like" posts that you find helpful.
3. If a solution has been found for your post, mark it as solved.
--I code too much. Well, too bad.