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

Java Development

Reply
Developer
Posts: 52
Registered: ‎11-21-2009
My Device: Not Specified
Accepted Solution

How can I call or even use a library class inside the app which was downloaded alongside the app ?

Hi to all. I have a question ?

 

I have an app and a library.  Inside the app a have a lot of calls from this library (easy to say my app it's dependent on the library ). 

I tried the following scenario: in main app I have added logic to download the library programatically. But something I missunderstood around that. So, I am downloading first my app which is dependent on the library then I was thinking to check in constructor if the library exist then activate the app if not then download the lib and reboot the device.

My problem now is if i have at list one call of class from the library then the app will not work and will thrown the exception that "The app has verification errors".

So how can I avoid that ? or even

How to download that lib from the app and have inside that app other methods calls from the library which is not yet downloaded ?

 

 

Thank you in advance. A sample will be apreciated.

Developer
Posts: 16,998
Registered: ‎07-29-2008
My Device: Z10 LE, Z30, Passport
My Carrier: O2 Germany

Re: How can I call or even use a library class inside the app which was downloaded alongside the app ?

you can add the library in your jad or alx file to be downloaded together with your main application.

search the forum for more details on this.

----------------------------------------------------------
feel free to press the like button on the right side to thank the user that helped you.
please mark posts as solved if you found a solution.
@SimonHain on twitter
Developer
Posts: 52
Registered: ‎11-21-2009
My Device: Not Specified

Re: How can I call or even use a library class inside the app which was downloaded alongside the app ?

[ Edited ]

Simion firstable thank you for your quik reply.

Second, I know about this, which means that the library is static I was trying to have a dynamic one downloaded from the app.

I have allready this solution to download the library along the app, but this involves every time for different apps by using the same library a lot of work . Also here could be applied two cases:

1) when the library has same package name for every app - the issue is that for the second app the user will be ask to reboot the device which is not user friendly

2) when the library has a different package name , it is user friendly but involves many steps : like change the package name, resign the app and upload the library together with single un on the server ?

 

So, how about dynamic library or even other suggestions along that ? (also having another app as a lib will not be a user friendly solution)

Developer
Posts: 16,998
Registered: ‎07-29-2008
My Device: Z10 LE, Z30, Passport
My Carrier: O2 Germany

Re: How can I call or even use a library class inside the app which was downloaded alongside the app ?

we have a library on development-side, for example, and add the classes we need to the project.

this means, on the one hand, that potentially 5 identical classes exist on a device (if 5 apps are installed), but other than wasting space there is no harm done.

on the other hand we can use different versions of the library in different products.

 

we use a maven task to copy the classes from the lib project into the live one, but i guess there are many solutions there, including copying by hand.

 

we also use standalone apps, like ksoap2.

as far as rebooting is concerned: a user does not install the software so often, rebooting the deivce is not that big of a deal. in fact i guess that windows users are pretty much used to the idea Smiley Wink

if you want to avoid it you can remove the library from alx/jad if you are sure that it already exists on the device. you can also add it later, if this assumption was incorrect.

----------------------------------------------------------
feel free to press the like button on the right side to thank the user that helped you.
please mark posts as solved if you found a solution.
@SimonHain on twitter
Developer
Posts: 52
Registered: ‎11-21-2009
My Device: Not Specified

Re: How can I call or even use a library class inside the app which was downloaded alongside the app ?

Hi again.

I was trying the following : in simulator I was uploading the app cod file which depend on the library, then I was checking if the library exists then activate the app if not then download it, the issue came out having a call to a class from the library which is not yet present on device. When I am trying to open that app I am getting the error  "App has verification errors " and also my lib wasn't downloaded.

Is that possible to call class from a library which is not yet on device, and if not then download it from the app ?

 

Thank you in advance.

Highlighted
Developer
Posts: 16,998
Registered: ‎07-29-2008
My Device: Z10 LE, Z30, Passport
My Carrier: O2 Germany

Re: How can I call or even use a library class inside the app which was downloaded alongside the app ?

no, this would require a second app, like an installer

----------------------------------------------------------
feel free to press the like button on the right side to thank the user that helped you.
please mark posts as solved if you found a solution.
@SimonHain on twitter