A strange problem in org.bluez.Adapter

Put your problem here if it does not fit any of the other categories.

A strange problem in org.bluez.Adapter

Postby sjtcool » Fri Dec 21, 2007 8:56 am

hi all.
when I try to create an Adapter, I use the constructor Adapter(String),
but eclipse suggests: the constructor Adapter(String) is not visible.
Can any one tell me the reason?

thx~

Syntax: [ Download ] [ Hide ]
Using java Syntax Highlighting
  1.  
  2. //import ...;
  3.  
  4. import org.bluez.Adapter;
  5.  
  6.  
  7.  
  8. public class btdemo extends Activity {
  9.  
  10. private Adapter btasapter= null;
  11.  
  12.  
  13.  
  14.     public void onCreate(Bundle icicle) {
  15.  
  16.         super.onCreate(icicle);
  17.  
  18.         btasapter = new Adapter("demo");// the constructor Adapter(String) is not visible.
  19.  
  20.  
  21.  
  22.         setContentView(R.layout.main);
  23.  
  24.     }  
  25.  
  26. }
  27.  
  28.  
Parsed in 0.031 seconds, using GeSHi 1.0.8.4


--!
sjtcool
Junior Developer
Junior Developer
 
Posts: 11
Joined: Wed Dec 19, 2007 3:18 am
Location: Nanjing

Top

Postby hugopicado » Fri Dec 21, 2007 4:20 pm

Check out the API documentation: $(ANDROID_SDK_PATH)/docs/reference/org/bluez/Adapter.html

There is no public constructor Adapter(String).

Regards,
Hugo.
hugopicado
Freshman
Freshman
 
Posts: 8
Joined: Fri Dec 14, 2007 2:31 am

Postby sjtcool » Mon Dec 24, 2007 1:30 am

thx, and is there any way to use Adapter(String), while the final class has no public constructor?
hugopicado wrote:Check out the API documentation: $(ANDROID_SDK_PATH)/docs/reference/org/bluez/Adapter.html

There is no public constructor Adapter(String).

Regards,
Hugo.
sjtcool
Junior Developer
Junior Developer
 
Posts: 11
Joined: Wed Dec 19, 2007 3:18 am
Location: Nanjing

Postby hugopicado » Mon Dec 24, 2007 3:21 am

Well I never worked with Bluetooth Adapters before, but I was researching and you have a Manager in the org.bluez package which has a method getDefaultAdapter().

On the other side, the Manager does not have a public constructor too. But you have an Interface named IBluetoothService which has a method getManager().

I didn't found any implementation of that interface so I guess you have to implement the IBluetoothService by yourself to get all the other information you need.

Sorry for the lack of information but I neved worked with this so maybe my help is not helpful enough.

Regards,
Hugo.
hugopicado
Freshman
Freshman
 
Posts: 8
Joined: Fri Dec 14, 2007 2:31 am

Postby sjtcool » Thu Dec 27, 2007 4:01 am

Thx, in fact , getManager() return null Adapter, maybe as google said, bluetooth is not suported in this release.
hugopicado wrote:Well I never worked with Bluetooth Adapters before, but I was researching and you have a Manager in the org.bluez package which has a method getDefaultAdapter().

On the other side, the Manager does not have a public constructor too. But you have an Interface named IBluetoothService which has a method getManager().

I didn't found any implementation of that interface so I guess you have to implement the IBluetoothService by yourself to get all the other information you need.

Sorry for the lack of information but I neved worked with this so maybe my help is not helpful enough.

Regards,
Hugo.
sjtcool
Junior Developer
Junior Developer
 
Posts: 11
Joined: Wed Dec 19, 2007 3:18 am
Location: Nanjing

Top

Return to Other Coding-Problems

Who is online

Users browsing this forum: No registered users and 13 guests