我已经搜索了几个小时,但都是徒劳的。我正在开发一个名为Yamba的教程应用程序,该应用程序来自学习android一书。这是一个在推特上更新状态的应用程序。它使用jtwitter.jar库。我正在使用的东西:
- linux(ubuntu(
- ant调试(构建我的项目(
- 我的安卓手机用于测试该应用程序
该项目成功构建并在我的手机上安装了该应用程序,但当我运行该应用程序时,我收到错误">不幸的是,Yamba已停止"。我有以下文件:
AndroidManifest.xml文件为--
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.example.Yamba"
android:versionCode="1"
android:versionName="1.0">
<application android:label="@string/app_name" android:icon="@drawable/ic_launcher">
<activity android:name=".Yamba"
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>
<uses-permission android:name="android.permission.INTERNET"/>
</manifest>
我的Yamba.java文件为--
package com.example.Yamba;
import winterwell.jtwitter.Twitter;
import android.app.Activity;
import android.os.Bundle;
import android.util.Log;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.EditText;
import android.widget.Button;
public class Yamba extends Activity implements OnClickListener
{
private static final String TAG = "Yamba";
EditText editText;
Button updateButton;
Twitter twitter;
/** Called when the activity is first created. */
@Override
public void onCreate(Bundle savedInstanceState)
{
super.onCreate(savedInstanceState);
setContentView(R.layout.status);
//find views
editText =(EditText) findViewById(R.id.editText);
updateButton =(Button) findViewById(R.id.buttonUpdate);
updateButton.setOnClickListener(this);
twitter = new Twitter("student","password");
twitter.setAPIRootUrl("http://yamba.marakana.com/api");
}
public void onClick(View view){
twitter.setStatus(editText.getText().toString());
Log.d(TAG,"onClicked");
}
}
我的布局.xml为----
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
>
<TextView
android:id="@+id/text"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:gravity="center"
android:text="@string/titleStatus"
android:textSize="30sp"
/>
<EditText
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:layout_weight="1"
android:hint="@string/hintText"
android:id="@+id/editText"
android:gravity="top|center_horizontal">
</EditText>
<Button
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:text="@string/buttonUpdate"
android:textSize="20sp"
android:id="@+id/buttonUpdate">
</Button>
</LinearLayout>
我的日志如下---
--------- beginning of /dev/log/system
--------- beginning of /dev/log/main
E/ObjectHelper( 6376): Can't find method:setCompatibilityInfo
E/Trace ( 6342): error opening trace file: No such file or directory (2)
E/jdwp ( 6342): jdwp::setsockopt(SO_SNDTIMEO)
E/jdwp ( 6342): jdwp::setsockopt(SO_RCVTIMEO)
E/KeyguardUpdateMonitor( 508): Object tried to add another callback
E/KeyguardUpdateMonitor( 508): java.lang.Exception: Called by
E/KeyguardUpdateMonitor( 508): at com.android.internal.policy.impl.keyguard.KeyguardUpdateMonitor.registerCallback(KeyguardUpdateMonitor.java:1107)
E/KeyguardUpdateMonitor( 508): at com.android.internal.policy.impl.keyguard.KeyguardSelectorView.onResume(KeyguardSelectorView.java:331)
E/KeyguardUpdateMonitor( 508): at com.android.internal.policy.impl.keyguard.KeyguardHostView.onScreenTurnedOn(KeyguardHostView.java:1118)
E/KeyguardUpdateMonitor( 508): at com.android.internal.policy.impl.keyguard.KeyguardViewManager.onScreenTurnedOn(KeyguardViewManager.java:404)
E/KeyguardUpdateMonitor( 508): at com.android.internal.policy.impl.keyguard.KeyguardViewMediator.handleNotifyScreenOn(KeyguardViewMediator.java:1775)
E/KeyguardUpdateMonitor( 508): at com.android.internal.policy.impl.keyguard.KeyguardViewMediator.access$2300(KeyguardViewMediator.java:106)
E/KeyguardUpdateMonitor( 508): at com.android.internal.policy.impl.keyguard.KeyguardViewMediator$4.handleMessage(KeyguardViewMediator.java:1413)
E/KeyguardUpdateMonitor( 508): at android.os.Handler.dispatchMessage(Handler.java:107)
E/KeyguardUpdateMonitor( 508): at android.os.Looper.loop(Looper.java:194)
E/KeyguardUpdateMonitor( 508): at android.os.HandlerThread.run(HandlerThread.java:60)
E/AudioMTKHardware( 137): setParameters() still have param.size() = 1, remain param = "screen_state=on"
E/CellLocation( 784): create GsmCellLocation
E/CellLocation( 784): create GsmCellLocation
E/AndroidRuntime( 6411): FATAL EXCEPTION: main
E/AppErrorDialog( 508): Failed to get ILowStorageHandle instance
对现在该做什么一无所知。如能在这方面提供任何帮助,我们将不胜感激。
编辑--我在删除拼写错误后发布了我的新日志。
<uses-permission android:name="android.persmission.INTERNET"/>
命名错误的权限。。。应该是:
<uses-permission android:name="android.permission.INTERNET"/>
android中存在拼写错误任务。INTERNET