我一直在关注androidhive的这个教程,它给你源代码。我已经下载并安装了wamp服务器,看起来很好。当我运行代码时应用程序打开,但是当它发送数据时需要很长时间,然后最终迫使我关闭应用程序。我已经尝试了我能想到的一切,包括安装和解除一切,但我无法弄清楚出了什么问题。代码中没有错误。这是我不明白的原木猫。请帮助我的论文
02-20 16:54:58.901: E/JSON Parser(277): Error parsing data org.json.JSONException: Value <HTML><TITLE>404 of type java.lang.String cannot be converted to JSONObject
02-20 16:54:58.901: W/dalvikvm(277): threadid=7: thread exiting with uncaught exception (group=0x4001d800)
02-20 16:54:58.940: E/AndroidRuntime(277): FATAL EXCEPTION: AsyncTask #1
02-20 16:54:58.940: E/AndroidRuntime(277): java.lang.RuntimeException: An error occured while executing doInBackground()
02-20 16:54:58.940: E/AndroidRuntime(277): at android.os.AsyncTask$3.done(AsyncTask.java:200)
02-20 16:54:58.940: E/AndroidRuntime(277): at java.util.concurrent.FutureTask$Sync.innerSetException(FutureTask.java:273)
02-20 16:54:58.940: E/AndroidRuntime(277): at java.util.concurrent.FutureTask.setException(FutureTask.java:124)
02-20 16:54:58.940: E/AndroidRuntime(277): at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:307)
02-20 16:54:58.940: E/AndroidRuntime(277): at java.util.concurrent.FutureTask.run(FutureTask.java:137)
02-20 16:54:58.940: E/AndroidRuntime(277): at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1068)
02-20 16:54:58.940: E/AndroidRuntime(277): at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:561)
02-20 16:54:58.940: E/AndroidRuntime(277): at java.lang.Thread.run(Thread.java:1096)
02-20 16:54:58.940: E/AndroidRuntime(277): Caused by: java.lang.NullPointerException
02-20 16:54:58.940: E/AndroidRuntime(277): at com.example.androidhive.NewProductActivity$CreateNewProduct.doInBackground(NewProductActivity.java:99)
02-20 16:54:58.940: E/AndroidRuntime(277): at com.example.androidhive.NewProductActivity$CreateNewProduct.doInBackground(NewProductActivity.java:1)
02-20 16:54:58.940: E/AndroidRuntime(277): at android.os.AsyncTask$2.call(AsyncTask.java:185)
02-20 16:54:58.940: E/AndroidRuntime(277): at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:305)
02-20 16:54:58.940: E/AndroidRuntime(277): ... 4 more
02-20 16:55:00.051: E/WindowManager(277): Activity com.example.androidhive.NewProductActivity has leaked window com.android.internal.policy.impl.PhoneWindow$DecorView@44f04ae8 that was originally added here
02-20 16:55:00.051: E/WindowManager(277): android.view.WindowLeaked: Activity com.example.androidhive.NewProductActivity has leaked window com.android.internal.policy.impl.PhoneWindow$DecorView@44f04ae8 that was originally added here
02-20 16:55:00.051: E/WindowManager(277): at android.view.ViewRoot.<init>(ViewRoot.java:247)
02-20 16:55:00.051: E/WindowManager(277): at android.view.WindowManagerImpl.addView(WindowManagerImpl.java:148)
02-20 16:55:00.051: E/WindowManager(277): at android.view.WindowManagerImpl.addView(WindowManagerImpl.java:91)
02-20 16:55:00.051: E/WindowManager(277): at android.view.Window$LocalWindowManager.addView(Window.java:424)
02-20 16:55:00.051: E/WindowManager(277): at android.app.Dialog.show(Dialog.java:241)
02-20 16:55:00.051: E/WindowManager(277): at com.example.androidhive.NewProductActivity$CreateNewProduct.onPreExecute(NewProductActivity.java:76)
02-20 16:55:00.051: E/WindowManager(277): at android.os.AsyncTask.execute(AsyncTask.java:391)
02-20 16:55:00.051: E/WindowManager(277): at com.example.androidhive.NewProductActivity$1.onClick(NewProductActivity.java:56)
02-20 16:55:00.051: E/WindowManager(277): at android.view.View.performClick(View.java:2408)
02-20 16:55:00.051: E/WindowManager(277): at android.view.View$PerformClick.run(View.java:8816)
02-20 16:55:00.051: E/WindowManager(277): at android.os.Handler.handleCallback(Handler.java:587)
02-20 16:55:00.051: E/WindowManager(277): at android.os.Handler.dispatchMessage(Handler.java:92)
02-20 16:55:00.051: E/WindowManager(277): at android.os.Looper.loop(Looper.java:123)
02-20 16:55:00.051: E/WindowManager(277): at android.app.ActivityThread.main(ActivityThread.java:4627)
02-20 16:55:00.051: E/WindowManager(277): at java.lang.reflect.Method.invokeNative(Native Method)
02-20 16:55:00.051: E/WindowManager(277): at java.lang.reflect.Method.invoke(Method.java:521)
02-20 16:55:00.051: E/WindowManager(277): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:868)
02-20 16:55:00.051: E/WindowManager(277): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:626)
02-20 16:55:00.051: E/WindowManager(277): at dalvik.system.NativeStart.main(Native Method)