BlackBerry Forums Support Community
              

Closed Thread
 
Thread Tools
Old 06-02-2005, 08:14 AM   #1
Adikari
Knows Where the Search Button Is
 
Join Date: May 2005
Model: 7100T
Posts: 20
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, 08:38 AM   #2
mmkl
Knows Where the Search Button Is
 
Join Date: Apr 2005
Posts: 17
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, 02:19 PM   #3
Adikari
Knows Where the Search Button Is
 
Join Date: May 2005
Model: 7100T
Posts: 20
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, 04:52 AM   #4
mmkl
Knows Where the Search Button Is
 
Join Date: Apr 2005
Posts: 17
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, 12:30 AM   #5
Adikari
Knows Where the Search Button Is
 
Join Date: May 2005
Model: 7100T
Posts: 20
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, 09:52 PM   #6
Adikari
Knows Where the Search Button Is
 
Join Date: May 2005
Model: 7100T
Posts: 20
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, 05:08 AM   #7
mmkl
Knows Where the Search Button Is
 
Join Date: Apr 2005
Posts: 17
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, 11:54 AM   #8
paulfynch
New Member
 
Join Date: May 2005
Model: 7520
Posts: 5
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, 01:15 AM   #9
paulfynch
New Member
 
Join Date: May 2005
Model: 7520
Posts: 5
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



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

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


Samsung ER-4915 Cash Register with Key PARTS ONLY picture

Samsung ER-4915 Cash Register with Key PARTS ONLY

$119.99



Samsung OfficServ 100 Enterprise IP Solution picture

Samsung OfficServ 100 Enterprise IP Solution

$260.00



New In Box SAMSUNG LTM170EU-L31 LCD Display Panel 17

New In Box SAMSUNG LTM170EU-L31 LCD Display Panel 17"

$188.88



NEW Samsung LTM190ET01 LCD Screen Display Panel 19-inch   picture

NEW Samsung LTM190ET01 LCD Screen Display Panel 19-inch

$173.91



USED Samsung LTM150XI-A01 LCD Display Panel picture

USED Samsung LTM150XI-A01 LCD Display Panel

$224.30



Samsung WiseNET SNV-7084RN 3Mp 3-8.5Mm Lens Network Dome Security Camera picture

Samsung WiseNET SNV-7084RN 3Mp 3-8.5Mm Lens Network Dome Security Camera

$199.00







Copyright © 2004-2016 BlackBerryForums.com.
The names RIM © and BlackBerry © are registered Trademarks of BlackBerry Inc.