\n <\/td>\n | /*<\/span><\/td>\n <\/tr>\n \n <\/td>\n | * Copyright (C) 2009 The Android Open Source Project<\/span><\/td>\n <\/tr>\n \n <\/td>\n | *<\/span><\/td>\n <\/tr>\n \n <\/td>\n | * Licensed under the Apache License, Version 2.0 (the "License");<\/span><\/td>\n <\/tr>\n \n <\/td>\n | * you may not use this file except in compliance with the License.<\/span><\/td>\n <\/tr>\n \n <\/td>\n | * You may obtain a copy of the License at<\/span><\/td>\n <\/tr>\n \n <\/td>\n | *<\/span><\/td>\n <\/tr>\n \n <\/td>\n | * http://www.apache.org/licenses/LICENSE-2.0<\/span><\/td>\n <\/tr>\n \n <\/td>\n | *<\/span><\/td>\n <\/tr>\n \n <\/td>\n | * Unless required by applicable law or agreed to in writing, software<\/span><\/td>\n <\/tr>\n \n <\/td>\n | * distributed under the License is distributed on an "AS IS" BASIS,<\/span><\/td>\n <\/tr>\n \n <\/td>\n | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.<\/span><\/td>\n <\/tr>\n \n <\/td>\n | * See the License for the specific language governing permissions and<\/span><\/td>\n <\/tr>\n \n <\/td>\n | * limitations under the License.<\/span><\/td>\n <\/tr>\n \n <\/td>\n | */<\/span><\/td>\n <\/tr>\n \n <\/td>\n | \n<\/td>\n <\/tr>\n | \n <\/td>\n | package<\/span> com<\/span>.example<\/span>.android<\/span>.BluetoothChat<\/span>;<\/td>\n <\/tr>\n \n <\/td>\n | \n<\/td>\n <\/tr>\n | \n <\/td>\n | import<\/span> android<\/span>.app<\/span>.Activity<\/span>;<\/td>\n <\/tr>\n \n <\/td>\n | import<\/span> android<\/span>.bluetooth<\/span>.BluetoothAdapter<\/span>;<\/td>\n <\/tr>\n \n <\/td>\n | import<\/span> android<\/span>.bluetooth<\/span>.BluetoothDevice<\/span>;<\/td>\n <\/tr>\n \n <\/td>\n | import<\/span> android<\/span>.content<\/span>.Intent<\/span>;<\/td>\n <\/tr>\n \n <\/td>\n | import<\/span> android<\/span>.os<\/span>.Bundle<\/span>;<\/td>\n <\/tr>\n \n <\/td>\n | import<\/span> android<\/span>.os<\/span>.Handler<\/span>;<\/td>\n <\/tr>\n \n <\/td>\n | import<\/span> android<\/span>.os<\/span>.Message<\/span>;<\/td>\n <\/tr>\n \n <\/td>\n | import<\/span> android<\/span>.util<\/span>.Log<\/span>;<\/td>\n <\/tr>\n \n <\/td>\n | import<\/span> android<\/span>.view<\/span>.KeyEvent<\/span>;<\/td>\n <\/tr>\n \n <\/td>\n | import<\/span> android<\/span>.view<\/span>.Menu<\/span>;<\/td>\n <\/tr>\n \n <\/td>\n | import<\/span> android<\/span>.view<\/span>.MenuInflater<\/span>;<\/td>\n <\/tr>\n \n <\/td>\n | import<\/span> android<\/span>.view<\/span>.MenuItem<\/span>;<\/td>\n <\/tr>\n \n <\/td>\n | import<\/span> android<\/span>.view<\/span>.View<\/span>;<\/td>\n <\/tr>\n \n <\/td>\n | import<\/span> android<\/span>.view<\/span>.Window<\/span>;<\/td>\n <\/tr>\n \n <\/td>\n | import<\/span> android<\/span>.view<\/span>.View<\/span>.OnClickListener<\/span>;<\/td>\n <\/tr>\n \n <\/td>\n | import<\/span> android<\/span>.view<\/span>.inputmethod<\/span>.EditorInfo<\/span>;<\/td>\n <\/tr>\n \n <\/td>\n | import<\/span> android<\/span>.widget<\/span>.ArrayAdapter<\/span>;<\/td>\n <\/tr>\n \n <\/td>\n | import<\/span> android<\/span>.widget<\/span>.Button<\/span>;<\/td>\n <\/tr>\n \n <\/td>\n | import<\/span> android<\/span>.widget<\/span>.EditText<\/span>;<\/td>\n <\/tr>\n \n <\/td>\n | import<\/span> android<\/span>.widget<\/span>.ListView<\/span>;<\/td>\n <\/tr>\n \n <\/td>\n | import<\/span> android<\/span>.widget<\/span>.TextView<\/span>;<\/td>\n <\/tr>\n \n <\/td>\n | import<\/span> android<\/span>.widget<\/span>.Toast<\/span>;<\/td>\n <\/tr>\n \n <\/td>\n | \n<\/td>\n <\/tr>\n | \n <\/td>\n | /**<\/span><\/td>\n <\/tr>\n \n <\/td>\n | * This is the main Activity that displays the current chat session.<\/span><\/td>\n <\/tr>\n \n <\/td>\n | */<\/span><\/td>\n <\/tr>\n \n <\/td>\n | public<\/span> class<\/span> BluetoothChat<\/span> extends<\/span> Activity<\/span> {<\/td>\n <\/tr>\n \n <\/td>\n | // Debugging<\/span><\/td>\n <\/tr>\n \n <\/td>\n | private<\/span> static<\/span> final<\/span> String<\/span> TAG<\/span> = "BluetoothChat"<\/span>;<\/td>\n <\/tr>\n \n <\/td>\n | private<\/span> static<\/span> final<\/span> boolean<\/span> D<\/span> = true<\/span>;<\/td>\n <\/tr>\n \n <\/td>\n | \n<\/td>\n <\/tr>\n | \n <\/td>\n | // Message types sent from the BluetoothChatService Handler<\/span><\/td>\n <\/tr>\n \n <\/td>\n | public<\/span> static<\/span> final<\/span> int<\/span> MESSAGE_STATE_CHANGE<\/span> = 1<\/span>;<\/td>\n <\/tr>\n \n <\/td>\n | public<\/span> | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | |