Hirdetés
- Megérkezett a Google Pixel 7 és 7 Pro
- iPhone topik
- Xiaomi 14 - párátlanul jó lehetne
- One mobilszolgáltatások
- Samsung Galaxy S25 Ultra - titán keret, acélos teljesítmény
- Apple iPhone 16 - ígéretek földje
- Google Pixel topik
- Amazfit T-Rex 3 Pro – világítós dínó
- Honor Magic5 Pro - kamerák bűvöletében
- Xiaomi Redmi Note 5 Global
Új hozzászólás Aktív témák
-
shinodas
tag
Köszi a válaszokat!
Azt hiszem megoldottam, már csak egy apróság
(ELnézést a tényleg primitív kérdéseimért, de tényleg abszolút kezdő vagyok)
Szóval a logcat azt mondja, h kapcsolódni próbál az eszköz de nem tudja azt befejezni, először azt írja, hogy kapcsolódva, majd 2 sorral lejjebb már ugyan ez az állapot false.import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
import java.util.UUID;
import android.bluetooth.BluetoothAdapter;
import android.bluetooth.BluetoothDevice;
import android.bluetooth.BluetoothSocket;
import android.content.Context;
import android.os.Handler;
import android.util.Log;
public class BluetoothConnection extends Thread {
private BluetoothAdapter bluetooth = null;
private BluetoothSocket socket = null;
private InputStream inputStream = null;
private OutputStream outputStream = null;
private static final UUID uuid = UUID.fromString("00001101-0000-1000-8000-00805F9B34FB");
static final int BL_NOT_AVAILABLE = 1;
static final int BL_SOCKET_FAILED = 2;
protected static final int BL_INCORRECT_ADDRESS = 3;
private Handler mHandler = null;
public BluetoothConnection(Context context, Handler handler){
bluetooth = BluetoothAdapter.getDefaultAdapter();
mHandler = handler;
if(bluetooth == null){
mHandler.sendEmptyMessage(BL_NOT_AVAILABLE);
return;
}
}
public void BT_Connect(String Address){
Log.d("CONNECTION", "...On Resume...");
String address = Address;
if(!BluetoothAdapter.checkBluetoothAddress(address)){
return;
}else{
BluetoothDevice device = bluetooth.getRemoteDevice(address);
try{
socket = device.createRfcommSocketToServiceRecord(uuid);
}catch(IOException e){
Log.d("RFCOMM", "socket create fail" + e.getMessage());
mHandler.sendEmptyMessage(BL_SOCKET_FAILED);
return;
}
bluetooth.cancelDiscovery();
[B]Log.d("BLUETOOTH", "-----CONNECTING---"); //idáig jut[/B]
try{
socket.connect();
Log.d("BLUETOOTH", "Connecting is ok");
}catch(IOException e){
try{
socket.close();
}catch(IOException e2){
Log.d("BLUETOOTH", "In onResume() and unable to close socket during connection failure" + e2.getMessage());
mHandler.sendEmptyMessage(BL_SOCKET_FAILED);
return;
}
}
}
}
}LOGCAT:
06-07 12:48:35.200: I/ActivityManager(231): Starting: Intent { act=android.intent.action.MAIN cat=[android.intent.category.LAUNCHER] flg=0x10200000 cmp=com.example.hxxpd/.MainActivity } from pid 11341
06-07 12:48:35.270: D/CONNECTION(11934): ...On Resume...
06-07 12:48:35.280: E/BluetoothService.cpp(231): stopDiscoveryNative: D-Bus error in StopDiscovery: org.bluez.Error.Failed (Invalid discovery session)
06-07 12:48:35.280: D/BLUETOOTH(11934): -----CONNECTING---
06-07 12:48:35.740: E/BluetoothEventLoop.cpp(231): event_filter: Received signal org.bluez.Device:PropertyChanged from /org/bluez/10666/hci0/dev_CC_AF_78_B4_F7_6A
06-07 12:48:35.740: D/BluetoothService(231): setRemoteDeviceProperty addr = CC:AF:78:B4:F7:6A name = Connected value = true
06-07 12:48:37.090: D/BluetoothService(231): updateDeviceServiceChannelCache(CC:AF:78:B4:F7:6A)
06-07 12:48:37.110: D/BluetoothService(231): uuid(system): 0000111e-0000-1000-8000-00805f9b34fb 3
06-07 12:48:37.120: D/BluetoothService(231): uuid(system): 00001105-0000-1000-8000-00805f9b34fb 10
06-07 12:48:37.140: V/BluetoothEventRedirector(11975): Received android.bleutooth.device.action.UUID
06-07 12:48:37.140: D/BluetoothService(231): Cleaning up failed UUID channel lookup: CC:AF:78:B4:F7:6A 00001101-0000-1000-8000-00805f9b34fb
06-07 12:48:37.330: E/CachedBluetoothDevice(11975): updating profiles for JABBA
06-07 12:48:37.330: V/CachedBluetoothDevice(11975): Class: 7e010c
06-07 12:48:37.330: V/CachedBluetoothDevice(11975): UUID:
06-07 12:48:37.360: V/CachedBluetoothDevice(11975): 00001000-0000-1000-8000-00805f9b34fb
06-07 12:48:37.390: V/CachedBluetoothDevice(11975): 00001104-0000-1000-8000-00805f9b34fb
06-07 12:48:37.390: V/CachedBluetoothDevice(11975): 00001105-0000-1000-8000-00805f9b34fb
06-07 12:48:37.390: V/CachedBluetoothDevice(11975): 00001106-0000-1000-8000-00805f9b34fb
06-07 12:48:37.410: V/CachedBluetoothDevice(11975): 0000110a-0000-1000-8000-00805f9b34fb
06-07 12:48:37.420: V/CachedBluetoothDevice(11975): 0000110b-0000-1000-8000-00805f9b34fb
06-07 12:48:37.420: V/CachedBluetoothDevice(11975): 0000110c-0000-1000-8000-00805f9b34fb
06-07 12:48:37.420: V/CachedBluetoothDevice(11975): 0000110e-0000-1000-8000-00805f9b34fb
06-07 12:48:37.420: V/CachedBluetoothDevice(11975): 00001112-0000-1000-8000-00805f9b34fb
06-07 12:48:37.440: V/CachedBluetoothDevice(11975): 00001115-0000-1000-8000-00805f9b34fb
06-07 12:48:37.440: V/CachedBluetoothDevice(11975): 0000111b-0000-1000-8000-00805f9b34fb
06-07 12:48:37.470: V/CachedBluetoothDevice(11975): 0000111e-0000-1000-8000-00805f9b34fb
06-07 12:48:37.470: V/CachedBluetoothDevice(11975): 0000111f-0000-1000-8000-00805f9b34fb
06-07 12:48:37.470: V/CachedBluetoothDevice(11975): 00001123-0000-1000-8000-00805f9b34fb
06-07 12:48:37.470: V/CachedBluetoothDevice(11975): 0350278f-3dca-4e62-831d-a41165ff906c
06-07 12:48:37.470: E/CachedBluetoothDevice(11975): onUuidChanged: Time since last connect67267896
06-07 12:48:41.100: E/BluetoothEventLoop.cpp(231): event_filter: Received signal org.bluez.Device:PropertyChanged from /org/bluez/10666/hci0/dev_CC_AF_78_B4_F7_6A
06-07 12:48:41.100: D/BluetoothService(231): setRemoteDeviceProperty addr = CC:AF:78:B4:F7:6A name = Connected value = false
06-07 12:48:41.330: V/BluetoothEventRedirector(11975): Received android.bleutooth.device.action.UUID
06-07 12:48:41.350: E/CachedBluetoothDevice(11975): updating profiles for JABBA
06-07 12:48:41.350: V/CachedBluetoothDevice(11975): Class: 7e010c
06-07 12:48:41.350: V/CachedBluetoothDevice(11975): UUID:
06-07 12:48:41.350: V/CachedBluetoothDevice(11975): 00001000-0000-1000-8000-00805f9b34fb
06-07 12:48:41.350: V/CachedBluetoothDevice(11975): 00001104-0000-1000-8000-00805f9b34fb
06-07 12:48:41.350: V/CachedBluetoothDevice(11975): 00001105-0000-1000-8000-00805f9b34fb
06-07 12:48:41.350: V/CachedBluetoothDevice(11975): 00001106-0000-1000-8000-00805f9b34fb
06-07 12:48:41.350: V/CachedBluetoothDevice(11975): 0000110a-0000-1000-8000-00805f9b34fb
06-07 12:48:41.350: V/CachedBluetoothDevice(11975): 0000110b-0000-1000-8000-00805f9b34fb
06-07 12:48:41.350: V/CachedBluetoothDevice(11975): 0000110c-0000-1000-8000-00805f9b34fb
06-07 12:48:41.350: V/CachedBluetoothDevice(11975): 0000110e-0000-1000-8000-00805f9b34fb
06-07 12:48:41.350: V/CachedBluetoothDevice(11975): 00001112-0000-1000-8000-00805f9b34fb
06-07 12:48:41.350: V/CachedBluetoothDevice(11975): 00001115-0000-1000-8000-00805f9b34fb
06-07 12:48:41.359: V/CachedBluetoothDevice(11975): 0000111b-0000-1000-8000-00805f9b34fb
06-07 12:48:41.359: V/CachedBluetoothDevice(11975): 0000111e-0000-1000-8000-00805f9b34fb
06-07 12:48:41.359: V/CachedBluetoothDevice(11975): 0000111f-0000-1000-8000-00805f9b34fb
06-07 12:48:41.359: V/CachedBluetoothDevice(11975): 00001123-0000-1000-8000-00805f9b34fb
06-07 12:48:41.359: V/CachedBluetoothDevice(11975): 0350278f-3dca-4e62-831d-a41165ff906c
06-07 12:48:41.359: E/CachedBluetoothDevice(11975): onUuidChanged: Time since last connect67271789
Új hozzászólás Aktív témák
- Megérkezett a Google Pixel 7 és 7 Pro
- iPhone-t használók OFF topikja
- Azonnali alaplapos kérdések órája
- Vezetékes FEJhallgatók
- Linux kezdőknek
- laca223: A civilizáció mint bugos operációs rendszer
- Kodi és kiegészítői magyar nyelvű online tartalmakhoz (Linux, Windows)
- Battlefield 6
- BestBuy topik
- Futás, futópályák
- További aktív témák...
- AMD Radeon 7600 8GB OC HIBÁTLAN!!
- Hibátlan 2+ Év Garancia! GIGABYTE GeForce RTX 4060 EAGLE OC 8GB
- AZONNAL KÉSZLETRŐL! AMD Ryzen 7 9800X3D 64GB 6000MHz RAM 2TB Gen4 SSD RTX 5090 32GB GDDR7 1200W
- AZONNAL KÉSZLETRŐL! Intel Core i5 14600K 64GB 6000MHz RAM 2TB Gen4 SSD RTX 5060 8GB FSP 750W
- AZONNAL KÉSZLETRŐL! Intel Core i5 14600K 32GB 6000MHz RAM 2TB Gen4 SSD RTX 5060 8GB FSP 750W
- BESZÁMÍTÁS! ASROCK H510M i5 11400F 16GB DDR4 1TB SSD RX 7600 8GB Zalman S2 TG Cooler Master 650W
- ÁRGARANCIA!Épített KomPhone Ryzen 5 5600X 16/32/64GB RAM RTX 5060 8GB GAMER PC termékbeszámítással
- BESZÁMÍTÁS! ASUS ROG Crosshair VIII Extreme alaplap garanciával hibátlan működéssel
- LG 45GR95QE - 45" Ívelt OLED / 2K WQHD / 240Hz 0.03ms / NVIDIA G-Sync / FreeSync Premium / HDMI 2.1
- Dell Latitude 5400 14" FHD IPS, i7 8665U, 8-16GB RAM, SSD, jó akku, számla, 6 hó gar
Állásajánlatok
Cég: Laptopszaki Kft.
Város: Budapest
Cég: PCMENTOR SZERVIZ KFT.
Város: Budapest
Azt hiszem megoldottam, már csak egy apróság


