Groups
Groups
Sign in
Groups
Groups
Android-SDK-Japan
Conversations
About
Send feedback
Help
Android SDK2.0でBluetoothを使ってみる
170 views
Skip to first unread message
ugrie
unread,
Nov 5, 2009, 12:22:44 PM
11/5/09
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to Android-SDK-Japan
初めましてugrieです。
Android SDK2.0をインストールして早速新機能を使おうと思ってBluetoothを使用してみました。
しかし、
おちます。アプリを起動すると。
「予期せず停止しました。やり直してください。」
と出てしまいます。
ソースコードは
デフォルトのコードのOnCreateに
BluetoothAdapter bluetooth = BluetoothAdapter.getDefaultAdapter();
を記述しただけです。
もちろんAndroidManifest.xmlに
<uses-permission android:name="android.permission.BLUETOOTH"/>
<uses-permission android:name="android.permission.BLUETOOTH_ADMIN"/>
を追加しています。パーミッションの書き方が間違えているのでしょうか。
何か知っている方がおりましたら教えてほしいです。
esmasui
unread,
Nov 5, 2009, 7:17:21 PM
11/5/09
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to Android-SDK-Japan
ますいと申します。
アプリケーションはエミュレーターで動作させておいでですか?
エミュレーターはBluetoothが無効化されており、実行時にエラーを吐いて落ちてしまいます。
esmasui
unread,
Nov 5, 2009, 11:47:22 PM
11/5/09
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to Android-SDK-Japan
ますいです。
ごめんなさい。よく読まずにポストしてしまいました。
#getDefaultAdapter()を呼んでいるだけなんですね。
エミュレーター上の#getDefaultAdapter()の呼び出しはnullを返すので、その後何かしようとすると落ちてしまうのですが、
それ以前でしたね。
エラー時のログを貼り付けていただければ、原因がわかるかもしれません。
On 11月6日, 午前2:22, ugrie <
ugrie2...@gmail.com
> wrote:
Reply all
Reply to author
Forward
0 new messages