Permalink
Browse files

use Twitter4J source directly instead of java archive.

  • Loading branch information...
mariotaku committed Sep 27, 2012
1 parent 6f4e154 commit a6cc22fe0fa570d7d40e074e2225dbe953465ec1
Showing with 23,252 additions and 51 deletions.
  1. +22 −14 README.markdown
  2. BIN libs/twitter4j-android-2.2.6.jar
  3. +17 −35 src/org/mariotaku/twidere/loader/TweetSearchLoader.java
  4. +2 −2 src/org/mariotaku/twidere/loader/Twitter4JStatusLoader.java
  5. +88 −0 src/twitter4j/AccountSettings.java
  6. +53 −0 src/twitter4j/AccountTotals.java
  7. +62 −0 src/twitter4j/Activity.java
  8. +309 −0 src/twitter4j/Annotation.java
  9. +215 −0 src/twitter4j/Annotations.java
  10. +31 −0 src/twitter4j/Category.java
  11. +47 −0 src/twitter4j/CursorSupport.java
  12. +50 −0 src/twitter4j/DirectMessage.java
  13. +60 −0 src/twitter4j/EntitySupport.java
  14. +106 −0 src/twitter4j/ExceptionDiagnosis.java
  15. +221 −0 src/twitter4j/FilterQuery.java
  16. +33 −0 src/twitter4j/Friendship.java
  17. +97 −0 src/twitter4j/GeoLocation.java
  18. +195 −0 src/twitter4j/GeoQuery.java
  19. +48 −0 src/twitter4j/HashtagEntity.java
  20. +9 −0 src/twitter4j/HostAddressResolver.java
  21. +38 −0 src/twitter4j/IDs.java
  22. +36 −0 src/twitter4j/Location.java
  23. +77 −0 src/twitter4j/MediaEntity.java
  24. +37 −0 src/twitter4j/PagableResponseList.java
  25. +240 −0 src/twitter4j/Paging.java
  26. +33 −0 src/twitter4j/Place.java
  27. +85 −0 src/twitter4j/ProfileImage.java
  28. +524 −0 src/twitter4j/Query.java
  29. +44 −0 src/twitter4j/QueryResult.java
  30. +77 −0 src/twitter4j/RateLimitStatus.java
  31. +53 −0 src/twitter4j/RateLimitStatusEvent.java
  32. +38 −0 src/twitter4j/RateLimitStatusListener.java
  33. +48 −0 src/twitter4j/RelatedResults.java
  34. +102 −0 src/twitter4j/Relationship.java
  35. +48 −0 src/twitter4j/ResponseList.java
  36. +39 −0 src/twitter4j/SavedSearch.java
  37. +35 −0 src/twitter4j/SimilarPlaces.java
  38. +107 −0 src/twitter4j/Status.java
  39. +286 −0 src/twitter4j/StatusUpdate.java
  40. +30 −0 src/twitter4j/TimeZone.java
  41. +34 −0 src/twitter4j/Trend.java
  42. +48 −0 src/twitter4j/Trends.java
  43. +52 −0 src/twitter4j/Twitter.java
  44. +39 −0 src/twitter4j/TwitterAPIConfiguration.java
  45. +67 −0 src/twitter4j/TwitterAPIMonitor.java
  46. +91 −0 src/twitter4j/TwitterBase.java
  47. +434 −0 src/twitter4j/TwitterBaseImpl.java
  48. +33 −0 src/twitter4j/TwitterConstants.java
  49. +378 −0 src/twitter4j/TwitterException.java
  50. +108 −0 src/twitter4j/TwitterFactory.java
  51. +2,020 −0 src/twitter4j/TwitterImpl.java
  52. +56 −0 src/twitter4j/TwitterResponse.java
  53. +95 −0 src/twitter4j/Twt.java
  54. +68 −0 src/twitter4j/URLEntity.java
  55. +195 −0 src/twitter4j/User.java
  56. +104 −0 src/twitter4j/UserList.java
  57. +62 −0 src/twitter4j/UserMentionEntity.java
  58. +42 −0 src/twitter4j/Version.java
  59. +262 −0 src/twitter4j/api/AccountMethods.java
  60. +16 −0 src/twitter4j/api/ActivityMethods.java
  61. +156 −0 src/twitter4j/api/BlockMethods.java
  62. +144 −0 src/twitter4j/api/DirectMessageMethods.java
  63. +143 −0 src/twitter4j/api/FavoriteMethods.java
  64. +160 −0 src/twitter4j/api/FriendsFollowersMethods.java
  65. +314 −0 src/twitter4j/api/FriendshipMethods.java
  66. +148 −0 src/twitter4j/api/GeoMethods.java
  67. +77 −0 src/twitter4j/api/HelpMethods.java
  68. +51 −0 src/twitter4j/api/LegalResources.java
  69. +133 −0 src/twitter4j/api/ListMembersMethods.java
  70. +289 −0 src/twitter4j/api/ListMethods.java
  71. +93 −0 src/twitter4j/api/ListSubscribersMethods.java
  72. +90 −0 src/twitter4j/api/LocalTrendsMethods.java
  73. +45 −0 src/twitter4j/api/NewTwitterMethods.java
  74. +88 −0 src/twitter4j/api/NotificationMethods.java
  75. +84 −0 src/twitter4j/api/SavedSearchesMethods.java
  76. +41 −0 src/twitter4j/api/SearchMethods.java
  77. +55 −0 src/twitter4j/api/SpamReportingMethods.java
  78. +193 −0 src/twitter4j/api/StatusMethods.java
  79. +423 −0 src/twitter4j/api/TimelineMethods.java
  80. +84 −0 src/twitter4j/api/TrendsMethods.java
  81. +183 −0 src/twitter4j/api/UserMethods.java
  82. +104 −0 src/twitter4j/auth/AccessToken.java
  83. +36 −0 src/twitter4j/auth/Authorization.java
  84. +38 −0 src/twitter4j/auth/AuthorizationConfiguration.java
  85. +59 −0 src/twitter4j/auth/AuthorizationFactory.java
  86. +88 −0 src/twitter4j/auth/BasicAuthorization.java
  87. +63 −0 src/twitter4j/auth/NullAuthorization.java
  88. +561 −0 src/twitter4j/auth/OAuthAuthorization.java
  89. +191 −0 src/twitter4j/auth/OAuthSupport.java
  90. +100 −0 src/twitter4j/auth/OAuthToken.java
  91. +79 −0 src/twitter4j/auth/RequestToken.java
  92. +54 −0 src/twitter4j/auth/TwipOModeAuthorization.java
  93. +50 −0 src/twitter4j/conf/BaseConfigurationFactory.java
  94. +73 −0 src/twitter4j/conf/Configuration.java
  95. +825 −0 src/twitter4j/conf/ConfigurationBase.java
  96. +246 −0 src/twitter4j/conf/ConfigurationBuilder.java
  97. +32 −0 src/twitter4j/conf/ConfigurationContext.java
  98. +34 −0 src/twitter4j/conf/ConfigurationFactory.java
  99. +81 −0 src/twitter4j/internal/http/BASE64Encoder.java
  100. +783 −0 src/twitter4j/internal/http/HTMLEntity.java
  101. +31 −0 src/twitter4j/internal/http/HttpClient.java
  102. +50 −0 src/twitter4j/internal/http/HttpClientBase.java
  103. +53 −0 src/twitter4j/internal/http/HttpClientConfiguration.java
  104. +28 −0 src/twitter4j/internal/http/HttpClientFactory.java
  105. +339 −0 src/twitter4j/internal/http/HttpClientImpl.java
  106. +220 −0 src/twitter4j/internal/http/HttpClientWrapper.java
  107. +26 −0 src/twitter4j/internal/http/HttpClientWrapperConfiguration.java
  108. +272 −0 src/twitter4j/internal/http/HttpParameter.java
  109. +129 −0 src/twitter4j/internal/http/HttpRequest.java
  110. +215 −0 src/twitter4j/internal/http/HttpResponse.java
  111. +62 −0 src/twitter4j/internal/http/HttpResponseCode.java
  112. +93 −0 src/twitter4j/internal/http/HttpResponseEvent.java
  113. +68 −0 src/twitter4j/internal/http/HttpResponseImpl.java
  114. +10 −0 src/twitter4j/internal/http/HttpResponseListener.java
  115. +74 −0 src/twitter4j/internal/http/RequestMethod.java
  116. +48 −0 src/twitter4j/internal/http/StreamingGZIPInputStream.java
  117. +66 −0 src/twitter4j/internal/http/XAuthAuthorization.java
  118. +130 −0 src/twitter4j/internal/json/AccountSettingsJSONImpl.java
  119. +108 −0 src/twitter4j/internal/json/AccountTotalsJSONImpl.java
  120. +198 −0 src/twitter4j/internal/json/ActivityJSONImpl.java
  121. +119 −0 src/twitter4j/internal/json/CategoryJSONImpl.java
  122. +196 −0 src/twitter4j/internal/json/DirectMessageJSONImpl.java
  123. +139 −0 src/twitter4j/internal/json/FriendshipJSONImpl.java
  124. +123 −0 src/twitter4j/internal/json/HashtagEntityJSONImpl.java
  125. +150 −0 src/twitter4j/internal/json/IDsJSONImpl.java
  126. +91 −0 src/twitter4j/internal/json/LanguageJSONImpl.java
  127. +169 −0 src/twitter4j/internal/json/LocationJSONImpl.java
  128. +273 −0 src/twitter4j/internal/json/MediaEntityJSONImpl.java
  129. +81 −0 src/twitter4j/internal/json/PagableResponseListImpl.java
  130. +260 −0 src/twitter4j/internal/json/PlaceJSONImpl.java
  131. +43 −0 src/twitter4j/internal/json/ProfileImageImpl.java
  132. +206 −0 src/twitter4j/internal/json/QueryResultJSONImpl.java
  133. +200 −0 src/twitter4j/internal/json/RateLimitStatusJSONImpl.java
  134. +157 −0 src/twitter4j/internal/json/RelatedResultsJSONImpl.java
  135. +220 −0 src/twitter4j/internal/json/RelationshipJSONImpl.java
  136. +84 −0 src/twitter4j/internal/json/ResponseListImpl.java
  137. +161 −0 src/twitter4j/internal/json/SavedSearchJSONImpl.java
  138. +65 −0 src/twitter4j/internal/json/SimilarPlacesImpl.java
  139. +467 −0 src/twitter4j/internal/json/StatusJSONImpl.java
  140. +65 −0 src/twitter4j/internal/json/TimeZoneJSONImpl.java
  141. +96 −0 src/twitter4j/internal/json/TrendJSONImpl.java
  142. +217 −0 src/twitter4j/internal/json/TrendsJSONImpl.java
  143. +180 −0 src/twitter4j/internal/json/TwitterAPIConfigurationJSONImpl.java
  144. +68 −0 src/twitter4j/internal/json/TwitterResponseImpl.java
  145. +178 −0 src/twitter4j/internal/json/URLEntityJSONImpl.java
  146. +515 −0 src/twitter4j/internal/json/UserJSONImpl.java
  147. +252 −0 src/twitter4j/internal/json/UserListJSONImpl.java
  148. +154 −0 src/twitter4j/internal/json/UserMentionEntityJSONImpl.java
  149. +129 −0 src/twitter4j/internal/json/z_T4JInternalFactory.java
  150. +379 −0 src/twitter4j/internal/json/z_T4JInternalJSONImplFactory.java
  151. +142 −0 src/twitter4j/internal/logging/AndroidLogger.java
  152. +32 −0 src/twitter4j/internal/logging/AndroidLoggerFactory.java
  153. +108 −0 src/twitter4j/internal/logging/Logger.java
  154. +31 −0 src/twitter4j/internal/logging/LoggerFactory.java
  155. +111 −0 src/twitter4j/internal/logging/NullLogger.java
  156. +33 −0 src/twitter4j/internal/logging/NullLoggerFactory.java
  157. +205 −0 src/twitter4j/internal/util/z_T4JInternalParseUtil.java
  158. +101 −0 src/twitter4j/internal/util/z_T4JInternalStringUtil.java
  159. +120 −0 src/twitter4j/management/APIStatistics.java
  160. +34 −0 src/twitter4j/management/APIStatisticsMBean.java
  161. +33 −0 src/twitter4j/management/InvocationStatistics.java
  162. +106 −0 src/twitter4j/management/InvocationStatisticsCalculator.java
  163. +47 −0 src/twitter4j/util/CharacterUtil.java
  164. +155 −0 src/twitter4j/util/TimeSpanConverter.java
