![]() ![]() ![]() ![]() |
|||||
|
|||||
樓主 GEX268 ![]()
![]() |
也先用了一般的JAVA開發環境連線,也成功了 ![]() 但是在android studio 上卻是一直都失敗,因此想請各位點出我的錯誤,是不是程式碼哪裡錯了,還是連線字串錯了? |
1樓
最有價值解答
Silent ![]() |
能把錯誤訊息貼出來嗎??
可能是 網路權限沒開
本篇文章回覆於2018-06-01 21:06
== 簽名檔 ==
--未登入的會員無法查看對方簽名檔-- |
2樓
作者回應
GEX268 ![]() |
這是錯誤訊息:
06-01 18:57:28.505 17833-17833/? I/art: Not late-enabling -Xcheck:jni (already on) 06-01 18:57:28.506 17833-17833/? W/art: Unexpected CPU variant for X86 using defaults: x86 06-01 18:57:28.534 17833-17840/? E/art: Failed sending reply to debugger: Broken pipe 06-01 18:57:28.534 17833-17840/? I/art: Debugger is no longer active Starting a blocking GC Instrumentation 06-01 18:57:28.851 17833-17833/? W/System: ClassLoader referenced unknown path: /data/app/com.example.wutx2.logintestv3forjdbc131-1/lib/x86 06-01 18:57:28.861 17833-17833/? I/InstantRun: starting instant run server: is main process 06-01 18:57:28.963 17833-17833/? W/art: Before Android 4.1, method android.graphics.PorterDuffColorFilter android.support.graphics.drawable.VectorDrawableCompat.updateTintFilter(android.graphics.PorterDuffColorFilter, android.content.res.ColorStateList, android.graphics.PorterDuff$Mode) would have incorrectly overridden the package-private method in android.graphics.drawable.Drawable 06-01 18:57:29.168 17833-17849/? I/OpenGLRenderer: Initialized EGL, version 1.4 06-01 18:57:29.168 17833-17849/? D/OpenGLRenderer: Swap behavior 1 06-01 18:57:29.168 17833-17849/? W/OpenGLRenderer: Failed to choose config with EGL_SWAP_BEHAVIOR_PRESERVED, retrying without... 06-01 18:57:29.168 17833-17849/? D/OpenGLRenderer: Swap behavior 0 06-01 18:57:29.217 17833-17849/? D/EGL_emulation: eglCreateContext: 0xa090d660: maj 2 min 0 rcv 2 06-01 18:57:29.251 17833-17849/? D/EGL_emulation: eglMakeCurrent: 0xa090d660: ver 2 0 (tinfo 0xa08d76d0) 06-01 18:57:29.331 17833-17833/? W/art: Before Android 4.1, method int android.support.v7.widget.DropDownListView.lookForSelectablePosition(int, boolean) would have incorrectly overridden the package-private method in android.widget.ListView 06-01 18:57:29.343 17833-17849/? D/EGL_emulation: eglMakeCurrent: 0xa090d660: ver 2 0 (tinfo 0xa08d76d0) 這是Manifest檔: <?xml version="1.0" encoding="utf-8"?> <manifest xmlns:android="http://schemas.android.com/apk/res/android" package="com.example.wutx2.logintestv3forjdbc131"> <uses-permission android:name="android.permission.INTERNET"></uses-permission> <application android:allowBackup="true" android:icon="@mipmap/ic_launcher" android:label="@string/app_name" android:roundIcon="@mipmap/ic_launcher_round" android:supportsRtl="true" android:theme="@style/AppTheme"> <activity android:name=".MainActivity"> <intent-filter> <action android:name="android.intent.action.MAIN" /> <category android:name="android.intent.category.LAUNCHER" /> </intent-filter> </activity> </application> </manifest>
本篇文章回覆於2018-06-02 03:28
== 簽名檔 ==
--未登入的會員無法查看對方簽名檔-- |
3樓 |
這很像不是錯誤訊息...
不過應該是執行續安全的問題 你要建立新的執行續 去做連線 不然在onCreate修改執行續的策略 不建議這麼做
本篇文章回覆於2018-06-02 10:29
== 簽名檔 ==
--未登入的會員無法查看對方簽名檔-- |
4樓
作者回應
GEX268 ![]() |
意思是說我貼錯錯誤訊息了嗎?還是說這個不是錯誤?
新建一個執行緒,意思是說我要寫一個新的Handler這樣嗎? 感謝大大的指點~~
本篇文章回覆於2018-06-02 18:33
== 簽名檔 ==
--未登入的會員無法查看對方簽名檔-- |
5樓 |
不用handler
直接new Thread or 用asynctask
本篇文章回覆於2018-06-03 09:41
== 簽名檔 ==
--未登入的會員無法查看對方簽名檔-- |
回覆 |
如要回應,請先登入. |