Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/java/324.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/android/181.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Java 蓝牙聊天-SDK示例-打开蓝牙后停止工作 你好_Java_Android_Eclipse_Sdk_Chat - Fatal编程技术网

Java 蓝牙聊天-SDK示例-打开蓝牙后停止工作 你好

Java 蓝牙聊天-SDK示例-打开蓝牙后停止工作 你好,java,android,eclipse,sdk,chat,Java,Android,Eclipse,Sdk,Chat,今天我尝试运行名为“蓝牙聊天”的示例应用程序表单SKD。不幸的是,出现了一些问题-当我试图启动应用程序时,我收到消息“应用程序”。。。“已意外停止”。我的情况下,当我把它没有积极的蓝牙我得到了关于激活BT的问题,然后。。。再次提供有关崩溃的信息。我试着在通过电缆连接的手机上运行它。 在这种情况下,当我没有更改代码中的任何内容并且代码不起作用时,我该怎么办 谢谢你的帮助。 Mat这种应用程序是bombard应用程序。它们对您的机器或手机有害。请卸载,确保只安装具有有效证书的应用程序。 对于andr

今天我尝试运行名为“蓝牙聊天”的示例应用程序表单SKD。不幸的是,出现了一些问题-当我试图启动应用程序时,我收到消息“应用程序”。。。“已意外停止”。我的情况下,当我把它没有积极的蓝牙我得到了关于激活BT的问题,然后。。。再次提供有关崩溃的信息。我试着在通过电缆连接的手机上运行它。 在这种情况下,当我没有更改代码中的任何内容并且代码不起作用时,我该怎么办

谢谢你的帮助。
Mat这种应用程序是bombard应用程序。它们对您的机器或手机有害。请卸载,确保只安装具有有效证书的应用程序。 对于android,请务必检查您的硬件是否可用;它与受人尊敬的软件兼容,因为有时不同的硬件更喜欢不同的应用程序

我的建议是卸载或删除该应用程序,以免它损害您的安全 机器 如果你愿意,请接受我的回答


我认为这是因为您的android手机版本和sdk示例版本不符,或者您的手机版本早于您正在运行的示例版本

bluetoothchat示例代码中的某些内容在SDK 7、10、17中发生了更改,因此,例如,如果您的android版本为4.2,那么如果SDK示例的版本为2.3.6,则可能会出现问题


如果sdk示例晚于您的android设备,您肯定会遇到问题。

在AndroidManifest.xml中,将最小sdk更改为11,如下所示

<uses-sdk
    android:minSdkVersion="11"
    android:targetSdkVersion="16" />

请复制下面的所有代码,然后将所有代码粘贴到BluetoothChat目录中的AndroidManifest.xml文件中(例如:在Eclipse中)。它对我有用。(我正在使用Android 4.4 SDK)



好的,但是“样本”中的其他内容很好用——那么为什么是这样呢?只有一个——这个聊天——不起作用?不,先生,它不起作用。尝试从可靠的网络下载。我有Android 4.1.2,所以我认为它应该可以工作,但我仍然有同样的问题,因为在启动后出现此错误,我甚至无法打开此应用程序。@matgod您正在运行的bluetoothchat示例的SDK版本是什么?
<?xml version="1.0" encoding="utf-8"?>
<!-- Copyright (C) 2009 The Android Open Source Project

 Licensed under the Apache License, Version 2.0 (the "License");
 you may not use this file except in compliance with the License.
 You may obtain a copy of the License at

      http://www.apache.org/licenses/LICENSE-2.0

 Unless required by applicable law or agreed to in writing, software
 distributed under the License is distributed on an "AS IS" BASIS,
 WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 See the License for the specific language governing permissions and
 limitations under the License.
-->
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
  package="com.example.android.BluetoothChat"
  android:versionCode="1"
  android:versionName="1.0">
<uses-sdk
android:minSdkVersion="11"
android:targetSdkVersion="16" />
<uses-permission android:name="android.permission.BLUETOOTH_ADMIN" />
<uses-permission android:name="android.permission.BLUETOOTH" />

<application android:label="@string/app_name"
             android:icon="@drawable/app_icon" >
    <activity android:name=".BluetoothChat"
              android:label="@string/app_name"
              android:configChanges="orientation|keyboardHidden">
        <intent-filter>
            <action android:name="android.intent.action.MAIN" />
            <category android:name="android.intent.category.LAUNCHER" />
        </intent-filter>
    </activity>
    <activity android:name=".DeviceListActivity"
              android:label="@string/select_device"
              android:theme="@android:style/Theme.Holo.Dialog"
              android:configChanges="orientation|keyboardHidden" />
</application>