View
@@ -4,16 +4,24 @@ Twidere is a powerful twitter client for Android 1.6+, which gives you a full Ho
###Features###
-* Custom API Proxy (gtap, twip tested)
-* Built in image viewer
+* Pure & Clean Holo design works for pre-ICS devices
+* Two themes (dark and light theme)
+* Dual pane layout for Tablets
+* Inline image preview
+* Built in image viewer and map viewer
+* Custom tabs
+* Direct messages with conversation style
* Filters (block unwanted tweets)
-* Draft feature (not finished now)
+* Drafts feature
+* Extension support like [Twicca](http://twicca.r246.jp/), but more friendly for users and developers
* t.co link auto expanding
-* GZip compressing for API requests
-* Adjustable text size
-* View conversation
-* Two themes (dark and light theme).
* Multiple account support
+* Custom OAuth consumer key/secret
+* Basic features supported for StatusNet/Fanfou
+* Direct login with user name and password (Don't worry! It's safe!)
+* Custom API Proxy (gtap, twip, jtapi supported)
+* GZip compressing for API requests
+* TCP DNS query and custom host mapping to fight against censorship
* Free and open source, without any ads!
<a href="https://play.google.com/store/apps/details?id=org.mariotaku.twidere"><img src="http://www.android.com/images/brand/get_it_on_play_logo_large.png"/></a>
@@ -26,9 +34,9 @@ Twidere is a powerful twitter client for Android 1.6+, which gives you a full Ho
[@Rieya](https://twitter.com/#!/Rieya) (0.0.6 version)
-Thanks to her excellent design!
+Thanks to their excellent design!
-###Translate twidere into your language###
+###Translate twidere to your language###
I started a crowdin project, so anyone can do something for Twidere. Visit this [crowdin project page](http://crowdin.net/project/twidere)
@@ -43,10 +51,10 @@ This netbook (HASEE Q130B, 1.6GHz Intel Atom N270, $300 in 2009) is nearly broke
So, buy me a RAM stick, a bread or anything you want :)
<a href="https://www.paypal.com/cgi-bin/webscr?cmd=_donations&amp;business=mariotaku.lee%40gmail%2ecom&amp;item_name=Donate%20to%20Twidere&amp;currency_code=USD"><img src="https://www.paypalobjects.com/en_US/i/btn/btn_donateCC_LG_global.gif"/></a>
-
-**Donate Via Alipay(支付宝)**
-
-Email address:
-
+
+**Donate Via Alipay(支付宝)**
+
+Email address:
+
"mariotaku.lee#gmail.com".replace("#", "@");
Binary file not shown.
@@ -25,6 +25,7 @@
import java.io.IOException;
import java.io.ObjectInputStream;
import java.io.ObjectOutputStream;
+import java.util.Arrays;
import java.util.Collections;
import java.util.ConcurrentModificationException;
import java.util.List;
@@ -34,6 +35,7 @@
import org.mariotaku.twidere.util.NoDuplicatesArrayList;
import org.mariotaku.twidere.util.NoDuplicatesStateSavedList;
+import twitter4j.Paging;
import twitter4j.Query;
import twitter4j.Status;
import twitter4j.Twitter;
@@ -42,16 +44,26 @@
import android.content.SharedPreferences;
import android.os.Bundle;
-public class TweetSearchLoader extends ParcelableStatusesLoader {
+public class TweetSearchLoader extends Twitter4JStatusLoader {
+
+ public List<Status> getStatuses(Paging paging) throws TwitterException {
+ final Twitter twitter = getTwitter();
+ if (twitter == null) return null;
+ final Query query = new Query(mQuery);
+ query.setRpp(paging.getCount());
+ if (paging.getMaxId() > 0) {
+ query.setMaxId(paging.getMaxId());
+ }
+ return Arrays.asList(twitter.search(query).getStatuses());
+ }
+
private final String mQuery;
- private final long mMaxId;
public TweetSearchLoader(final Context context, final long account_id, final String query, final long max_id,
final List<ParcelableStatus> data, final String class_name, final boolean is_home_tab) {
- super(context, account_id, data, class_name, is_home_tab);
+ super(context, account_id, max_id, data, class_name, is_home_tab);
mQuery = query;
- mMaxId = max_id;
}
@Override
@@ -84,37 +96,7 @@ public TweetSearchLoader(final Context context, final long account_id, final Str
} catch (final ClassCastException e) {
}
}
- final List<ParcelableStatus> data = getData();
- final long account_id = getAccountId();
- final Twitter twitter = getTwitter();
- if (twitter == null) return null;
- Status[] statuses = null;
- try {
- final Query query = new Query(mQuery);
- final SharedPreferences prefs = getContext().getSharedPreferences(SHARED_PREFERENCES_NAME,
- Context.MODE_PRIVATE);
- final int load_item_limit = prefs
- .getInt(PREFERENCE_KEY_LOAD_ITEM_LIMIT, PREFERENCE_DEFAULT_LOAD_ITEM_LIMIT);
- query.setRpp(load_item_limit);
- if (mMaxId > 0) {
- query.setMaxId(mMaxId);
- }
- statuses = twitter.search(query).getStatuses();
- } catch (final TwitterException e) {
- e.printStackTrace();
- }
- if (statuses != null) {
- for (final Status status : statuses) {
- data.add(new ParcelableStatus(status, account_id, false));
- }
- }
- try {
- Collections.sort(data);
- } catch (final ConcurrentModificationException e) {
- // This shouldn't happen.
- e.printStackTrace();
- }
- return data;
+ return super.loadInBackground();
}
public static void writeSerializableStatuses(final Object instance, final Context context,
@@ -41,13 +41,13 @@ public Twitter4JStatusLoader(final Context context, final long account_id, final
mMaxId = max_id;
}
- public abstract ResponseList<Status> getStatuses(Paging paging) throws TwitterException;
+ public abstract List<Status> getStatuses(Paging paging) throws TwitterException;
@Override
public synchronized List<ParcelableStatus> loadInBackground() {
final List<ParcelableStatus> data = getData();
final long account_id = getAccountId();
- ResponseList<Status> statuses = null;
+ List<Status> statuses = null;
try {
final Paging paging = new Paging();
final SharedPreferences prefs = getContext().getSharedPreferences(SHARED_PREFERENCES_NAME,
@@ -0,0 +1,88 @@
+/*
+ * Copyright 2007 Yusuke Yamamoto
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package twitter4j;
+
+import java.io.Serializable;
+
+/**
+ * @author Yusuke Yamamoto - yusuke at mac.com
+ * @since Twitter4J 2.1.9
+ */
+public interface AccountSettings extends TwitterResponse, Serializable {
+ /**
+ * Returns the language used to render Twitter's UII for this user.
+ *
+ * @return the language ISO 639-1 representation
+ */
+ String getLanguage();
+
+ /**
+ * Returns sleep end time.
+ *
+ * @return sleep end time
+ */
+ String getSleepEndTime();
+
+ /**
+ * Returns sleep start time.
+ *
+ * @return sleep start time
+ */
+ String getSleepStartTime();
+
+ /**
+ * Returns the timezone configured for this user.
+ *
+ * @return the timezone (formated as a Rails TimeZone name)
+ */
+ TimeZone getTimeZone();
+
+ /**
+ * Return the user's trend locations
+ *
+ * @return the user's trend locations
+ */
+ Location[] getTrendLocations();
+
+ /**
+ * Returns true if the wants to always access twitter using HTTPS.
+ *
+ * @return true if the wants to always access twitter using HTTPS
+ */
+ boolean isAlwaysUseHttps();
+
+ /**
+ * Returns true if the user is discoverable by email.
+ *
+ * @return true if the user is discoverable by email
+ */
+ boolean isDiscoverableByEmail();
+
+ /**
+ * Return true if the user is enabling geo location
+ *
+ * @return true if the user is enabling geo location
+ */
+ boolean isGeoEnabled();
+
+ /**
+ * Returns true if the user enabled sleep time.
+ *
+ * @return true if the user enabled sleep time
+ */
+ boolean isSleepTimeEnabled();
+}
@@ -0,0 +1,53 @@
+/*
+ * Copyright 2007 Yusuke Yamamoto
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package twitter4j;
+
+import java.io.Serializable;
+
+/**
+ * @author Yusuke Yamamoto - yusuke at mac.com
+ * @since Twitter4J 2.1.9
+ */
+public interface AccountTotals extends TwitterResponse, Serializable {
+ /**
+ * Returns the number of total favorites.
+ *
+ * @return the number of total favorites
+ */
+ int getFavorites();
+
+ /**
+ * Returns the number of total followers.
+ *
+ * @return the number of total followers
+ */
+ int getFollowers();
+
+ /**
+ * Returns the number of total friends.
+ *
+ * @return the number of total friends
+ */
+ int getFriends();
+
+ /**
+ * Returns the number of total updates.
+ *
+ * @return the number of total updates
+ */
+ int getUpdates();
+}
@@ -0,0 +1,62 @@
+package twitter4j;
+
+import java.io.Serializable;
+import java.util.Date;
+
+public interface Activity extends TwitterResponse, Comparable<Activity>, Serializable {
+
+ public Action getAction();
+
+ public Date getCreatedAt();
+
+ public long getMaxPosition();
+
+ public long getMinPosition();
+
+ public User[] getSources();
+
+ public int getSourcesSize();
+
+ public Status[] getTargetObjectStatuses();
+
+ public UserList[] getTargetObjectUserLists();
+
+ public int getTargetObjectsSize();
+
+ public int getTargetsSize();
+
+ public Status[] getTargetStatuses();
+
+ public User[] getTargetUsers();
+
+ public static enum Action implements Serializable {
+ FAVORITE(0x1), FOLLOW(0x2), MENTION(0x3), REPLY(0x4), RETWEET(0x5), LIST_MEMBER_ADDED(0x06);
+
+ public final static int ACTION_FAVORITE = 0x01;
+ public final static int ACTION_FOLLOW = 0x02;
+ public final static int ACTION_MENTION = 0x03;
+ public final static int ACTION_REPLY = 0x04;
+ public final static int ACTION_RETWEET = 0x05;
+ public final static int ACTION_LIST_MEMBER_ADDED = 0x06;
+
+ private final int actionId;
+
+ private Action(final int action) {
+ actionId = action;
+ }
+
+ public int getActionId() {
+ return actionId;
+ }
+
+ public static Action fromString(final String string) {
+ if ("favorite".equalsIgnoreCase(string)) return FAVORITE;
+ if ("follow".equalsIgnoreCase(string)) return FOLLOW;
+ if ("mention".equalsIgnoreCase(string)) return MENTION;
+ if ("reply".equalsIgnoreCase(string)) return REPLY;
+ if ("retweet".equalsIgnoreCase(string)) return RETWEET;
+ if ("list_member_added".equalsIgnoreCase(string)) return LIST_MEMBER_ADDED;
+ throw new IllegalArgumentException("Unknown action " + string);
+ }
+ }
+}
Oops, something went wrong.

0 comments on commit a6cc22f

Please sign in to comment.