android


Scanning for available bluetooth devices and get the name of all the device(But i am getting null at the name of some Devices)


Using this code i am getting null at the name of the some devices name. Please some on give me the solution how i identify the which type of the devices return null at there name.
public class MainActivity extends ActionBarActivity {
private ListView listView;
private ArrayList<String> mDeviceList = new ArrayList<String>();
private BluetoothAdapter mBluetoothAdapter;
#Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
listView = (ListView) findViewById(R.id.listView);
mBluetoothAdapter = BluetoothAdapter.getDefaultAdapter();
mBluetoothAdapter.startDiscovery();
IntentFilter filter = new IntentFilter(BluetoothDevice.ACTION_FOUND);
registerReceiver(mReceiver, filter);
}
#Override
protected void onDestroy() {
unregisterReceiver(mReceiver);
super.onDestroy();
}
private final BroadcastReceiver mReceiver = new BroadcastReceiver() {
public void onReceive(Context context, Intent intent) {
String action = intent.getAction();
if (BluetoothDevice.ACTION_FOUND.equals(action)) {
BluetoothDevice device = intent
.getParcelableExtra(BluetoothDevice.EXTRA_DEVICE);
mDeviceList.add(device.getName() + "\n" + device.getAddress());
Log.i("BT", device.getName() + "\n" + device.getAddress() +"\n" + device.);
listView.setAdapter(new ArrayAdapter<String>(context,
android.R.layout.simple_list_item_1, mDeviceList));
}
}
};
}

Related Links

make Marker's Title Clickable
New Group (Parent) to Expandable List View in android
Android: Cannot be resolved or is not a field , possible help required
Trying to add facebooksdk.jar file to my project
Trace the location only on Road in Google maps V2 android
StableArrayAdapter vs ArrayAdapter
Multiple Dialog Pop up on single click
Setting textview at bottom in android
how to input data from Object into SimpleAdapter
How can i write a part of string in Integer.toString
View my applications db in mobile for HTC one
I want to display source class array list into destination class
SimpleCursorAdapter is not populating ListView
Send email with attachment from internal storage
Android Studio Pre Dexing fails
Make a static text appear on activity load

Categories

HOME
uml
url-redirection
webdriver
pyqt
mstest
jwplayer
replace
entity-framework-core
simulink
limit
x264
boto3
bing-maps
syntaxnet
enthought
text-mining
windows-ce
endpoint
scsi
google-container-registry
visual-studio-extensions
aggregation
gpio
angular-translate
exchangewebservices
subclass
mql
r-grid
rselenium
mailkit
android-gridview
getpixel
navigator
google-earth-engine
tex
amazon-ses
protein-database
verifiable-c
spring-mvc-test
tasm
sharp-snmp
install.packages
print-css
plr
oracle-service-bus
outputcache
clang++
rfc3339
phpdbg
mesosphere
nanoc
xbmc
configurationmanager
launchctl
aquamacs
yii2-user
git-flow
payload
cpu-cache
jtree
smartfoxserver
pure-css
mapxtreme
flex4.6
ng-grid
simevents
query-by-example
blitline
character-replacement
tfs-workitem
omnifaces
git-ftp
mraid
mass-assignment
apache-spark-1.3
primitive-types
pseudo-class
xml-namespaces
unix-socket
ss7
grails-plugin-rabbitmq
jjaql
tinyxml
jquery-slider
square-bracket
isqlquery
mongohq
facebook-timeline
node-blade
fb.ui
apache-abdera
device-width
mapping-by-code
ilasm
stress
strsep
twitterizer
updatesourcetrigger
office-2007
aspmenu
eclipse-marketplace
scrollbars
dsl-tools
xpsdocument

Resources

Encrypt Message