-1

On the Android developers website, there is code regarding Android Bluetooth connectivity and such. I am very new to Android, and hence can't even follow a simple tutorial. There is a certain section of code

BluetoothAdapter myBluetooth = BluetoothAdapter.getDefaultAdapter();

Where does this line belong? Does it belong in the main activity or a new, separate activity?

durron597
  • 31,968
  • 17
  • 99
  • 158
YoKaGe
  • 385
  • 2
  • 7
  • 15
  • Perhaps you should start with a simple Java tutorial and then work your way up to Bluetooth as you go? – Stephen Kiningham Jul 28 '11 at 19:18
  • I don't have enough time-i got deadlines – YoKaGe Jul 28 '11 at 19:21
  • I'm sorry to hear that, but honestly you're going to end up with a lot more problems like the one above if you rush through it without understanding what you're doing. It's a classic case of "do it right the first time." Just my $0.02 obviously. – Stephen Kiningham Jul 28 '11 at 19:23
  • coudl you recomend a quick java tutorial that won't take up too much of my time – YoKaGe Jul 28 '11 at 19:25
  • 1
    I would look through the Hello, World program if you haven't already (http://developer.android.com/resources/tutorials/hello-world.html) and I would also look at something like this: http://heather.cs.ucdavis.edu/~matloff/Java/JavaIntro.html – Stephen Kiningham Jul 28 '11 at 19:28
  • There is absolutely no quick way. If you 'got deadlines', pay someone to do it for you. – Trevor Jul 28 '11 at 19:44

2 Answers2

1
BluetoothAdapter myBluetooth = BluetoothAdapter.getDefaultAdapter();

belongs in main().

1

There's also a book called "Sam's teach yourself Java in 24hrs".

Fernando
  • 21
  • 3