0

socialauth-android-2.1.jar をダウンロードして置き換えました。友達ボタンをクリックすると、Twitter の友達リストを取得できません。エラーがスローされます。

I got below error.
04-16 10:17:05.695: I/TwitterImpl(14690): Fetching contacts from http://api.twitter.com/1/friends/ids.json?screen_name=sgm_friends&cursor=-1
04-16 10:17:05.700: D/SocialAuthAdapter(14690): Contact list not Received
04-16 10:17:05.700: W/System.err(14690): org.brickred.socialauth.exception.SocialAuthException: Failed to retrieve the contacts from http://api.twitter.com/1/friends/ids.json?screen_name=sgm_friends&cursor=-1
04-16 10:17:05.700: W/System.err(14690):    at org.brickred.socialauth.provider.TwitterImpl.getContactList(TwitterImpl.java:287)
04-16 10:17:05.705: W/System.err(14690):    at org.brickred.socialauth.android.SocialAuthAdapter.getContactList(SocialAuthAdapter.java:688)
04-16 10:17:05.705: W/System.err(14690):    at org.brickred.customui.CustomUI.Events(CustomUI.java:199)
04-16 10:17:05.705: W/System.err(14690):    at org.brickred.customui.CustomUI$ResponseListener$1.onClick(CustomUI.java:137)
04-16 10:17:05.705: W/System.err(14690):    at com.android.internal.app.AlertController$AlertParams$3.onItemClick(AlertController.java:934)
04-16 10:17:05.705: W/System.err(14690):    at android.widget.AdapterView.performItemClick(AdapterView.java:298)
04-16 10:17:05.705: W/System.err(14690):    at android.widget.AbsListView.performItemClick(AbsListView.java:1283)
04-16 10:17:05.705: W/System.err(14690):    at android.widget.AbsListView$PerformClick.run(AbsListView.java:3074)
04-16 10:17:05.705: W/System.err(14690):    at android.widget.AbsListView$1.run(AbsListView.java:4147)
04-16 10:17:05.705: W/System.err(14690):    at android.os.Handler.handleCallback(Handler.java:615)
04-16 10:17:05.705: W/System.err(14690):    at android.os.Handler.dispatchMessage(Handler.java:92)
04-16 10:17:05.705: W/System.err(14690):    at android.os.Looper.loop(Looper.java:137)
04-16 10:17:05.705: W/System.err(14690):    at android.app.ActivityThread.main(ActivityThread.java:4898)
04-16 10:17:05.705: W/System.err(14690):    at java.lang.reflect.Method.invokeNative(Native Method)
04-16 10:17:05.710: W/System.err(14690):    at java.lang.reflect.Method.invoke(Method.java:511)
04-16 10:17:05.710: W/System.err(14690):    at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1008)
04-16 10:17:05.710: W/System.err(14690):    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:775)
04-16 10:17:05.710: W/System.err(14690):    at dalvik.system.NativeStart.main(Native Method)
04-16 10:17:05.710: W/System.err(14690): Caused by: org.brickred.socialauth.exception.SocialAuthException: android.os.NetworkOnMainThreadException
04-16 10:17:05.710: W/System.err(14690):    at org.brickred.socialauth.util.HttpUtil.doHttpRequest(HttpUtil.java:154)
04-16 10:17:05.710: W/System.err(14690):    at org.brickred.socialauth.util.OAuthConsumer.send(OAuthConsumer.java:406)
04-16 10:17:05.710: W/System.err(14690):    at org.brickred.socialauth.util.OAuthConsumer.httpGet(OAuthConsumer.java:280)
04-16 10:17:05.710: W/System.err(14690):    at org.brickred.socialauth.oauthstrategy.OAuth1.executeFeed(OAuth1.java:121)
04-16 10:17:05.710: W/System.err(14690):    at org.brickred.socialauth.provider.TwitterImpl.getContactList(TwitterImpl.java:285)
04-16 10:17:05.710: W/System.err(14690):    ... 17 more
04-16 10:17:05.710: W/System.err(14690): Caused by: android.os.NetworkOnMainThreadException
04-16 10:17:05.715: W/System.err(14690):    at android.os.StrictMode$AndroidBlockGuardPolicy.onNetwork(StrictMode.java:1118)
04-16 10:17:05.715: W/System.err(14690):    at java.net.InetAddress.lookupHostByName(InetAddress.java:385)
04-16 10:17:05.715: W/System.err(14690):    at java.net.InetAddress.getAllByNameImpl(InetAddress.java:236)
04-16 10:17:05.715: W/System.err(14690):    at java.net.InetAddress.getAllByName(InetAddress.java:214)
04-16 10:17:05.715: W/System.err(14690):    at libcore.net.http.HttpConnection.<init>(HttpConnection.java:70)
04-16 10:17:05.715: W/System.err(14690):    at libcore.net.http.HttpConnection.<init>(HttpConnection.java:50)
04-16 10:17:05.715: W/System.err(14690):    at libcore.net.http.HttpConnection$Address.connect(HttpConnection.java:340)
04-16 10:17:05.715: W/System.err(14690):    at libcore.net.http.HttpConnectionPool.get(HttpConnectionPool.java:87)
04-16 10:17:05.715: W/System.err(14690):    at libcore.net.http.HttpConnection.connect(HttpConnection.java:128)
04-16 10:17:05.715: W/System.err(14690):    at libcore.net.http.HttpEngine.openSocketConnection(HttpEngine.java:315)
04-16 10:17:05.715: W/System.err(14690):    at libcore.net.http.HttpEngine.connect(HttpEngine.java:310)
04-16 10:17:05.715: W/System.err(14690):    at libcore.net.http.HttpEngine.sendSocketRequest(HttpEngine.java:289)
04-16 10:17:05.720: W/System.err(14690):    at libcore.net.http.HttpEngine.sendRequest(HttpEngine.java:239)
04-16 10:17:05.720: W/System.err(14690):    at libcore.net.http.HttpURLConnectionImpl.connect(HttpURLConnectionImpl.java:80)
04-16 10:17:05.720: W/System.err(14690):    at org.brickred.socialauth.util.HttpUtil.doHttpRequest(HttpUtil.java:152)
04-16 10:17:05.720: W/System.err(14690):    ... 21 more

私は5日前にここに投稿しました。しかし無反応。 https://code.google.com/p/socialauth-android/issues/detail?can=2&q=53&colspec=ID%20Type%20Status%20Priority%20Milestone%20Owner%20Summary&id=53

4

3 に答える 3

0

これは、あなたが好きな人ScreeNameから必要なものを見るのに役立つかもしれませんProvide

HttpParameters params1 = mProvider.getResponseParameters();
String ScreeName = params1.getFirst("screen_name");

次に、このScreenNameをに渡す必要があります

https://api.twitter.com/1/friends/ids.json?cursor=-1&screen_name="+ScreeName

ここでこの API を呼び出す必要AsyncTaskResponseありますJsonArray

Ids 

あなたの友達ID

于 2013-04-20T04:34:19.503 に答える
0

を使用して、フォロワーとフォロー中のリストを取得することもできますjtwitter.jar

    List<User> followers= twitter.getFollowers();
            for(int i=0;i<followers.size();i++)
            {
                User follower=followers.get(i);
                String name=follower.getName();
                Log.i("follower", name);
            }
            List<User> following = twitter.getFriends();
            for(int i=0;i<following.size();i++)
            {
                User user=following.get(i);
                String name=user.getName();
                Log.i("following", name);
            }
于 2013-04-20T05:05:40.040 に答える