BlackBerryForums.com : Your Number One BlackBerry Community      

»Sponsored Links




Closed Thread
 
LinkBack Thread Tools
  (#1 (permalink)) Old
stefan Offline
Knows Where the Search Button Is
 
Posts: 23
Join Date: Oct 2004
Default TUTORIAL - Setup OTA test environment - 02-06-2005, 01:29 PM

I recently bumped into the following problem: I needed to setup a test environment for OTA download. For this I planned to use Tomcat version 4, and JDE 3.7 which comes with MDS and simulators for the different Blackberry devices available. Below is a description of how to do it:

Step 1: Install Tomcat
- run setup and indicate a listening port other than 8080(which is default) for example 8001. This is necessary as MDS (which by the way is also a Tomcat implementation) listens on port 8080. Do not forget to check the option that installs Tomcat as a Windows service. It is very useful when restarting the application server very often.
- if during the installation you forget to set Tomcat to listen on a different port, you can edit the file %TOMCAT HOME%/conf/server .xml and look for 8080 inside it. Tomcat documentation has more if you need to enter into details
-verify that Tomcat installed correctly by accessing with a web browser (I prefer Firefox) http://localhost:8001. You should see Tomcat homepage.

Step 2: Create a small web application that will represent the webpage you will connect to using the simulator. For that write a small jsp page:

Start.jsp
Code:
<?xml version="1.0"?>
<!DOCTYPE wml PUBLIC "-//WAPFORUM//DTD WML 1.3//EN" "http://www.wapforum.org/DTD/wml13.dtd">
<%@ page contentType="text/vnd.wap.wml" %>

<wml>
<head>
        <meta http-equiv="Cache-Control" content="max-age=0" forua="true"/>
</head>
<card title="MyTest">
<p align="center">
Welcome to my wml test page
</p>
<p>Please click on the link below to download your application</p>
<p align="left">
<%
String a="<a href='TestAplic.jad' accesskey='1'>TestAplic</a><br/>";
out.println(a);
%>
</p>
</card>
</wml>
Also needed is the web.xml file where you should include the MIME types for .jad and .cod files:

web.xml
Code:
<?xml version="1.0" encoding="ISO-8859-1"?>

<!DOCTYPE web-app
  PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.2//EN"
  "http://java.sun.com/j2ee/dtds/web-app_2_2.dtd">

<web-app>
  <display-name>MyTest</display-name>
  
  <!-- The Usual Welcome File List -->
  <welcome-file-list>
    <welcome-file>start.jsp</welcome-file>
  </welcome-file-list>

<!—Added the MIME types -->
<mime-mapping>
	<extension>jad</extension>
	<mime-type>text/vnd.sun.j2me.app-descriptor</mime-type>
	<extension>cod</extension>
	<mime-type>application/vnd.rim.cod</mime-type>
</mime-mapping>
  
</web-app>
Step 3: Deploy the web application including .jad and .cod files
The directory structure should be “webapps/mytest/WEB-INF/web.xml”
Also in “mytest” directory copy the files “start.jsp” the TestAplic.jad file and the TestAplic.cod file

Step 4: Run it:
- Start Tomcat
- Start MDS by clicking on Start->Programs->RIM->JDE3.7->MDS
- Start the simulator and using the web browser access the page “http://localhost:8001/mytest”
- Click on the link to download the application into the Blackberry simulator

Note: During the testing I noticed that when using JDE 4.0 one does not need to specify the MIME types for jad and cod files.
   
Sponsored Links
Please Login or Register to Remove these Advertisements!

  (#2 (permalink)) Old
Mark Rejhon Offline
Retired BBF Moderator
 
Mark Rejhon's Avatar
 
Posts: 4,833
Join Date: Aug 2004
Location: Ottawa, Ontario, Canada
Model: 8310
Carrier: Rogers
Default 02-09-2005, 06:33 AM

Good job! Thanks for posting.


Thanks,
Mark Rejhon

Questions? New BlackBerry User?
   
Closed Thread


Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On






Copyright © 2004-2008 BlackBerryNews.com, BlackBerryFAQ.com, BlackBerryForums.com.
The names RIM © and BlackBerry © are registered Trademarks of Research In Motion Limited.
Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
SEO by vBSEO 3.0.1