BlackBerry Forums Support Community
              

Closed Thread
 
Thread Tools
Old 05-07-2009, 11:10 AM   #1
udioster
New Member
 
Join Date: May 2009
Model: 9000
PIN: N/A
Carrier: celcom
Posts: 1
Default BlackBerry and J2ME OBex push support

Please Login to Remove!

I was writing a simple J2ME app sending an inventation (Obex push message) to the desired Device according to it's BT Mac address.
It works great on almost all the phones I tried it on, the problem with the BB is that each time I try to search for it's services I have to enter a Pass key for pairing. Even if I guess (correctly) the service on the blackberry I can't send the message without pairing the device before hand.
is there any possible way to bypass the Passkey? to push a message without the pairing process? again, it is possible on each and every other Nokia \ Sony Ericsson \ Motorola devices I tried it on.

Here is the relevent piece of code (read this code assuming the BTMAC and the port are valid. For getting the service URL In the actual code I used the classic way that from some reason would pop up annoying Passkey message before I could reach the service URL):

public boolean SendObexInvitation(String BTMAC, String msg)
{
port = 'q';
// create the file content
String file_content = new String(FILE_CONTENT1 + msg + FILE_CONTENT2 + NSOF_URL + FILE_CONTENT3);
try
{
searchService(BTMAC);
synchronized (o)
{
o.wait();
}

if (port == 'q')
return false;
//create the service URL
String service_url = new String(SERVICE_HEADER + BTMAC + SERVICE_FOOTER + port);
ClientSession cs = (ClientSession) Connector.open(service_url);

HeaderSet hs = cs.createHeaderSet();

// now let's send the connect header
cs.connect(hs);
String text = new String (file_content);
hs.setHeader(HeaderSet.NAME, FILE_NAME);
hs.setHeader(HeaderSet.TYPE, FILE_TYPE);

Operation putOperation = cs.put(hs);
OutputStream outputStream = putOperation.openOutputStream();
outputStream.write(text.getBytes(ENCODING));
// file push complete

outputStream.close();
putOperation.close();

cs.disconnect(null);

cs.close();

return (true);
}
catch(Exception exp)
{
System.out.println("couldn;t make it!");
}
return false;
}
}
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


WIFI Audio Voice Recorder Live Real-Time Audio Thru App | Charger & 32GB SD Card picture

WIFI Audio Voice Recorder Live Real-Time Audio Thru App | Charger & 32GB SD Card

$129.00



Merrick 19606 Memory Control Board - Used picture

Merrick 19606 Memory Control Board - Used

$399.99



1PC New ABB ACS880-MU-ZCU-12/14 ZMU-02 Inverter Memory Card 1year waranty picture

1PC New ABB ACS880-MU-ZCU-12/14 ZMU-02 Inverter Memory Card 1year waranty

$84.46



NEW Mitsubishi A1SNMCA-8KE Memory Cassette picture

NEW Mitsubishi A1SNMCA-8KE Memory Cassette

$151.62



1PC NEW Memory card 2711-NM11 2711-NM11 SPOT STOCK picture

1PC NEW Memory card 2711-NM11 2711-NM11 SPOT STOCK

$367.22



Oktis - 2 Portable Fuel Analyzer Tester Meter Octane Number Gasoline Petrol picture

Oktis - 2 Portable Fuel Analyzer Tester Meter Octane Number Gasoline Petrol

$179.99







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