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
rgelb1
Posts: 108
Registered: ‎08-05-2008
My Device: Not Specified

How to distribute the application wirelessly?

Hello.  Using JDE 4.5, I am thouroughly confused as to how to distribute the application wirelessly over the internet. 

I wrote an equivalent of a Hello World app to see how it's done, but having trouble actually installing it.

 

I dropped .jad and .jar of my application on a web server (as was mentioned in several posts).  I pointed the browser to the .jar file and it started downloading.  Then it failed, saying "907 Invalid JAR Descriptor missing required attribute MIDlet-1". 

 

I tried rebuilding the app, but the error would not go away.

 

So my questions are as follows:

 

1.  What files do I need to place on the web server?  .jad, .jar, .alx???

2.  Which file do I point my users to, e.g. http://www.blah.com/myapp.jad???

3.  Another warning that popped up before the error: "This application does not contain a signature.  It might not be a from a trusted source....".  How do I sign the application and avoid freaking out users with this warning?

 

 

Developer
simon_hain
Posts: 16,282
Registered: ‎07-29-2008
My Device: Z10 LE, Z30, Passport

Re: How to distribute the application wirelessly?

normally you use jad+cod to distribute blackberry applications.
also see:
http://www.blackberry.com/knowledgecenterpublic/livelink.exe/fetch/2000/348583/800708/800647/How_To_-_Load_applications_onto_a_BlackBerry_smartphone.html?nodeid=800557&vernum=0

to set the correct content type on your webserver see:
http://www.blackberryinsight.com/2008/07/08/howto-setup-an-apache-webserver-to-deliver-blackberry-ota-applications/
----------------------------------------------------------
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
BlackBerry Development Advisor
MSohm
Posts: 14,757
Registered: ‎07-09-2008
My Device: BlackBerry Passport

Re: How to distribute the application wirelessly?

And here is a developer knowledge base article on the trusted source warning.

 

Support - Warning: This application does not contain a signature. It might not be from a trusted source
Article Number: DB-00556

http://www.blackberry.com/knowledgecenterpublic/livelink.exe/fetch/2000/348583/800708/800646/Support...

Mark Sohm
BlackBerry Development Advisor

Please refrain from posting new questions in solved threads.
Problem solved? Click the Accept As Solution button.
Found a bug? Report it using Issue Tracker
Developer
markww
Posts: 70
Registered: ‎08-18-2008
My Device: Not Specified

Re: How to distribute the application wirelessly?

Hi,

 

Could I ask a few more questions on this?

 

So we put our .jad and .cod files in the same folder someplace on our webserver like:

 

    www.mycompany.com/downloads/mymidlet.jad

                                                  mymidlet.cod

 

 

Now for first time install, we just tell users to browse to www.mycompany.com/downloads/mymidlet.jad and the blackberry device will take care of installing the application for us? (cool).

 

Will the same work as nicely for updates? Say our midlet checks for updates like:

 

    1) Midlet starts up

    2) Midlet makes webservice request to our company to see if any updates exist.

    3) If update exists, ask user if they want to install updates, if so, just direct them to URL of new update location.

 

If that's how it goes, how does blackberry handle overwriting the older version? Are we supposed to put our new version somewhere new on our webserver, or just overwrite the original download location with the new version?

 

And if our midlet depends on other libraries? 

 

Lastly, do .alx files come into play at all via this sort of web update?

 

Thanks

Developer
radpin
Posts: 21
Registered: ‎07-15-2008
My Device: Not Specified

Re: How to distribute the application wirelessly?

Yep, drop the jad and cod in a folder (and make the mime changes), send them to myapp.jad, and then the BB magically installs it for you (and uninstalls the previous via a confirmation prompt).

 

I'm not sure how it will handle the update thing though. A rather ghetto approach might be:

 

1) Get your application version, and the version that the website has. If different...

2) Pop up a dialog and ask the user if they want the newer version. If user says yes...

3) Send the blackberry browser to mysite.com/myapp.jad

4) They'll get another prompt from BB to confirm the uninstall / install.

 

Also, depending upon your application, it might need a restart after the uninstall and before the install.

Developer
markww
Posts: 70
Registered: ‎08-18-2008
My Device: Not Specified

Re: How to distribute the application wirelessly?

[ Edited ]

Ok I tried it and it kind of works, for some reason JDE inserts all these strange .cod URLs in the .jad file like:

 

    RIM-COD-URL-9: myapp-9.cod
    RIM-COD-URL-8: myapp-8.cod
    RIM-COD-URL-7: myapp-7.cod
    RIM-COD-Module-Dependencies: net_rim_cldc,myLibrary1,myLibrary2,net_rim_bbapi_browser
    RIM-COD-URL-6: myapp-6.cod
    RIM-COD-URL-5: myapp-5.cod
    RIM-COD-URL-4: myapp-4.cod
    RIM-COD-URL-3: myapp-3.cod
    RIM-COD-URL-2: myapp-2.cod
    RIM-COD-URL-1: myapp-1.cod
    RIM-COD-URL: myapp.cod

 

I have to delete them all except the last one, then it picks it up ok. Weird.

 

The bigger question for me now is this line with the dependencies:

 

    RIM-COD-Module-Dependencies: net_rim_cldc,myLibrary1,myLibrary2,net_rim_bbapi_browser

 

I made two external library projects named myLibrary1 and myLibrary2. The phone just quits downloading my main application because I don't have those two libs previously installed. Is there anyway to automate that through the main application .jad file? I probably can't tell users to first download myLibrary1.jad, then myLibrary2.jad, then myapp.jad. Is this what .alx files are for? Can they be used over the web?

 

Thanks!

 

Message Edited by markww on 08-26-2008 06:33 PM
Developer
peter_strange
Posts: 19,610
Registered: ‎07-14-2008
My Device: Not Specified

Re: How to distribute the application wirelessly?

I think you will find that all these points are explained in the Chapter "Packaging and distributing BlackBerry Java Applications" of the Development Guide.

 

I've referenced a couple of other places that you might find useful information.

 

This thread might tell you a little more about the cods with the funny numbers:

http://supportforums.blackberry.com/rim/board/message?board.id=java_dev&message.id=2617&query.id=273...

 

You can add your two Library cods to your application jad and download everything at once, the following link explains what you need to change to do so manually (see page 3):

http://www.blackberry.com/knowledgecenterpublic/livelink.exe/fetch/2000/8179/271479/Wireless_applica...

or

http://tinyurl.com/asc3l

Developer
markww
Posts: 70
Registered: ‎08-18-2008
My Device: Not Specified

Re: How to distribute the application wirelessly?

Peter, thanks a lot, that showed me exactly how to get it working,


Mark