在Android中使用apachecommons的Telnet

在Android中使用apachecommons的Telnet,android,apache,telnet,Android,Apache,Telnet,您好,我正在尝试使用ApacheCommons库为android创建一个应用程序。 此应用程序必须连接到服务器并使用Telnet发出一些命令。 这是我的申请表。。。 舱单: <?xml version="1.0" encoding="utf-8"?> <manifest xmlns:android="http://schemas.android.com/apk/res/android" package="com.example.test" android:ver

您好,我正在尝试使用ApacheCommons库为android创建一个应用程序。 此应用程序必须连接到服务器并使用Telnet发出一些命令。 这是我的申请表。。。 舱单:

<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
    package="com.example.test"
    android:versionCode="1"
    android:versionName="1.0" >
    <uses-permission android:name="android.permission.INTERNET" />
    <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
    <uses-library android:name="org.apache.commons.net.telnet.TelnetClient" /> 
    <uses-sdk
        android:minSdkVersion="7"
        android:targetSdkVersion="15" />  
    <application
        android:allowBackup="true"
        android:icon="@drawable/ic_launcher"
        android:label="@string/app_name"
        android:theme="@style/AppTheme" >
        <activity
            android:name="com.example.test.MainActivity"
            android:label="@string/app_name" >
            <intent-filter>
                <action android:name="android.intent.action.MAIN" />
                <category android:name="android.intent.category.LAUNCHER" />
            </intent-filter>
        </activity>
    </application>
</manifest>
当我运行它时,Eclipse不会返回任何错误。 请帮助我:(
我哪里错了?

它永远不会显示任何错误,因为您正在捕获每个异常,并且不会对其执行任何操作

在catch块中,您请求异常消息,但您既不存储此消息,也不记录它或以任何其他方式显示它

要记录异常,请在catch块中使用如下内容:

Log.e("com.example.test.MainActivity", ex.getMessage());
甚至:

Log.e("com.example.test.MainActivity", "MyFault", ex);

那么错误是什么?发生了什么/应该发生什么?请giva描述您的实际问题。没有发生任何事情。没有错误。我认为问题在打印流中,因为连接启动但MKDIR失败。知道吗???它没有显示任何错误但不起作用。您如何知道连接启动且MKDIR失败?如果有这个信息你应该把它放在你的问题中!我用其他库解决了我的问题,谢谢你的帮助。
Log.e("com.example.test.MainActivity", "MyFault", ex);