BlackBerry Forums Support Community               

Closed Thread
 
LinkBack Thread Tools
Old 06-02-2005, 09:14 AM   #1 (permalink)
Knows Where the Search Button Is
 
Join Date: May 2005
Model: 7100T
Posts: 20
Post Thanks: 0
Thanked 0 Times in 0 Posts
Default Simulate MIDP Push Using MDS Simulator

Please Login to Remove!

Hi:

I am trying to simulate MIDP2.0 push using MDS simulator. For example if I create a java app that listens on the Blackberry SMS port or waits for on a socket port, will I be able to simulate sending an SMS message / socket message to MDS simulator. Someone please clarify.

Thanks,
Adikari
Offline  
Old 06-02-2005, 09:38 AM   #2 (permalink)
Knows Where the Search Button Is
 
Join Date: Apr 2005
Posts: 17
Post Thanks: 0
Thanked 0 Times in 0 Posts
Default

both should work.
i've only tried the socket-connection.
my midlet prompts the blackberry-user to register on a servlet, the registration at the PushRegistry is done automaticaly after the servlet registration.
the servlet stores the blackberry's ip and then opens a socket-connection with an output-stream to the blackberry.
this connections invokes the midlets startApp()-method.

beside the articles and examples on sun's j2me pages, you can look at this page
corej2me - DeveloperResources

the only blackberry specific think to keep on mind is setting the ;deviceside=true for registration at the PushRegsitry.

hopes that helps you
mmkl
Offline  
Old 06-02-2005, 03:19 PM   #3 (permalink)
Knows Where the Search Button Is
 
Join Date: May 2005
Model: 7100T
Posts: 20
Post Thanks: 0
Thanked 0 Times in 0 Posts
Default

Quote:
Originally Posted by mmkl
both should work.
i've only tried the socket-connection.
my midlet prompts the blackberry-user to register on a servlet, the registration at the PushRegistry is done automaticaly after the servlet registration.
the servlet stores the blackberry's ip and then opens a socket-connection with an output-stream to the blackberry.
this connections invokes the midlets startApp()-method.

beside the articles and examples on sun's j2me pages, you can look at this page
corej2me - DeveloperResources

the only blackberry specific think to keep on mind is setting the ;deviceside=true for registration at the PushRegsitry.

hopes that helps you
mmkl
Hi:

Thanks for the response. Could you please clarify if you tried with a Blackberry device or with the Blackberry simulator that comes with the JDE?

I would also like to know what is the servlet that you are talking about? Could you also point me to a sample code for Blackberry MIDP2.0 Push?

Thanks,
Adikari
Offline  
Old 06-03-2005, 05:52 AM   #4 (permalink)
Knows Where the Search Button Is
 
Join Date: Apr 2005
Posts: 17
Post Thanks: 0
Thanked 0 Times in 0 Posts
Default

my application works fine with the simulator.
with a real blackberry, the application is able to register the pushregistry, but have some problems with our firewall and security-policy. im just fixing this...

the servlet iss a simple java-servlet, that runs on a tomcat and accepts registrations via a http-get and then retrieves customer-related and -configured data from our info-server via xml and pushes these data to the blackberry (and so i'm not allowed to publish that code :( ).

you will find a well dokumented sample at the link i already posted(see "Implementing Push Technology") and the sample at
sun's developer-page is also good.

mmkl
Offline  
Old 06-05-2005, 01:30 AM   #5 (permalink)
Knows Where the Search Button Is
 
Join Date: May 2005
Model: 7100T
Posts: 20
Post Thanks: 0
Thanked 0 Times in 0 Posts
Default

Hi:

I tired the static MIDP Push registration and am getting the following error during the Blackberry simulator startup:

javax.microedition.io.ConnectionNotFoundException: socket://:50000 doesn't support push

Could you please tell me what might be the problem. I used the "StreamConnection" to open the socket connection as mentioned in the javadocs for the "Connector" class.

The MIDP-Push-1 property used in the jad file is as follows:

MIDlet-Push-1: socket://:50000, PushMIDlet, *

Can some one tell me what port I should for opening push connection? Should I use the param, "deviceside=true" in the "MIDlet-Push-1" property? Please clarify.

Thanks,
Adkari
Offline  
Old 06-13-2005, 10:52 PM   #6 (permalink)
Knows Where the Search Button Is
 
Join Date: May 2005
Model: 7100T
Posts: 20
Post Thanks: 0
Thanked 0 Times in 0 Posts
Default

Hi:

Can some one post a "working" MIDP2.0 Push sample code based on either static registration?

I have trying MIDP2.0 push for over a week and I am able to get it to work.
I get a RunTimeException during Simulator startup if I use static registration URL as:

MIDlet-Push-1: socket://localhost:50000, PushMIDlet, *

and a ConnectionNotFoundException during simulator startup if I use a static registration URL as:
MIDlet-Push-1: socket://:50000, PushMIDlet, *

Can some one please help me solve this?

Moreover, I am not clear how to make a socket connection to the Blackberry simulator even if I get the MIDLet registered w/o errors? Do I need a Access Point or do I just open a socket connection to the IP address of the machine in which the machine is running and the port specified in the "MIDlet-Push-1" property?

Please do let me know.

Thanks,
Adikari
Offline  
Old 06-14-2005, 06:08 AM   #7 (permalink)
Knows Where the Search Button Is
 
Join Date: Apr 2005
Posts: 17
Post Thanks: 0
Thanked 0 Times in 0 Posts
Default

hi,
did you try a dynamic registration with
Code:
PushRegistry.registerConnection("socket://:50000;deviceside_true", this.getClass().getName(), "*")
?

mmkl
Offline  
Old 09-09-2005, 12:54 PM   #8 (permalink)
New Member
 
Join Date: May 2005
Model: 7520
Posts: 5
Post Thanks: 0
Thanked 0 Times in 0 Posts
Default

BB's example (or maybe you've seen it)

Code:
http://www.blackberry.com/knowledgecenterpublic/livelink.exe/fetch/2000/348583/796557/800332/800429/How_To_-_Register_a_MIDlet_with_the_PushRegistry.html?nodeid=817112&vernum=0
hope that helps, im going to test it soon, ill follow up with results

cheers
pf
Offline  
Old 09-14-2005, 02:15 AM   #9 (permalink)
New Member
 
Join Date: May 2005
Model: 7520
Posts: 5
Post Thanks: 0
Thanked 0 Times in 0 Posts
Default

hey mmkl,
you said you successfully tested this with the mds simulator. Can you describe the conditions of the test? example: local webserver etc? I am trying to recreate a similar procedure only using php and a simple tcp socket server. I have not succeeded (hence the post). I added the deviceside=true to the connection string thinking (alas after 3 days) this MUST be the solution, but still, no bones. Any suggestions would be most appreciated.
Thanks again
pf
Offline  
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-2014 BlackBerryForums.com.
The names RIM and BlackBerry are registered Trademarks of BlackBerry Inc.