signature:
public class FacebookFacadeV3 { /** * Protected so we can mock */
protected void handleFBResponse ( final Activity context , Response response , final SocialNetworkPostListener listener ) { } }

implementation: FacebookRequestError error = response . getError ( ) ; if ( error != null ) { if ( listener != null ) { listener . onNetworkError ( context , SocialNetwork . FACEBOOK , error . getException ( ) ) ; } if ( logger != null ) { logger . error ( error . getErrorMessage ( ) , error . getException ( ) ) ; } else { Log . e ( "Socialize" , error . getErrorMessage ( ) , error . getException ( ) ) ; } switch ( error . getCategory ( ) ) { case AUTHENTICATION_REOPEN_SESSION : unlink ( context , null ) ; break ; case AUTHENTICATION_RETRY : unlink ( context , null ) ; break ; case PERMISSION : unlink ( context , null ) ; break ; } } else if ( listener != null ) { listener . onAfterPost ( context , SocialNetwork . FACEBOOK , response . getGraphObject ( ) . getInnerJSONObject ( ) ) ; }


signature:
public class FacebookFacadeV3 { /** * Protected so we can mock */
protected void handleNotSignedIn ( final Activity context , SocializeListener listener ) { } }

implementation: String msg = "Not signed into Facebook" ; if ( listener != null ) { listener . onError ( new SocializeException ( msg ) ) ; } else { handleNonListenerError ( msg , new SocializeException ( msg ) ) ; }


signature:
public class FacebookFacadeV3 { /** * Protected so we can mock */
protected void handleNotSignedIn ( final Activity context , SocialNetworkPostListener listener ) { } }

implementation: String msg = "Not signed into Facebook" ; if ( listener != null ) { listener . onNetworkError ( context , SocialNetwork . FACEBOOK , new SocializeException ( msg ) ) ; } else { handleNonListenerError ( msg , new SocializeException ( msg ) ) ; }


signature:
public class FacebookFacadeV3 { /** * Protected so we can mock */
protected void handleNonListenerError ( String msg , Exception error ) { } }

implementation: if ( logger != null ) { logger . error ( msg , error ) ; } else { Log . e ( "Socialize" , msg , error ) ; }


signature:
public class ActionUtils { /** * Gets the application - wide actions .
 * @ param context The current context .
 * @ param start The start index for pagination ( 0 based ) .
 * @ param end The end index for pagination ( 0 based ) .
 * @ param listener A listener to handle the result . */
public static void getActionsByApplication ( Activity context , int start , int end , ActionListListener listener ) { } }

implementation: proxy . getActionsByApplication ( context , start , end , listener ) ;


signature:
public class ActionUtils { /** * Gets the actions of a single user .
 * @ param context The current context .
 * @ param userId The user for whom the actions will be returned .
 * @ param start The start index for pagination ( 0 based ) .
 * @ param end The end index for pagination ( 0 based ) .
 * @ param listener A listener to handle the result . */
public static void getActionsByUser ( Activity context , long userId , int start , int end , ActionListListener listener ) { } }

implementation: proxy . getActionsByUser ( context , userId , start , end , listener ) ;


signature:
public class ActionUtils { /** * Gets the actions for a given entity .
 * @ param context The current context .
 * @ param entityKey The entity key .
 * @ param start The start index for pagination ( 0 based ) .
 * @ param end The end index for pagination ( 0 based ) .
 * @ param listener A listener to handle the result . */
public static void getActionsByEntity ( Activity context , String entityKey , int start , int end , ActionListListener listener ) { } }

implementation: proxy . getActionsByEntity ( context , entityKey , start , end , listener ) ;


signature:
public class ActionUtils { /** * Gets the actions of a single user on a single entity .
 * @ param context The current context .
 * @ param userId The user for whom the actions will be returned .
 * @ param entityKey The entity key .
 * @ param start The start index for pagination ( 0 based ) .
 * @ param end The end index for pagination ( 0 based ) .
 * @ param listener A listener to handle the result . */
public static void getActionsByUserAndEntity ( Activity context , long userId , String entityKey , int start , int end , ActionListListener listener ) { } }

implementation: proxy . getActionsByUserAndEntity ( context , userId , entityKey , start , end , listener ) ;


signature:
public class JsonWriter { /** * Closes the current scope by appending any necessary whitespace and the
 * given bracket . */
private JsonWriter close ( JsonScope empty , JsonScope nonempty , String closeBracket ) throws IOException { } }

implementation: JsonScope context = peek ( ) ; if ( context != nonempty && context != empty ) { throw new IllegalStateException ( "Nesting problem: " + stack ) ; } if ( deferredName != null ) { throw new IllegalStateException ( "Dangling name: " + deferredName ) ; } stack . remove ( stack . size ( ) - 1 ) ; if ( context == nonempty ) { newline ( ) ; } out . write ( closeBracket ) ; return this ;


signature:
public class JsonWriter { /** * Encodes the property name .
 * @ param name the name of the forthcoming value . May not be null .
 * @ return this writer . */
public JsonWriter name ( String name ) throws IOException { } }

implementation: if ( name == null ) { throw new NullPointerException ( "name == null" ) ; } if ( deferredName != null ) { throw new IllegalStateException ( ) ; } deferredName = name ; return this ;


signature:
public class JsonWriter { /** * Encodes { @ code value } .
 * @ param value a finite value . May not be { @ link Double # isNaN ( ) NaNs } or
 * { @ link Double # isInfinite ( ) infinities } .
 * @ return this writer . */
public JsonWriter value ( Number value ) throws IOException { } }

implementation: if ( value == null ) { return nullValue ( ) ; } writeDeferredName ( ) ; String string = value . toString ( ) ; if ( ! lenient && ( string . equals ( "-Infinity" ) || string . equals ( "Infinity" ) || string . equals ( "NaN" ) ) ) { throw new IllegalArgumentException ( "Numeric values must be finite, but was " + value ) ; } beforeValue ( false ) ; out . append ( string ) ; return this ;


signature:
public class BaseMessageTranslator { /** * / * ( non - Javadoc )
 * @ see com . socialize . notifications . MessageTranslator # translate ( android . content . Context , android . os . Bundle , com . socialize . notifications . NotificationMessage ) */
@ Override public T translate ( Context context , Bundle data , NotificationMessage message ) throws SocializeException { } }

implementation:
data . putString ( Socialize . ACTION_ID , String . valueOf ( message . getActionId ( ) ) ) ; data . putString ( Socialize . ACTION_TYPE , String . valueOf ( message . getActionType ( ) . name ( ) ) ) ; // The action detail view expects this , but will handle the - 1 case .
data . putString ( Socialize . USER_ID , "-1" ) ; return translate ( context , message ) ;


signature:
public class JsonParser { /** * Parses the specified JSON string into a parse tree
 * @ param json JSON text
 * @ return a parse tree of { @ link JsonElement } s corresponding to the specified JSON
 * @ throws JsonParseException if the specified text is not valid JSON
 * @ since 1.3 */
public JsonElement parse ( Reader json ) throws JsonIOException , JsonSyntaxException { } }

implementation: try { JsonReader jsonReader = new JsonReader ( json ) ; JsonElement element = parse ( jsonReader ) ; if ( ! element . isJsonNull ( ) && jsonReader . peek ( ) != JsonToken . END_DOCUMENT ) { throw new JsonSyntaxException ( "Did not consume the entire document." ) ; } return element ; } catch ( MalformedJsonException e ) { throw new JsonSyntaxException ( e ) ; } catch ( IOException e ) { throw new JsonIOException ( e ) ; } catch ( NumberFormatException e ) { throw new JsonSyntaxException ( e ) ; }


signature:
public class JsonParser { /** * Returns the next value from the JSON stream as a parse tree .
 * @ throws JsonParseException if there is an IOException or if the specified
 * text is not valid JSON
 * @ since 1.6 */
public JsonElement parse ( JsonReader json ) throws JsonIOException , JsonSyntaxException { } }

implementation: boolean lenient = json . isLenient ( ) ; json . setLenient ( true ) ; try { return Streams . parse ( json ) ; } catch ( StackOverflowError e ) { throw new JsonParseException ( "Failed parsing JSON source: " + json + " to Json" , e ) ; } catch ( OutOfMemoryError e ) { throw new JsonParseException ( "Failed parsing JSON source: " + json + " to Json" , e ) ; } catch ( JsonParseException e ) { if ( e . getCause ( ) instanceof EOFException ) { return JsonNull . INSTANCE ; } throw e ; } finally { json . setLenient ( lenient ) ; }


signature:
public class ActivityLauncher { /** * / * ( non - Javadoc )
 * @ see com . socialize . launcher . Launcher # launch ( android . app . Activity , android . os . Bundle ) */
@ Override public boolean launch ( Activity context , Bundle data ) { } }

implementation: if ( entityLoaderUtils != null ) { entityLoaderUtils . initEntityLoader ( ) ; } Class < ? > [ ] activityClasses = getActivityClasses ( ) ; Class < ? > activityClass = null ; for ( Class < ? > cls : activityClasses ) { if ( appUtils . isActivityAvailable ( context , cls ) ) { activityClass = cls ; break ; } } if ( activityClass != null ) { Intent intent = newIntent ( context , activityClass ) ; intent . putExtras ( data ) ; handleIntent ( context , intent , data ) ; context . startActivity ( intent ) ; return true ; } return false ;


signature:
public class ListCheckinsActivity { /** * / * ( non - Javadoc )
 * @ see com . socialize . demo . DemoActivity # executeDemo ( ) */
@ Override public void executeDemo ( String text ) { } }

implementation:
// We need additional permissions for this
String [ ] permissions = { "user_tagged_places" } ; FacebookUtils . linkForRead ( this , new SocializeAuthListener ( ) { @ Override public void onError ( SocializeException error ) { handleError ( ListCheckinsActivity . this , error ) ; } @ Override public void onCancel ( ) { handleCancel ( ) ; } @ Override public void onAuthSuccess ( SocializeSession session ) { FacebookUtils . get ( ListCheckinsActivity . this , "me/tagged_places" , null , new SocialNetworkPostListener ( ) { @ Override public void onNetworkError ( Activity context , SocialNetwork network , Exception error ) { handleError ( context , error ) ; } @ Override public void onCancel ( ) { handleCancel ( ) ; } @ Override public void onAfterPost ( Activity parent , SocialNetwork socialNetwork , JSONObject responseObject ) { try { handleResult ( responseObject . toString ( 4 ) ) ; } catch ( JSONException e ) { handleError ( parent , e ) ; } } } ) ; } @ Override public void onAuthFail ( SocializeException error ) { handleError ( ListCheckinsActivity . this , error ) ; } } , permissions ) ;


signature:
public class ActionDetailView { /** * / * ( non - Javadoc )
 * @ see com . socialize . ui . view . EntityView # getView ( android . os . Bundle , java . lang . Object [ ] ) */
@ Override protected View getView ( Bundle bundle , Object ... bundleKeys ) { } }

implementation: if ( bundleKeys != null ) { if ( actionLayoutView == null ) { actionLayoutView = container . getBean ( "actionDetailLayoutView" , bundleKeys ) ; LayoutParams scrollViewLayout = new LinearLayout . LayoutParams ( LinearLayout . LayoutParams . FILL_PARENT , LinearLayout . LayoutParams . FILL_PARENT ) ; LayoutParams childViewLayout = new LinearLayout . LayoutParams ( LinearLayout . LayoutParams . FILL_PARENT , LinearLayout . LayoutParams . FILL_PARENT ) ; ScrollView scrollView = new ScrollView ( getContext ( ) ) ; scrollView . setFillViewport ( true ) ; scrollView . setLayoutParams ( scrollViewLayout ) ; scrollView . addView ( actionLayoutView , childViewLayout ) ; LinearLayout layout = new LinearLayout ( getContext ( ) ) ; LayoutParams masterParams = new LinearLayout . LayoutParams ( LinearLayout . LayoutParams . FILL_PARENT , LinearLayout . LayoutParams . FILL_PARENT ) ; layout . setLayoutParams ( masterParams ) ; CompatUtils . setBackgroundDrawable ( layout , ( ( Drawables ) container . getBean ( "drawables" ) ) . getDrawable ( "slate.png" , true , true , true ) ) ; layout . addView ( scrollView ) ; view = layout ; } return view ; } else { SocializeLogger . e ( "No user id specified for " + getClass ( ) . getSimpleName ( ) ) ; return null ; }


signature:
public class IsLikedListener { /** * / * ( non - Javadoc )
 * @ see com . socialize . listener . AbstractSocializeListener # onError ( com . socialize . error . SocializeException ) */
@ Override public void onError ( SocializeException error ) { } }

implementation: if ( error instanceof SocializeApiError ) { SocializeApiError aError = ( SocializeApiError ) error ; if ( aError . getResultCode ( ) != 404 ) { SocializeLogger . e ( error . getMessage ( ) , error ) ; } } else { SocializeLogger . e ( error . getMessage ( ) , error ) ; } onNotLiked ( ) ;


signature:
public class EmailShareHandler { /** * / * ( non - Javadoc )
 * @ see com . socialize . share . AbstractShareHandler # handle ( android . app . Activity , com . socialize . entity . SocializeAction , java . lang . String , com . socialize . entity . PropagationInfo , com . socialize . share . ShareHandlerListener ) */
@ Override protected void handle ( Activity context , SocializeAction action , String text , PropagationInfo info , SocialNetworkListener listener ) throws Exception { } }

implementation: boolean shareCancelled = false ; Entity entity = action . getEntity ( ) ; PostData postData = sharePostDataFactory . create ( entity , info , text , isHtml ( ) , true ) ; if ( listener != null ) { shareCancelled = listener . onBeforePost ( context , null , postData ) ; } if ( ! shareCancelled ) { String title = String . valueOf ( postData . getPostValues ( ) . get ( ShareUtils . EXTRA_TITLE ) ) ; String body = String . valueOf ( postData . getPostValues ( ) . get ( ShareUtils . EXTRA_TEXT ) ) ; Intent msg = getIntent ( context ) ; msg . putExtra ( Intent . EXTRA_TITLE , title ) ; if ( isHtml ( ) ) { msg . putExtra ( Intent . EXTRA_TEXT , Html . fromHtml ( body ) ) ; } else { msg . putExtra ( Intent . EXTRA_TEXT , body ) ; } msg . putExtra ( Intent . EXTRA_SUBJECT , String . valueOf ( postData . getPostValues ( ) . get ( ShareUtils . EXTRA_SUBJECT ) ) ) ; startActivity ( context , msg , title ) ; } if ( listener != null ) { listener . onAfterPost ( context , null , null ) ; }


signature:
public class DeviceRegistrationFactory { /** * / * ( non - Javadoc )
 * @ see com . socialize . entity . SocializeObjectFactory # postToJSON ( com . socialize . entity . SocializeObject , org . json . JSONObject ) */
@ Override protected void postToJSON ( DeviceRegistration from , JSONObject to ) throws JSONException { } }

implementation: to . put ( "gcm_registration_id" , from . getRegistrationId ( ) ) ; to . put ( "device_type" , "Android" ) ; to . put ( "service_type" , "ANDROID_GCM" ) ;


signature:
public class TwitterUtils { /** * Links the current user to their Twitter account using an existing Twitter oAuth token and secret .
 * @ param context The current activity .
 * @ param token The user ' s Twitter token .
 * @ param secret The user ' s Twitter token secret .
 * @ param listener A listener to handle the result . */
public static void link ( Activity context , String token , String secret , SocializeAuthListener listener ) { } }

implementation: proxy . link ( context , token , secret , listener ) ;


signature:
public class TwitterUtils { /** * Sets the Twitter App credentials for the application . This sets the same configuration properties as twitter . consumer . key and twitter . consumer . secret
 * @ param context The current context .
 * @ param consumerKey The Twitter App Consumer Key
 * @ param consumerSecret The Twitter App Consumer Secret */
public static void setCredentials ( Context context , String consumerKey , String consumerSecret ) { } }

implementation: proxy . setCredentials ( context , consumerKey , consumerSecret ) ;


signature:
public class TwitterUtils { /** * " Tweets " an entity . A " share " event will be recorded in Socialize and the entity URL generated by Socialize will be posted to the user ' s Twitter feed .
 * If the user is not currently linked to a Twitter account they will be prompted to authenticate .
 * @ param context The current activity .
 * @ param entity The entity to be tweeted .
 * @ param text The text to be posted along with the tweet .
 * @ param listener A listener to handle the result . */
public static void tweetEntity ( final Activity context , final Entity entity , final String text , final SocialNetworkShareListener listener ) { } }

implementation: if ( proxy . isLinked ( context ) ) { proxy . tweetEntity ( context , entity , text , listener ) ; } else { proxy . link ( context , new SocializeAuthListener ( ) { @ Override public void onError ( SocializeException error ) { if ( listener != null ) { listener . onNetworkError ( context , SocialNetwork . TWITTER , error ) ; } } @ Override public void onCancel ( ) { if ( listener != null ) { listener . onCancel ( ) ; } } @ Override public void onAuthSuccess ( SocializeSession session ) { proxy . tweetEntity ( context , entity , text , listener ) ; } @ Override public void onAuthFail ( SocializeException error ) { if ( listener != null ) { listener . onNetworkError ( context , SocialNetwork . TWITTER , error ) ; } } } ) ; }


signature:
public class TwitterUtils { /** * Performs a simple HTTP GET to the Twitter resource endpoint specified . If the user is not currently linked to a Twitter account they will be prompted to authenticate .
 * @ param context The current Activity .
 * @ param resource The resource to be called . NOTE : This should NOT include the full url ( e . g . http : / / api . twitter . com ) but just the resource .
 * Changing the full URL endpoint can be done via the SocialNetworkPostListener onBeforePost callback .
 * @ param params The parameters to be posted .
 * @ param listener A listener to handle the result . */
public static void get ( final Activity context , final String resource , final Map < String , Object > params , final SocialNetworkPostListener listener ) { } }

implementation: if ( proxy . isLinked ( context ) ) { proxy . get ( context , resource , params , listener ) ; } else { proxy . link ( context , new SocializeAuthListener ( ) { @ Override public void onError ( SocializeException error ) { if ( listener != null ) { listener . onNetworkError ( context , SocialNetwork . TWITTER , error ) ; } } @ Override public void onCancel ( ) { if ( listener != null ) { listener . onCancel ( ) ; } } @ Override public void onAuthSuccess ( SocializeSession session ) { proxy . get ( context , resource , params , listener ) ; } @ Override public void onAuthFail ( SocializeException error ) { if ( listener != null ) { listener . onNetworkError ( context , SocialNetwork . TWITTER , error ) ; } } } ) ; }


signature:
public class TwitterUtils { /** * Performs a simple " tweet " . If the user is not currently linked to a Twitter account they will be prompted to authenticate .
 * @ param context The current Activity .
 * @ param tweet The Tweet to be tweeted .
 * @ param listener A listener to handle the result . */
public static void tweet ( final Activity context , final Tweet tweet , final SocialNetworkListener listener ) { } }

implementation: if ( proxy . isLinked ( context ) ) { proxy . tweet ( context , tweet , listener ) ; } else { proxy . link ( context , new SocializeAuthListener ( ) { @ Override public void onError ( SocializeException error ) { if ( listener != null ) { listener . onNetworkError ( context , SocialNetwork . TWITTER , error ) ; } } @ Override public void onCancel ( ) { if ( listener != null ) { listener . onCancel ( ) ; } } @ Override public void onAuthSuccess ( SocializeSession session ) { proxy . tweet ( context , tweet , listener ) ; } @ Override public void onAuthFail ( SocializeException error ) { if ( listener != null ) { listener . onNetworkError ( context , SocialNetwork . TWITTER , error ) ; } } } ) ; }


signature:
public class TwitterUtils { /** * Publishes a photo to a user ' s Twitter feed . If the user is not currently linked to a Twitter account they will be prompted to authenticate .
 * @ param context The current Activity .
 * @ param photo The image to be tweeted .
 * @ param listener A listener to handle the result . */
public static void tweetPhoto ( final Activity context , final PhotoTweet photo , final SocialNetworkPostListener listener ) { } }

implementation: if ( proxy . isLinked ( context ) ) { proxy . tweetPhoto ( context , photo , listener ) ; } else { proxy . link ( context , new SocializeAuthListener ( ) { @ Override public void onError ( SocializeException error ) { if ( listener != null ) { listener . onNetworkError ( context , SocialNetwork . TWITTER , error ) ; } } @ Override public void onCancel ( ) { if ( listener != null ) { listener . onCancel ( ) ; } } @ Override public void onAuthSuccess ( SocializeSession session ) { proxy . tweetPhoto ( context , photo , listener ) ; } @ Override public void onAuthFail ( SocializeException error ) { if ( listener != null ) { listener . onNetworkError ( context , SocialNetwork . TWITTER , error ) ; } } } ) ; }


signature:
public class PreferenceSessionPersister { /** * ( non - Javadoc )
 * @ see com . socialize . api . SocializeSessionPersister # delete ( android . content . Context , com . socialize . auth . AuthProviderType ) */
@ Override public synchronized void delete ( Context context , AuthProviderType type ) { } }

implementation: SharedPreferences prefs = context . getSharedPreferences ( PREFERENCES , Context . MODE_PRIVATE ) ; String authData = prefs . getString ( USER_AUTH_DATA , null ) ; Editor editor = prefs . edit ( ) ; if ( ! StringUtils . isEmpty ( authData ) ) { UserProviderCredentialsMap map = jsonUtils . fromJSON ( authData , UserProviderCredentialsMap . class ) ; map . remove ( type ) ; editor . putString ( USER_AUTH_DATA , jsonUtils . toJSON ( map ) ) ; } else { editor . putString ( USER_AUTH_DATA , jsonUtils . toJSON ( makeDefaultUserProviderCredentials ( ) ) ) ; } editor . commit ( ) ;


signature:
public class PreferenceSessionPersister { /** * / * ( non - Javadoc )
 * @ see com . socialize . api . SocializeSessionPersister # save ( android . content . Context , com . socialize . api . SocializeSession ) */
@ Override public synchronized void save ( Context context , SocializeSession session ) { } }

implementation: SharedPreferences prefs = context . getSharedPreferences ( PREFERENCES , Context . MODE_PRIVATE ) ; Editor editor = prefs . edit ( ) ; editor . putString ( "consumer_key" , session . getConsumerKey ( ) ) ; editor . putString ( "consumer_secret" , session . getConsumerSecret ( ) ) ; editor . putString ( "consumer_token" , session . getConsumerToken ( ) ) ; editor . putString ( "consumer_token_secret" , session . getConsumerTokenSecret ( ) ) ; editor . putString ( SOCIALIZE_VERSION , Socialize . VERSION ) ; String userProviderCredentials = jsonUtils . toJSON ( session . getUserProviderCredentials ( ) ) ; editor . putString ( USER_AUTH_DATA , userProviderCredentials ) ; User user = session . getUser ( ) ; UserSettings settings = session . getUserSettings ( ) ; saveUser ( editor , user , settings ) ; editor . commit ( ) ;


signature:
public class PreferenceSessionPersister { /** * / * ( non - Javadoc )
 * @ see com . socialize . api . SocializeSessionPersister # load ( android . content . Context ) */
@ Override public synchronized WritableSession load ( Context context ) { } }

implementation: SharedPreferences prefs = context . getSharedPreferences ( PREFERENCES , Context . MODE_PRIVATE ) ; String key = prefs . getString ( "consumer_key" , null ) ; String secret = prefs . getString ( "consumer_secret" , null ) ; UserProviderCredentialsMap userProviderCredentials = loadUserProviderCredentials ( prefs ) ; WritableSession session = sessionFactory . create ( key , secret , userProviderCredentials ) ; session . setRestored ( true ) ; String oauth_token = prefs . getString ( "consumer_token" , null ) ; String oauth_token_secret = prefs . getString ( "consumer_token_secret" , null ) ; if ( StringUtils . isEmpty ( oauth_token ) || StringUtils . isEmpty ( oauth_token_secret ) ) { return null ; } session . setConsumerToken ( oauth_token ) ; session . setConsumerTokenSecret ( oauth_token_secret ) ; String userJson = prefs . getString ( "user" , null ) ; User user = null ; if ( userJson != null ) { try { JSONObject json = new JSONObject ( userJson ) ; user = userFactory . fromJSON ( json ) ; session . setUser ( user ) ; } catch ( JSONException e ) { if ( logger != null ) { logger . error ( "Failed to deserialize user object" , e ) ; } else { SocializeLogger . e ( "Failed to deserialize user object" , e ) ; } } } String userSettingsJson = prefs . getString ( "user-settings" , null ) ; if ( userSettingsJson != null ) { try { JSONObject json = new JSONObject ( userSettingsJson ) ; UserSettings userSettings = userSettingsFactory . fromJSON ( json ) ; session . setUserSettings ( userSettings ) ; } catch ( JSONException e ) { if ( logger != null ) { logger . error ( "Failed to deserialize user settings object" , e ) ; } else { SocializeLogger . e ( "Failed to deserialize user settings object" , e ) ; } } } else if ( user != null ) { session . setUserSettings ( createSettingsLegacy ( user ) ) ; } return session ;


signature:
public class PreferenceSessionPersister { /** * / * ( non - Javadoc )
 * @ see com . socialize . api . SocializeSessionPersister # delete ( android . content . Context ) */
@ Override public synchronized void delete ( Context context ) { } }

implementation: SharedPreferences prefs = context . getSharedPreferences ( PREFERENCES , Context . MODE_PRIVATE ) ; prefs . edit ( ) . clear ( ) . commit ( ) ;


signature:
public class SocializeActionUtils { /** * / * ( non - Javadoc )
 * @ see com . socialize . api . action . activity . ActivityUtilsProxy # getActivityByApplication ( android . app . Activity , int , int , com . socialize . listener . activity . UserActivityListListener ) */
@ Override public void getActionsByApplication ( Activity context , int start , int end , ActionListListener listener ) { } }

implementation: activitySystem . getActivityByApplication ( Socialize . getSocialize ( ) . getSession ( ) , start , end , listener ) ;


signature:
public class SocializeActionUtils { /** * / * ( non - Javadoc )
 * @ see com . socialize . api . action . activity . ActivityUtilsProxy # getActivityByUser ( android . app . Activity , com . socialize . entity . User , int , int , com . socialize . listener . activity . UserActivityListListener ) */
@ Override public void getActionsByUser ( Activity context , long userId , int start , int end , ActionListListener listener ) { } }

implementation: activitySystem . getActivityByUser ( Socialize . getSocialize ( ) . getSession ( ) , userId , start , end , listener ) ;


signature:
public class SocializeActionUtils { /** * / * ( non - Javadoc )
 * @ see com . socialize . api . action . activity . ActivityUtilsProxy # getActivityByEntity ( android . app . Activity , com . socialize . entity . Entity , int , int , com . socialize . listener . activity . UserActivityListListener ) */
@ Override public void getActionsByEntity ( Activity context , String entityKey , int start , int end , ActionListListener listener ) { } }

implementation: activitySystem . getActivityByEntity ( Socialize . getSocialize ( ) . getSession ( ) , entityKey , start , end , listener ) ;


signature:
public class SocializeActionUtils { /** * / * ( non - Javadoc )
 * @ see com . socialize . api . action . activity . ActivityUtilsProxy # getActivityByUserAndEntity ( android . app . Activity , com . socialize . entity . User , com . socialize . entity . Entity , int , int , com . socialize . listener . activity . UserActivityListListener ) */
@ Override public void getActionsByUserAndEntity ( Activity context , long userId , String entityKey , int start , int end , ActionListListener listener ) { } }

implementation: activitySystem . getActivityByUserAndEntity ( Socialize . getSocialize ( ) . getSession ( ) , userId , entityKey , start , end , listener ) ;


signature:
public class DefaultObjectUtils { /** * / * ( non - Javadoc )
 * @ see com . socialize . util . ObjectUtils # construct ( java . lang . String ) */
@ Override public < T > T construct ( String className ) throws SocializeException { } }

implementation: try { return builder . construct ( className ) ; } catch ( Exception e ) { throw new SocializeException ( e ) ; }


signature:
public class GetCommentsByEntityActivity { /** * / * ( non - Javadoc )
 * @ see com . socialize . demo . DemoActivity # executeDemo ( ) */
@ Override public void executeDemo ( String text ) { } }

implementation: CommentUtils . getCommentsByEntity ( this , entity . getKey ( ) , 0 , PAGE_SIZE , new CommentListListener ( ) { @ Override public void onList ( ListResult < Comment > comments ) { handleSocializeResult ( comments ) ; } @ Override public void onError ( SocializeException error ) { handleError ( GetCommentsByEntityActivity . this , error ) ; } } ) ;


signature:
public class BitmapUtils { /** * Returns a scaled bitmap , cropped if necessary .
 * @ param bitmap
 * @ param scaleToWidth
 * @ param scaleToHeight
 * @ param recycleOriginal
 * @ return */
public Bitmap getScaledBitmap ( Bitmap bitmap , int scaleToWidth , int scaleToHeight , boolean recycleOriginal , int density ) { } }

implementation:
bitmap . setDensity ( density ) ; Bitmap original = bitmap ; if ( scaleToWidth > 0 || scaleToHeight > 0 ) { int width = bitmap . getWidth ( ) ; int height = bitmap . getHeight ( ) ; // scale lowest and crop highes
if ( height != scaleToHeight || width != scaleToWidth ) { float ratio = 1.0f ; // Scale to smallest
if ( height > width ) { ratio = ( float ) scaleToWidth / ( float ) width ; width = scaleToWidth ; height = Math . round ( ( float ) height * ratio ) ; bitmap = bitmapBuilder . scale ( bitmap , width , height ) ; width = bitmap . getWidth ( ) ; height = bitmap . getHeight ( ) ; if ( height > scaleToHeight ) { // crop height
int diff = height - scaleToHeight ; int half = Math . round ( ( float ) diff / 2.0f ) ; bitmap = bitmapBuilder . crop ( bitmap , 0 , half , width , scaleToHeight ) ; } } else { ratio = ( float ) scaleToHeight / ( float ) height ; height = scaleToHeight ; width = Math . round ( ( float ) width * ratio ) ; bitmap = bitmapBuilder . scale ( bitmap , width , height ) ; width = bitmap . getWidth ( ) ; height = bitmap . getHeight ( ) ; if ( width > scaleToWidth ) { // crop width
int diff = width - scaleToWidth ; int half = Math . round ( ( float ) diff / 2.0f ) ; bitmap = bitmapBuilder . crop ( bitmap , half , 0 , scaleToWidth , height ) ; } } if ( recycleOriginal ) { original . recycle ( ) ; } } } return bitmap ;


signature:
public class SocializeApi { /** * Does a POST , but expects a single object in return .
 * @ param session
 * @ param endpoint
 * @ param object
 * @ param listener */
@ SuppressWarnings ( "unchecked" ) public void putAsPostAsync ( SocializeSession session , String endpoint , T object , SocializeActionListener listener ) { } }

implementation: AsyncPutter poster = new AsyncPutter ( session , listener ) ; SocializePutRequest < T > request = new SocializePutRequest < T > ( ) ; request . setRequestType ( RequestType . PUT_AS_POST ) ; request . setEndpoint ( endpoint ) ; request . setObject ( object ) ; poster . execute ( request ) ;


signature:
public class ActionBarView { /** * / * ( non - Javadoc )
 * @ see com . socialize . ui . view . EntityView # getView ( android . os . Bundle , java . lang . Object [ ] ) */
@ Override protected View getView ( Bundle bundle , Object ... entityKeys ) { } }

implementation: if ( actionBarLayoutView == null ) { actionBarLayoutView = container . getBean ( "actionBarLayoutView" , this , actionBarOptions ) ; if ( actionBarLayoutView == null ) { SocializeLogger . w ( "Request for bean [actionBarLayoutView] returned null" ) ; } } setListeners ( ) ; if ( actionBarListener != null ) { actionBarListener . onCreate ( this ) ; } return actionBarLayoutView ;


signature:
public class FacebookFacadeV2 { /** * / * ( non - Javadoc )
 * @ see com . socialize . networks . facebook . FacebookFacade # extendAccessToken ( android . app . Activity , com . socialize . listener . SocializeAuthListener ) */
@ Override public void extendAccessToken ( final Activity context , final SocializeAuthListener listener ) { } }

implementation:
try { Facebook facebook = getFacebook ( context ) ; if ( isLinked ( context ) ) { if ( facebook != null && ! facebook . extendAccessTokenIfNeeded ( context , new ServiceListener ( ) { @ Override public void onFacebookError ( FacebookError e ) { if ( logger != null ) { logger . warn ( "An error occurred while attempting to extend a Facebook access token.  The local Facebook account will be cleared." , e ) ; } // Clear the local session state
unlink ( context , null ) ; } @ Override public void onError ( Error e ) { if ( logger != null ) { logger . warn ( "An error occurred while attempting to extend a Facebook access token.  The local Facebook account will be cleared." , e ) ; } // Clear the local session state
unlink ( context , null ) ; } @ Override public void onComplete ( Bundle values ) { // Update the local session state
SocializeSession session = getSocialize ( ) . getSession ( ) ; if ( session != null ) { final String newAccessToken = values . getString ( Facebook . TOKEN ) ; if ( ! StringUtils . isEmpty ( newAccessToken ) ) { if ( logger != null && logger . isDebugEnabled ( ) ) { logger . debug ( "Got new Facebook access token [" + newAccessToken + "]" ) ; } // Link the user again
link ( context , newAccessToken , false , new SocializeAuthListener ( ) { @ Override public void onError ( SocializeException error ) { if ( logger != null ) { logger . error ( "An error occurred while attempting to update authentication details" , error ) ; } if ( listener != null ) { listener . onError ( error ) ; } } @ Override public void onCancel ( ) { if ( listener != null ) { listener . onCancel ( ) ; } } @ Override public void onAuthSuccess ( SocializeSession session ) { UserProviderCredentialsMap map = session . getUserProviderCredentials ( ) ; UserProviderCredentials creds = map . get ( AuthProviderType . FACEBOOK ) ; DefaultUserProviderCredentials newCreds = new DefaultUserProviderCredentials ( ) ; if ( creds != null ) { newCreds . merge ( creds ) ; } newCreds . setAccessToken ( newAccessToken ) ; map . put ( AuthProviderType . FACEBOOK , newCreds ) ; getSocialize ( ) . setSession ( session ) ; getSocialize ( ) . saveSession ( context ) ; if ( listener != null ) { listener . onAuthSuccess ( session ) ; } } @ Override public void onAuthFail ( SocializeException error ) { if ( logger != null ) { logger . error ( "An error occurred while attempting to update authentication details" , error ) ; } if ( listener != null ) { listener . onAuthFail ( error ) ; } } } ) ; } else { if ( logger != null ) { logger . warn ( "Access token returned from Facebook was empty during request to extend" ) ; } } } } } ) ) { if ( logger != null ) { logger . warn ( "Failed to bind to the Facebook RefreshToken Service" ) ; } } } else if ( facebook != null ) { // Ensure the local fb session is cleared
String accessToken = facebook . getAccessToken ( ) ; if ( ! StringUtils . isEmpty ( accessToken ) ) { new FacebookSessionStore ( ) . clear ( context ) ; } } } catch ( Exception e ) { if ( listener != null ) { listener . onError ( SocializeException . wrap ( e ) ) ; } if ( logger != null ) { logger . error ( "Failure during Facebook Token Refresh" , e ) ; } }


signature:
public class SocializeButton { /** * Set the text size in DIP
 * @ param textSize */
public void setTextSize ( int textSize ) { } }

implementation: if ( textView != null ) { textView . setTextSize ( android . util . TypedValue . COMPLEX_UNIT_DIP , textSize ) ; } this . textSize = textSize ;


signature:
public class UserTimelineActivity { /** * / * ( non - Javadoc )
 * @ see com . socialize . demo . DemoActivity # executeDemo ( ) */
@ Override public void executeDemo ( String text ) { } }

implementation: TwitterUtils . link ( this , new SocializeAuthListener ( ) { @ Override public void onError ( SocializeException error ) { handleError ( UserTimelineActivity . this , error ) ; } @ Override public void onCancel ( ) { handleCancel ( ) ; } @ Override public void onAuthSuccess ( SocializeSession session ) { TwitterUtils . get ( UserTimelineActivity . this , "statuses/user_timeline.json" , null , new SocialNetworkPostListener ( ) { @ Override public void onNetworkError ( Activity context , SocialNetwork network , Exception error ) { handleError ( context , error ) ; } @ Override public void onCancel ( ) { handleCancel ( ) ; } @ Override public void onAfterPost ( Activity parent , SocialNetwork socialNetwork , JSONObject responseObject ) { try { JSONArray jsonArray = responseObject . getJSONArray ( "data" ) ; StringBuilder builder = new StringBuilder ( ) ; int len = jsonArray . length ( ) ; for ( int i = 0 ; i < len ; i ++ ) { if ( i > 0 ) { builder . append ( "\n" ) ; } builder . append ( jsonArray . getString ( i ) ) ; } handleResult ( builder . toString ( ) ) ; } catch ( JSONException e ) { handleError ( parent , e ) ; } } } ) ; } @ Override public void onAuthFail ( SocializeException error ) { handleError ( UserTimelineActivity . this , error ) ; } } ) ;


signature:
public class ProfileView { /** * Called when the user ' s profile image is changed .
 * @ param bitmap The image . */
public void onImageChange ( Bitmap bitmap , String localPath ) { } }

implementation:
if ( profileLayoutView != null ) { profileLayoutView . onImageChange ( bitmap ) ; } // Set the image in the user settings
try { UserUtils . getUserSettings ( getContext ( ) ) . setLocalImagePath ( localPath ) ; } catch ( SocializeException e ) { Log . e ( SocializeLogger . LOG_TAG , "Error getting user settings" , e ) ; }


signature:
public class GetPopularEntitiesActivity { /** * / * ( non - Javadoc )
 * @ see com . socialize . demo . DemoActivity # executeDemo ( ) */
@ Override public void executeDemo ( String text ) { } }

implementation: EntityUtils . getEntities ( this , 0 , PAGE_SIZE , SortOrder . TOTAL_ACTIVITY , new EntityListListener ( ) { @ Override public void onList ( ListResult < Entity > entities ) { List < Entity > items = entities . getItems ( ) ; Collection < String > strResults = new ArrayList < String > ( ) ; for ( Entity socializeAction : items ) { strResults . add ( socializeAction . toString ( ) + " (Total Activity " + socializeAction . getEntityStats ( ) . getTotalActivityCount ( ) + ")" ) ; } handleResults ( strResults ) ; } @ Override public void onError ( SocializeException error ) { handleError ( GetPopularEntitiesActivity . this , error ) ; } } ) ;


signature:
public class AddEntityActivity { /** * / * ( non - Javadoc )
 * @ see com . socialize . demo . DemoActivity # executeDemo ( ) */
@ Override public void executeDemo ( String text ) { } }

implementation:
// usually the name parameter would be a human readable name ( i . e . not the same as the key ) .
Entity e = Entity . newInstance ( text , text ) ; EntityUtils . saveEntity ( this , e , new EntityAddListener ( ) { @ Override public void onError ( SocializeException error ) { handleError ( AddEntityActivity . this , error ) ; } @ Override public void onCreate ( Entity entity ) { handleBasicSocializeResult ( entity ) ; } } ) ;


signature:
public class AbstractOAuthProvider { /** * Implemented by subclasses . The responsibility of this method is to
 * contact the service provider at the given endpoint URL and fetch a
 * request or access token . What kind of token is retrieved solely depends
 * on the URL being used .
 * Correct implementations of this method must guarantee the following
 * post - conditions :
 * < ul >
 * < li > the { @ link OAuthConsumer } passed to this method must have a valid
 * { @ link OAuth # OAUTH _ TOKEN } and { @ link OAuth # OAUTH _ TOKEN _ SECRET } set by
 * calling { @ link OAuthConsumer # setTokenWithSecret ( String , String ) } < / li >
 * < li > { @ link # getResponseParameters ( ) } must return the set of query
 * parameters served by the service provider in the token response , with all
 * OAuth specific parameters being removed < / li >
 * < / ul >
 * @ param consumer
 * the { @ link OAuthConsumer } that should be used to sign the
 * request
 * @ param endpointUrl
 * the URL at which the service provider serves the OAuth token
 * that is to be fetched
 * @ param additionalParameters
 * you can pass parameters here ( typically OAuth parameters such
 * as oauth _ callback or oauth _ verifier ) which will go directly
 * into the signer , i . e . you don ' t have to put them into the
 * request first , just so the consumer pull them out again . Pass
 * them sequentially in key / value order .
 * @ throws OAuthMessageSignerException
 * if signing the token request fails
 * @ throws OAuthCommunicationException
 * if a network communication error occurs
 * @ throws OAuthNotAuthorizedException
 * if the server replies 401 - Unauthorized
 * @ throws OAuthExpectationFailedException
 * if an expectation has failed , e . g . because the server didn ' t
 * reply in the expected format */
protected void retrieveToken ( OAuthConsumer consumer , String endpointUrl , OAuthTokenListener listener , String ... additionalParameters ) throws OAuthMessageSignerException , OAuthCommunicationException , OAuthNotAuthorizedException , OAuthExpectationFailedException { } }

implementation: Map < String , String > defaultHeaders = getRequestHeaders ( ) ; if ( consumer . getConsumerKey ( ) == null || consumer . getConsumerSecret ( ) == null ) { throw new OAuthExpectationFailedException ( "Consumer key or secret not set" ) ; } HttpRequest request = null ; HttpResponse response = null ; try { request = createRequest ( endpointUrl ) ; for ( String header : defaultHeaders . keySet ( ) ) { request . setHeader ( header , defaultHeaders . get ( header ) ) ; } if ( additionalParameters != null ) { HttpParameters httpParams = new HttpParameters ( ) ; httpParams . putAll ( additionalParameters , true ) ; consumer . setAdditionalParameters ( httpParams ) ; } if ( this . listener != null ) { this . listener . prepareRequest ( request ) ; } consumer . sign ( request ) ; if ( this . listener != null ) { this . listener . prepareSubmission ( request ) ; } response = sendRequest ( request ) ; int statusCode = response . getStatusCode ( ) ; boolean requestHandled = false ; if ( this . listener != null ) { requestHandled = this . listener . onResponseReceived ( request , response ) ; } if ( requestHandled ) { return ; } if ( statusCode >= 300 ) { handleUnexpectedResponse ( statusCode , response ) ; } HttpParameters responseParams = OAuth . decodeForm ( response . getContent ( ) ) ; if ( listener != null ) { listener . onResponse ( responseParams ) ; } String token = responseParams . getFirst ( OAuth . OAUTH_TOKEN ) ; String secret = responseParams . getFirst ( OAuth . OAUTH_TOKEN_SECRET ) ; responseParams . remove ( OAuth . OAUTH_TOKEN ) ; responseParams . remove ( OAuth . OAUTH_TOKEN_SECRET ) ; setResponseParameters ( responseParams ) ; if ( token == null || secret == null ) { throw new OAuthExpectationFailedException ( "Request token or token secret not set in server reply. " + "The service provider you use is probably buggy." ) ; } consumer . setTokenWithSecret ( token , secret ) ; } catch ( OAuthNotAuthorizedException e ) { throw e ; } catch ( OAuthExpectationFailedException e ) { throw e ; } catch ( Exception e ) { throw new OAuthCommunicationException ( e ) ; } finally { try { closeConnection ( request , response ) ; } catch ( Exception e ) { throw new OAuthCommunicationException ( e ) ; } }


signature:
public class GetActionsByEntityActivity { /** * / * ( non - Javadoc )
 * @ see com . socialize . demo . DemoActivity # executeDemo ( ) */
@ Override public void executeDemo ( String text ) { } }

implementation: ActionUtils . getActionsByEntity ( this , entity . getKey ( ) , 0 , PAGE_SIZE , new ActionListListener ( ) { @ Override public void onList ( ListResult < SocializeAction > result ) { handleSocializeResult ( result ) ; } @ Override public void onError ( SocializeException error ) { handleError ( GetActionsByEntityActivity . this , error ) ; } } ) ;


signature:
public class DefaultProfileSaver { /** * ( non - Javadoc )
 * @ see com . socialize . ui . profile . ProfileSaver # save ( android . content . Context , java . lang . String , android . graphics . Bitmap , com . socialize . listener . user . UserSaveListener ) */
@ Override public void save ( Context context , UserSettings profile , UserSaveListener listener ) { } }

implementation: UserUtils . saveUserSettings ( context , profile , listener ) ;


signature:
public class SocializeEntityLoaderUtils { /** * / * ( non - Javadoc )
 * @ see com . socialize . util . EntityLoaderUtils # initEntityLoader ( ) */
@ Override public SocializeEntityLoader initEntityLoader ( ) { } }

implementation: SocializeEntityLoader entityLoader = Socialize . getSocialize ( ) . getEntityLoader ( ) ; if ( entityLoader == null ) { String entityLoaderClassName = config . getProperty ( SocializeConfig . SOCIALIZE_ENTITY_LOADER ) ; if ( ! StringUtils . isEmpty ( entityLoaderClassName ) ) { try { if ( logger != null && logger . isDebugEnabled ( ) ) { logger . debug ( "Instantiating entity loader [" + entityLoader + "]" ) ; } Object loader = objectUtils . construct ( entityLoaderClassName ) ; if ( loader instanceof SocializeEntityLoader ) { entityLoader = ( SocializeEntityLoader ) loader ; Socialize . getSocialize ( ) . setEntityLoader ( entityLoader ) ; } else { if ( logger != null ) { logger . error ( "Entity loader [" + entityLoader + "] is not an instance of [" + SocializeEntityLoader . class . getName ( ) + "]" ) ; } } } catch ( SocializeException e ) { if ( logger != null ) { logger . error ( "Failed to instantiate entity loader [" + entityLoader + "]" , e ) ; } } } else { if ( logger != null ) { logger . warn ( "No entity loader specified in socialize.properties" ) ; } } } return entityLoader ;


signature:
public class SocialNetworkSignOutTask { /** * / * ( non - Javadoc )
 * @ see android . os . AsyncTask # doInBackground ( Params [ ] ) */
@ Override protected Void doInBackground ( Void ... args ) { } }

implementation: switch ( type ) { case FACEBOOK : FacebookUtils . unlink ( context . get ( ) ) ; break ; case TWITTER : TwitterUtils . unlink ( context . get ( ) ) ; break ; } return null ;


signature:
public class NotificationLaunchTask { /** * / * ( non - Javadoc )
 * @ see com . socialize . launcher . LaunchTask # execute ( android . content . Context , android . os . Bundle ) */
@ Override public void execute ( Context context , Bundle extras ) throws SocializeException { } }

implementation: if ( tasks != null ) { for ( LaunchTask task : tasks ) { try { task . execute ( context , extras ) ; } catch ( SocializeException e ) { if ( logger != null ) { logger . error ( "Error executing launcher task" , e ) ; } else { SocializeLogger . e ( e . getMessage ( ) , e ) ; } } } }


signature:
public class GetTokenActivity { /** * / * ( non - Javadoc )
 * @ see com . socialize . demo . DemoActivity # executeDemo ( ) */
@ Override public void executeDemo ( String text ) { } }

implementation: FacebookUtils . linkForRead ( this , new SocializeAuthListener ( ) { @ Override public void onError ( SocializeException error ) { handleError ( GetTokenActivity . this , error ) ; } @ Override public void onCancel ( ) { handleCancel ( ) ; } @ Override public void onAuthSuccess ( SocializeSession session ) { UserProviderCredentials userProviderCredentials = session . getUserProviderCredentials ( AuthProviderType . FACEBOOK ) ; handleResult ( userProviderCredentials . getAccessToken ( ) ) ; } @ Override public void onAuthFail ( SocializeException error ) { handleError ( GetTokenActivity . this , error ) ; } } ) ;


signature:
public class BaseView { /** * / * ( non - Javadoc )
 * @ see com . socialize . view . SocializeView # getActivity ( ) */
@ Override public Activity getActivity ( ) { } }

implementation: Context context = getContext ( ) ; if ( context instanceof Activity ) { return ( Activity ) context ; } return null ;


signature:
public class LinkifyCommentViewActionListener { /** * ( non - Javadoc )
 * @ see com . socialize . ui . comment . OnCommentViewActionListener # onAfterSetComment ( com . socialize . entity . Comment , com . socialize . ui . comment . CommentListItem ) */
@ Override public void onAfterSetComment ( Comment comment , CommentListItem item ) { } }

implementation: Linkify . addLinks ( item . getCommentText ( ) , mask ) ;


signature:
public class AddViewActivity { /** * / * ( non - Javadoc )
 * @ see com . socialize . demo . DemoActivity # executeDemo ( ) */
@ Override public void executeDemo ( String text ) { } }

implementation:
// usually the name parameter would be a human readable name ( i . e . not the same as the key ) .
ViewUtils . view ( this , entity , new ViewAddListener ( ) { @ Override public void onError ( SocializeException error ) { handleError ( AddViewActivity . this , error ) ; } @ Override public void onCreate ( View entity ) { handleSocializeResult ( entity ) ; } } ) ;


signature:
public class DefaultHttpClientFactory { /** * / * ( non - Javadoc )
 * @ see com . socialize . net . HttpClientFactory # init ( ) */
@ Override public void init ( SocializeConfig config ) throws SocializeException { } }

implementation: try { if ( logger != null && logger . isDebugEnabled ( ) ) { logger . debug ( "Initializing " + getClass ( ) . getSimpleName ( ) ) ; } params = new BasicHttpParams ( ) ; HttpProtocolParams . setVersion ( params , HttpVersion . HTTP_1_1 ) ; HttpProtocolParams . setContentCharset ( params , HTTP . UTF_8 ) ; HttpConnectionParams . setConnectionTimeout ( params , config . getIntProperty ( SocializeConfig . HTTP_CONNECTION_TIMEOUT , 10000 ) ) ; HttpConnectionParams . setSoTimeout ( params , config . getIntProperty ( SocializeConfig . HTTP_SOCKET_TIMEOUT , 10000 ) ) ; SchemeRegistry registry = new SchemeRegistry ( ) ; registry . register ( new Scheme ( "http" , PlainSocketFactory . getSocketFactory ( ) , 80 ) ) ; registry . register ( new Scheme ( "https" , SSLSocketFactory . getSocketFactory ( ) , 443 ) ) ; connectionManager = new ThreadSafeClientConnManager ( params , registry ) ; monitor = new IdleConnectionMonitorThread ( connectionManager ) ; monitor . setDaemon ( true ) ; monitor . start ( ) ; if ( logger != null && logger . isDebugEnabled ( ) ) { logger . debug ( "Initialized " + getClass ( ) . getSimpleName ( ) ) ; } destroyed = false ; } catch ( Exception e ) { throw new SocializeException ( e ) ; }


signature:
public class DefaultHttpClientFactory { /** * / * ( non - Javadoc )
 * @ see com . socialize . net . HttpClientFactory # destroy ( ) */
@ Override public void destroy ( ) { } }

implementation: if ( logger != null && logger . isDebugEnabled ( ) ) { logger . debug ( "Destroying " + getClass ( ) . getSimpleName ( ) ) ; } if ( monitor != null ) { monitor . shutdown ( ) ; } if ( connectionManager != null ) { connectionManager . shutdown ( ) ; } if ( logger != null && logger . isDebugEnabled ( ) ) { logger . debug ( "Destroyed " + getClass ( ) . getSimpleName ( ) ) ; } destroyed = true ;


signature:
public class DefaultHttpClientFactory { /** * / * ( non - Javadoc )
 * @ see com . socialize . net . HttpClientFactory # getClient ( ) */
@ Override public synchronized HttpClient getClient ( ) { } }

implementation: if ( client == null ) { if ( apacheHttpClientFactory != null ) { client = apacheHttpClientFactory . getBean ( connectionManager , params ) ; } else { client = new DefaultHttpClient ( connectionManager , params ) ; } } else { monitor . trigger ( ) ; } return client ;


signature:
public class SocializeCommentSystem { /** * / * ( non - Javadoc )
 * @ see com . socialize . api . action . CommentSystem # addComment ( com . socialize . api . SocializeSession , com . socialize . entity . Entity , java . lang . String , android . location . Location , com . socialize . networks . ShareOptions , com . socialize . listener . comment . CommentListener ) */
@ Override public void addComment ( SocializeSession session , Entity entity , String comment , CommentOptions commentOptions , CommentListener listener , SocialNetwork ... networks ) { } }

implementation: Comment c = new Comment ( ) ; c . setText ( comment ) ; c . setEntitySafe ( entity ) ; addComment ( session , c , commentOptions , listener , networks ) ;


signature:
public class SocializeCommentSystem { /** * / * ( non - Javadoc )
 * @ see com . socialize . api . action . CommentSystem # getCommentsByEntity ( com . socialize . api . SocializeSession , java . lang . String , com . socialize . listener . comment . CommentListener ) */
@ Override public void getCommentsByEntity ( SocializeSession session , String key , CommentListener listener ) { } }

implementation: listAsync ( session , ENDPOINT , key , listener ) ;


signature:
public class SocializeCommentSystem { /** * / * ( non - Javadoc )
 * @ see com . socialize . api . action . CommentSystem # getCommentsByEntity ( com . socialize . api . SocializeSession , java . lang . String , int , int , com . socialize . listener . comment . CommentListener ) */
@ Override public void getCommentsByEntity ( SocializeSession session , String key , int startIndex , int endIndex , CommentListener listener ) { } }

implementation: listAsync ( session , ENDPOINT , key , null , null , startIndex , endIndex , listener ) ;


signature:
public class SocializeCommentSystem { /** * ( non - Javadoc )
 * @ see com . socialize . api . action . comment . CommentSystem # getCommentsByApplication ( com . socialize . api . SocializeSession , int , int , com . socialize . listener . comment . CommentListener ) */
@ Override public void getCommentsByApplication ( SocializeSession session , int startIndex , int endIndex , CommentListener listener ) { } }

implementation: listAsync ( session , ENDPOINT , null , null , null , startIndex , endIndex , listener ) ;


signature:
public class SocializeCommentSystem { /** * / * ( non - Javadoc )
 * @ see com . socialize . api . action . CommentSystem # getCommentsByUser ( com . socialize . api . SocializeSession , long , com . socialize . listener . comment . CommentListener ) */
@ Override public void getCommentsByUser ( SocializeSession session , long userId , CommentListener listener ) { } }

implementation: String endpoint = "/user/" + userId + ENDPOINT ; listAsync ( session , endpoint , listener ) ;


signature:
public class SocializeCommentSystem { /** * / * ( non - Javadoc )
 * @ see com . socialize . api . action . CommentSystem # getCommentsById ( com . socialize . api . SocializeSession , com . socialize . listener . comment . CommentListener , int ) */
@ Override public void getCommentsById ( SocializeSession session , CommentListener listener , long ... ids ) { } }

implementation:
String [ ] strIds = new String [ ids . length ] ; for ( int i = 0 ; i < ids . length ; i ++ ) { strIds [ i ] = String . valueOf ( ids [ i ] ) ; } // No need for pagination here really
listAsync ( session , ENDPOINT , null , 0 , SocializeConfig . MAX_LIST_RESULTS , listener , strIds ) ;


signature:
public class SocializeCommentSystem { /** * / * ( non - Javadoc )
 * @ see com . socialize . api . action . CommentSystem # getComment ( com . socialize . api . SocializeSession , long , com . socialize . listener . comment . CommentListener ) */
@ Override public void getComment ( SocializeSession session , long id , CommentListener listener ) { } }

implementation: getAsync ( session , ENDPOINT , String . valueOf ( id ) , listener ) ;


signature:
public class SocializeUrlLauncher { /** * / * ( non - Javadoc )
 * @ see com . socialize . launcher . Launcher # launch ( android . app . Activity , android . os . Bundle ) */
@ Override public boolean launch ( final Activity context , Bundle data ) { } }

implementation: String url = data . getString ( Socialize . DIRECT_URL ) ; if ( ! StringUtils . isEmpty ( url ) ) { final DirectUrlWebView webView = directUrlWebViewFactory . getBean ( ) ; webView . setListener ( directUrlListener ) ; Dialog dialog = dialogFactory . build ( context , webView , true ) ; dialog . setOnCancelListener ( new OnCancelListener ( ) { @ Override public void onCancel ( DialogInterface dialog ) { handleCloseEvent ( webView , context ) ; } } ) ; dialog . setOnDismissListener ( new OnDismissListener ( ) { @ Override public void onDismiss ( DialogInterface dialog ) { handleCloseEvent ( webView , context ) ; } } ) ; dialog . setOnKeyListener ( new OnKeyListener ( ) { @ Override public boolean onKey ( DialogInterface dialog , int keyCode , KeyEvent event ) { if ( keyCode == KeyEvent . KEYCODE_BACK ) { if ( webView . canGoBack ( ) ) { webView . goBack ( ) ; return true ; } } return false ; } } ) ; boolean show = true ; if ( directUrlListener != null ) { show = directUrlListener . onBeforePageLoaded ( webView , url ) ; } if ( show ) { dialog . show ( ) ; webView . loadUrl ( url ) ; } return show ; } else { handleWarn ( "No url found under key [" + Socialize . DIRECT_URL + "]" ) ; } return false ;


signature:
public class UserUtils { /** * Saves the given user .
 * @ param context The current context .
 * @ param user The user to be saved .
 * @ param listener A listener to handle the result . */
public static void saveUserAsync ( Context context , User user , UserSaveListener listener ) { } }

implementation: proxy . saveUserAsync ( context , user , listener ) ;


signature:
public class UserUtils { /** * Retrieves a User based on the given ID .
 * @ param context The current context .
 * @ param id The id of the user .
 * @ param listener A listener to handle the GET . */
public static void getUser ( Context context , long id , UserGetListener listener ) { } }

implementation: proxy . getUser ( context , id , listener ) ;


signature:
public class UserUtils { /** * Shows the user profile UI for the given user .
 * @ param context The current context .
 * @ param user The user for whom the profile will be shown . */
public static void showUserProfile ( Activity context , User user ) { } }

implementation: proxy . showUserProfileView ( context , user , null , null ) ;


signature:
public class UserUtils { /** * Shows the user profile UI for the given user .
 * @ param context The current context .
 * @ param user The user for whom the profile will be shown .
 * @ param action The action ( comment / share / like ) that was performed . */
public static void showUserProfileWithAction ( Activity context , User user , SocializeAction action ) { } }

implementation: proxy . showUserProfileView ( context , user , action , null ) ;


signature:
public class UserUtils { /** * Shows the user profile UI for the given user .
 * @ param context The current context .
 * @ param user The user for whom the profile will be shown .
 * @ param action The action ( comment / share / like ) that was performed .
 * @ param onActionDetailViewListener A listener to handle UI view events . */
public static void showUserProfileWithAction ( Activity context , User user , SocializeAction action , OnActionDetailViewListener onActionDetailViewListener ) { } }

implementation: proxy . showUserProfileView ( context , user , action , onActionDetailViewListener ) ;


signature:
public class UserUtils { /** * Shows the settings UI for the current user .
 * @ param context The current context . */
public static void showUserSettings ( Activity context ) { } }

implementation: try { proxy . showUserSettingsView ( context , UserUtils . getCurrentUser ( context ) . getId ( ) ) ; } catch ( SocializeException e ) { SocializeLogger . e ( "Error displaying user settings" , e ) ; }


signature:
public class UserUtils { /** * Shows the settings UI for the current user .
 * @ param context The current context .
 * @ param requestCode ( Optional ) Set as the result on the UserSettings activity . */
public static void showUserSettingsForResult ( Activity context , int requestCode ) { } }

implementation: try { proxy . showUserSettingsViewForResult ( context , UserUtils . getCurrentUser ( context ) . getId ( ) , requestCode ) ; } catch ( SocializeException e ) { SocializeLogger . e ( "Error displaying user settings" , e ) ; }


signature:
public class UserUtils { /** * Saves the profile for the given user .
 * @ param context The current context .
 * @ param userSettings The user settings to be saved .
 * @ param listener A listener to handle the save . */
public static void saveUserSettings ( Context context , UserSettings userSettings , UserSaveListener listener ) { } }

implementation: proxy . saveUserSettings ( context , userSettings , listener ) ;


signature:
public class ActionDelegateLauncher { /** * / * ( non - Javadoc )
 * @ see com . socialize . launcher . Launcher # launch ( android . app . Activity , android . os . Bundle ) */
@ Override public boolean launch ( Activity context , Bundle data ) { } }

implementation: return getLauncher ( context ) . launch ( context , data ) ;


signature:
public class ActionDelegateLauncher { /** * / * ( non - Javadoc )
 * @ see com . socialize . launcher . Launcher # onResult ( android . app . Activity , int , int , android . content . Intent , android . content . Intent ) */
@ Override public void onResult ( Activity context , int requestCode , int resultCode , Intent returnedIntent , Intent originalIntent ) { } }

implementation: getLauncher ( context ) . onResult ( context , requestCode , resultCode , returnedIntent , originalIntent ) ;


signature:
public class User { /** * Sets the auto post preferences for the user .
 * @ param networks
 * @ return true if the new settings differed from the old ones . */
@ Deprecated public boolean setAutoPostPreferences ( SocialNetwork ... networks ) { } }

implementation: boolean tw = isAutoPostToTwitter ( ) ; boolean fb = isAutoPostToFacebook ( ) ; setAutoPostToFacebook ( false ) ; setAutoPostToTwitter ( false ) ; if ( networks != null ) { for ( SocialNetwork network : networks ) { if ( network . equals ( SocialNetwork . FACEBOOK ) ) { setAutoPostToFacebook ( true ) ; } else if ( network . equals ( SocialNetwork . TWITTER ) ) { setAutoPostToTwitter ( true ) ; } } } return tw != isAutoPostToTwitter ( ) || fb != isAutoPostToFacebook ( ) ;


signature:
public class TwitterAuthProviderInfo { /** * / * ( non - Javadoc )
 * @ see com . socialize . auth . AuthProviderInfo # validate ( ) */
@ Override public void validate ( ) throws SocializeException { } }

implementation: if ( StringUtils . isEmpty ( consumerKey ) ) { throw new SocializeException ( "No twitter consumer key found." ) ; } if ( StringUtils . isEmpty ( consumerSecret ) ) { throw new SocializeException ( "No twitter consumer secret found." ) ; }


signature:
public class TwitterAuthProviderInfo { /** * ( non - Javadoc )
 * @ see com . socialize . auth . AuthProviderInfo # merge ( com . socialize . auth . AuthProviderInfo ) */
@ Override public boolean merge ( AuthProviderInfo info ) { } }

implementation: if ( info instanceof TwitterAuthProviderInfo ) { TwitterAuthProviderInfo that = ( TwitterAuthProviderInfo ) info ; this . consumerKey = that . consumerKey ; this . consumerSecret = that . consumerSecret ; return true ; } return false ;


signature:
public class SocializeEntityUtils { /** * / * ( non - Javadoc )
 * @ see com . socialize . api . action . entity . EntityUtilsProxy # saveEntity ( android . app . Activity , com . socialize . entity . Entity , com . socialize . listener . entity . EntityAddListener ) */
@ Override public void saveEntity ( Activity context , Entity e , EntityAddListener listener ) { } }

implementation: entitySystem . addEntity ( Socialize . getSocialize ( ) . getSession ( ) , e , listener ) ;


signature:
public class SocializeEntityUtils { /** * / * ( non - Javadoc )
 * @ see com . socialize . api . action . entity . EntityUtilsProxy # getEntity ( android . app . Activity , java . lang . String , com . socialize . listener . entity . EntityGetListener ) */
@ Override public void getEntity ( Activity context , String key , EntityGetListener listener ) { } }

implementation: entitySystem . getEntity ( Socialize . getSocialize ( ) . getSession ( ) , key , listener ) ;


signature:
public class SocializeEntityUtils { /** * / * ( non - Javadoc )
 * @ see com . socialize . api . action . entity . EntityUtilsProxy # getEntities ( android . app . Activity , int , int , com . socialize . listener . entity . EntityListListener ) */
@ Override public void getEntities ( Activity context , int start , int end , SortOrder sortOrder , EntityListListener listener ) { } }

implementation: entitySystem . getEntities ( Socialize . getSocialize ( ) . getSession ( ) , start , end , sortOrder , listener ) ;


signature:
public class SocializeEntityUtils { /** * / * ( non - Javadoc )
 * @ see com . socialize . api . action . entity . EntityUtilsProxy # getEntities ( android . app . Activity , int , int , com . socialize . listener . entity . EntityListListener , java . lang . String [ ] ) */
@ Override public void getEntities ( Activity context , SortOrder sortOrder , EntityListListener listener , String ... keys ) { } }

implementation: entitySystem . getEntities ( Socialize . getSocialize ( ) . getSession ( ) , sortOrder , listener , keys ) ;


signature:
public class SmartAlertSnippets { /** * ( non - Javadoc )
 * @ see android . content . BroadcastReceiver # onReceive ( android . content . Context , android . content . Intent ) */
@ Override public void onReceive ( Context context , Intent intent ) { } }

implementation:
if ( ! SmartAlertUtils . handleBroadcastIntent ( context , intent ) ) { // Message was NOT handled by Socialize .
}


signature:
public class FacebookService { /** * Authenticates with default permissions and Single Sign On . */
@ Deprecated public void authenticate ( Activity context ) { } }

implementation: authenticate ( context , FacebookFacade . DEFAULT_PERMISSIONS , true , false ) ;


signature:
public class FacebookService { /** * Authenticates with Single Sign On . */
public void authenticateForRead ( Activity context , boolean sso , String [ ] permissions ) { } }

implementation: authenticate ( context , permissions , sso , true ) ;


signature:
public class GetLikesByEntityActivity { /** * / * ( non - Javadoc )
 * @ see com . socialize . demo . DemoActivity # executeDemo ( ) */
@ Override public void executeDemo ( String text ) { } }

implementation: LikeUtils . getLikesByEntity ( this , entity . getKey ( ) , 0 , PAGE_SIZE , new LikeListListener ( ) { @ Override public void onList ( List < Like > items , int totalSize ) { handleSocializeResult ( items ) ; } @ Override public void onError ( SocializeException error ) { handleError ( GetLikesByEntityActivity . this , error ) ; } } ) ;


signature:
public class Socialize { /** * Called by containing Activities in their onPause ( ) method . */
public static void onPause ( Activity context ) { } }

implementation: instance . onPause ( context ) ; if ( socializeLifecycleListener != null ) { socializeLifecycleListener . onPause ( context ) ; }


signature:
public class Socialize { /** * Called by containing Activities in their onResume ( ) method . */
public static void onResume ( Activity context ) { } }

implementation: instance . onResume ( context ) ; if ( socializeLifecycleListener != null ) { socializeLifecycleListener . onResume ( context ) ; }


signature:
public class Socialize { /** * Called by containing Activities in their onCreate ( ) method . */
public static void onCreate ( Activity context , Bundle savedInstanceState ) { } }

implementation: instance . onCreate ( context , savedInstanceState ) ; if ( socializeLifecycleListener != null ) { socializeLifecycleListener . onCreate ( context , savedInstanceState ) ; }


signature:
public class Socialize { /** * Called by containing Activities in their onDestroy ( ) method . */
public static void onDestroy ( Activity context ) { } }

implementation: instance . onDestroy ( context ) ; if ( socializeLifecycleListener != null ) { socializeLifecycleListener . onDestroy ( context ) ; }


signature:
public class Socialize { /** * Called by containing Activities in their onStart ( ) method . */
public static void onStart ( Activity context ) { } }

implementation: instance . onStart ( context ) ; if ( socializeLifecycleListener != null ) { socializeLifecycleListener . onStart ( context ) ; }


signature:
public class Socialize { /** * Called by containing Activities in their onStop ( ) method . */
public static void onStop ( Activity context ) { } }

implementation: instance . onStop ( context ) ; if ( socializeLifecycleListener != null ) { socializeLifecycleListener . onStop ( context ) ; }


signature:
public class ReflectionUtils { /** * Gets the value of the given static field from the given class .
 * @ param fieldName
 * @ param clazz
 * @ return
 * @ throws Exception */
@ SuppressWarnings ( "unchecked" ) public static final < E extends Object > E getStaticField ( String fieldName , Class < ? > clazz ) throws Exception { } }

implementation: try { Field field = clazz . getField ( fieldName ) ; if ( field != null ) { return ( E ) field . get ( null ) ; } } catch ( Exception e ) { throw e ; } return null ;


signature:
public class ReflectionUtils { /** * Returns the name of the static field that corresponds to the given value
 * @ param value
 * @ param clazz
 * @ return
 * @ throws Exception */
public static final String getStaticFieldName ( Object value , Class < ? > clazz ) throws Exception { } }

implementation: Field [ ] fields = clazz . getFields ( ) ; for ( Field field : fields ) { Object fVal = field . get ( null ) ; if ( fVal != null && fVal . equals ( value ) ) { return field . getName ( ) ; } } return null ;


signature:
public class GetSharesByIDActivity { /** * / * ( non - Javadoc )
 * @ see com . socialize . demo . DemoActivity # executeDemo ( ) */
@ Override public void executeDemo ( String text ) { } }

implementation:
// We are going to list shares just so we can get the ID for a single share
// Usually you would NOT do this as you would usually already have an ID ( e . g . from a click on a list view )
ShareUtils . getSharesByEntity ( this , entity . getKey ( ) , 0 , 1 , new ShareListListener ( ) { @ Override public void onList ( ListResult < Share > shares ) { // Use the id from the first share
if ( shares . getTotalCount ( ) > 0 ) { ShareUtils . getShare ( GetSharesByIDActivity . this , new ShareGetListener ( ) { @ Override public void onGet ( Share share ) { handleSocializeResult ( share ) ; } @ Override public void onError ( SocializeException error ) { handleError ( GetSharesByIDActivity . this , error ) ; } } , shares . getItems ( ) . get ( 0 ) . getId ( ) ) ; } } @ Override public void onError ( SocializeException error ) { handleError ( GetSharesByIDActivity . this , error ) ; } } ) ;


signature:
public class HttpParameters { /** * Convenience method to add a single value for the parameter specified by
 * ' key ' .
 * @ param key
 * the parameter name
 * @ param value
 * the parameter value
 * @ return the value */
public String put ( String key , String value ) { } }

implementation: return put ( key , value , false ) ;


signature:
public class HttpParameters { /** * Convenience method to add a single value for the parameter specified by
 * ' key ' .
 * @ param key
 * the parameter name
 * @ param value
 * the parameter value
 * @ param percentEncode
 * whether key and value should be percent encoded before being
 * inserted into the map
 * @ return the value */
public String put ( String key , String value , boolean percentEncode ) { } }

implementation: SortedSet < String > values = wrappedMap . get ( key ) ; if ( values == null ) { values = new TreeSet < String > ( ) ; wrappedMap . put ( percentEncode ? OAuth . percentEncode ( key ) : key , values ) ; } if ( value != null ) { value = percentEncode ? OAuth . percentEncode ( value ) : value ; values . add ( value ) ; } return value ;


signature:
public class HttpParameters { /** * Convenience method to merge a Map < String , List < String > > .
 * @ param m
 * the map */
public void putMap ( Map < String , List < String > > m ) { } }

implementation: for ( String key : m . keySet ( ) ) { SortedSet < String > vals = get ( key ) ; if ( vals == null ) { vals = new TreeSet < String > ( ) ; put ( key , vals ) ; } vals . addAll ( m . get ( key ) ) ; }


signature:
public class HttpParameters { /** * Returns the first value from the set of all values for the given
 * parameter name . If the key passed to this method contains special
 * characters , you MUST first percent encode it using
 * { @ link OAuth # percentEncode ( String ) } , otherwise the lookup will fail
 * ( that ' s because upon storing values in this map , keys get
 * percent - encoded ) .
 * @ param key
 * the parameter name ( must be percent encoded if it contains unsafe
 * characters ! )
 * @ param percentDecode
 * whether the value being retrieved should be percent decoded
 * @ return the first value found for this parameter */
public String getFirst ( Object key , boolean percentDecode ) { } }

implementation: SortedSet < String > values = wrappedMap . get ( key ) ; if ( values == null || values . isEmpty ( ) ) { return null ; } String value = values . first ( ) ; return percentDecode ? OAuth . percentDecode ( value ) : value ;


signature:
public class HttpParameters { /** * Concatenates all values for the given key to a list of key / value pairs
 * suitable for use in a URL query string .
 * @ param key
 * the parameter name
 * @ return the query string */
public String getAsQueryString ( Object key ) { } }

implementation: StringBuilder sb = new StringBuilder ( ) ; key = OAuth . percentEncode ( ( String ) key ) ; Set < String > values = wrappedMap . get ( key ) ; if ( values == null ) { return key + "=" ; } Iterator < String > iter = values . iterator ( ) ; while ( iter . hasNext ( ) ) { sb . append ( key + "=" + iter . next ( ) ) ; if ( iter . hasNext ( ) ) { sb . append ( "&" ) ; } } return sb . toString ( ) ;


signature:
public class NotificationsConfigLaunchTask { /** * / * ( non - Javadoc )
 * @ see com . socialize . launcher . SocializeLaunchTask # execute ( android . content . Context ) */
@ Override public void execute ( Context context , Bundle extras ) throws SocializeException { } }

implementation: config . setEntityLoaderCheckEnabled ( false ) ;


signature:
public class Key { /** * ( non - Javadoc )
 * @ see java . lang . Comparable # compareTo ( java . lang . Object ) */
public int compareTo ( Key < K > o ) { } }

implementation: if ( o != null ) { if ( o . time > time ) { return - 1 ; } else if ( o . time < time ) { return 1 ; } else if ( o . key != null ) { return o . key . compareTo ( key ) ; } else { return 0 ; } } return 0 ;


signature:
public class ShareClickListener { /** * / * ( non - Javadoc )
 * @ see android . view . View . OnClickListener # onClick ( android . view . View ) */
@ Override public void onClick ( View view ) { } }

implementation: final ProgressDialog dialog = progressDialogFactory . show ( view . getContext ( ) , I18NConstants . DLG_SHARE , I18NConstants . DLG_SHARE_MESSAGE + " " + shareType . getDisplayName ( ) + "..." ) ; ShareOptions shareOptions = ShareUtils . getUserShareOptions ( context ) ; shareOptions . setText ( provider . getShareText ( ) ) ; ShareUtils . registerShare ( context , entity , shareOptions , new ShareAddListener ( ) { @ Override public void onError ( SocializeException error ) { dialog . dismiss ( ) ; alertDialogFactory . showToast ( context , "Share failed.  Please try again" ) ; } @ Override public void onCreate ( Share share ) { dialog . dismiss ( ) ; if ( onActionBarEventListener != null ) { onActionBarEventListener . onPostShare ( actionBarView , share ) ; } } } , SocialNetwork . valueOf ( shareType ) ) ;


signature:
public class GetActionsByUserActivity { /** * / * ( non - Javadoc )
 * @ see com . socialize . demo . DemoActivity # executeDemo ( ) */
@ Override public void executeDemo ( String text ) { } }

implementation: try { ActionUtils . getActionsByUser ( this , UserUtils . getCurrentUser ( this ) . getId ( ) , 0 , PAGE_SIZE , new ActionListListener ( ) { @ Override public void onList ( ListResult < SocializeAction > result ) { handleSocializeResult ( result ) ; } @ Override public void onError ( SocializeException error ) { handleError ( GetActionsByUserActivity . this , error ) ; } } ) ; } catch ( SocializeException e ) { e . printStackTrace ( ) ; }


signature:
public class CustomLocalizationService { /** * / * ( non - Javadoc )
 * @ see com . socialize . i18n . LocalizationService # getString ( java . lang . String ) */
@ Override public String getString ( String key ) { } }

implementation:
if ( key == null ) return "" ; String str = strings . get ( key ) ; if ( StringUtils . isEmpty ( str ) ) { int resId = resources . getIdentifier ( key , "string" , packageName ) ; if ( resId > 0 ) { try { str = resources . getString ( resId ) ; } catch ( Exception e ) { // Shouldn ' t happen
e . printStackTrace ( ) ; } } if ( str == null ) { // Get default
str = defaultLocalizationService . getString ( key ) ; } if ( str != null ) { strings . put ( key , str ) ; } else { str = key ; } } return str ;


signature:
public class GetCommentsByUserActivity { /** * / * ( non - Javadoc )
 * @ see com . socialize . demo . DemoActivity # executeDemo ( ) */
@ Override public void executeDemo ( String text ) { } }

implementation: try { CommentUtils . getCommentsByUser ( this , UserUtils . getCurrentUser ( this ) , 0 , PAGE_SIZE , new CommentListListener ( ) { @ Override public void onList ( ListResult < Comment > comments ) { handleSocializeResult ( comments ) ; } @ Override public void onError ( SocializeException error ) { handleError ( GetCommentsByUserActivity . this , error ) ; } } ) ; } catch ( SocializeException e ) { e . printStackTrace ( ) ; }


signature:
public class SocializeC2DMCallback { /** * / * ( non - Javadoc )
 * @ see com . socialize . notifications . NotificationSystem # sendNotification ( android . os . Bundle ) */
@ Override public void onMessage ( final Context context , final Bundle data ) { } }

implementation:
// DON ' T Use Socialize instance here , we are using a different container !
try { // This should be synchronous . We don ' t want to launch an async task off the main UI thread .
SocializeSession session = userSystem . authenticateSynchronous ( context , config . getProperty ( SocializeConfig . SOCIALIZE_CONSUMER_KEY ) , config . getProperty ( SocializeConfig . SOCIALIZE_CONSUMER_SECRET ) ) ; handleNotification ( context , data , session ) ; } catch ( SocializeException e ) { handleError ( "Failed to authenticate user for notification receipt" , e ) ; }


signature:
public class GetPermissionsActivity { /** * / * ( non - Javadoc )
 * @ see com . socialize . demo . DemoActivity # executeDemo ( ) */
@ Override public void executeDemo ( String text ) { } }

implementation: String token = FacebookUtils . getAccessToken ( this ) ; if ( ! StringUtils . isEmpty ( token ) ) { FacebookUtils . getCurrentPermissions ( this , token , new OnPermissionResult ( ) { @ Override public void onError ( SocializeException error ) { handleError ( GetPermissionsActivity . this , error ) ; } @ Override public void onSuccess ( String [ ] permissions ) { handleResults ( Arrays . asList ( permissions ) ) ; } } ) ; } else { handleError ( this , new SocializeException ( "Not signed into Facebook" ) ) ; }


signature:
public class SocializeLikeUtils { /** * ( non - Javadoc )
 * @ see com . socialize . api . action . like . LikeUtilsProxy # like ( android . app . Activity , com . socialize . entity . Entity , com . socialize . listener . like . LikeAddListener ) */
@ Override public void like ( Activity context , final Entity entity , final LikeAddListener listener ) { } }

implementation: like ( context , entity , getUserLikeOptions ( context ) , listener ) ;


signature:
public class SocializeLikeUtils { /** * ( non - Javadoc )
 * @ see com . socialize . api . action . like . LikeUtilsProxy # unlike ( android . app . Activity , com . socialize . entity . Entity , com . socialize . listener . like . LikeDeleteListener ) */
@ Override public void unlike ( Activity context , String entityKey , final LikeDeleteListener listener ) { } }

implementation:
final SocializeSession session = getSocialize ( ) . getSession ( ) ; // Get the like based on the key
likeSystem . getLike ( session , entityKey , new LikeGetListener ( ) { @ Override public void onGet ( Like entity ) { if ( entity != null ) { likeSystem . deleteLike ( session , entity . getId ( ) , listener ) ; } else { if ( listener != null ) { listener . onDelete ( ) ; } } } @ Override public void onError ( SocializeException error ) { if ( error instanceof SocializeApiError ) { if ( ( ( SocializeApiError ) error ) . getResultCode ( ) == 404 ) { if ( listener != null ) { listener . onDelete ( ) ; } return ; } } if ( listener != null ) { listener . onError ( error ) ; } } } ) ;


signature:
public class SocializeLikeUtils { /** * ( non - Javadoc )
 * @ see com . socialize . api . action . like . LikeUtilsProxy # getLike ( android . app . Activity , com . socialize . entity . Entity , com . socialize . listener . like . LikeGetListener ) */
@ Override public void getLike ( Activity context , String entityKey , LikeGetListener listener ) { } }

implementation: final SocializeSession session = getSocialize ( ) . getSession ( ) ; likeSystem . getLike ( session , entityKey , listener ) ;


signature:
public class SocializeLikeUtils { /** * ( non - Javadoc )
 * @ see com . socialize . api . action . like . LikeUtilsProxy # getLike ( android . app . Activity , long , com . socialize . listener . like . LikeGetListener ) */
@ Override public void getLike ( Activity context , long id , LikeGetListener listener ) { } }

implementation: final SocializeSession session = getSocialize ( ) . getSession ( ) ; likeSystem . getLike ( session , id , listener ) ;


signature:
public class SocializeLikeUtils { /** * ( non - Javadoc )
 * @ see com . socialize . api . action . like . LikeUtilsProxy # getLikesByUser ( android . app . Activity , com . socialize . entity . User , int , int , com . socialize . listener . like . LikeListListener ) */
@ Override public void getLikesByUser ( Activity context , User user , int start , int end , LikeListListener listener ) { } }

implementation: final SocializeSession session = getSocialize ( ) . getSession ( ) ; likeSystem . getLikesByUser ( session , user . getId ( ) , start , end , listener ) ;


signature:
public class SocializeLikeUtils { /** * ( non - Javadoc )
 * @ see com . socialize . api . action . like . LikeUtilsProxy # getLikesByEntity ( android . app . Activity , com . socialize . entity . Entity , int , int , com . socialize . listener . like . LikeListListener ) */
@ Override public void getLikesByEntity ( Activity context , String entityKey , int start , int end , LikeListListener listener ) { } }

implementation: likeSystem . getLikesByEntity ( getSocialize ( ) . getSession ( ) , entityKey , start , end , listener ) ;


signature:
public class SocializeLikeUtils { /** * ( non - Javadoc )
 * @ see com . socialize . api . action . like . LikeUtilsProxy # getLikesByApplication ( android . app . Activity , int , int , com . socialize . listener . like . LikeListListener ) */
@ Override public void getLikesByApplication ( Activity context , int start , int end , LikeListListener listener ) { } }

implementation: likeSystem . getLikesByApplication ( getSocialize ( ) . getSession ( ) , start , end , listener ) ;


signature:
public class FacebookCell { /** * / * ( non - Javadoc )
 * @ see com . socialize . ui . view . ClickableSectionCell # makeImage ( ) */
@ Override protected ImageView makeImage ( ) { } }

implementation: if ( drawables != null ) { setImageOn ( drawables . getDrawable ( "icon_facebook.png" ) ) ; setImageOff ( drawables . getDrawable ( "icon_facebook_disabled.png" ) ) ; } return new ImageView ( getContext ( ) ) ;


signature:
public class AddCommentWithoutShareActivity { /** * / * ( non - Javadoc )
 * @ see com . socialize . demo . DemoActivity # executeDemo ( ) */
@ Override public void executeDemo ( String text ) { } }

implementation: CommentOptions options = CommentUtils . getUserCommentOptions ( this ) ; options . setShowAuthDialog ( false ) ; options . setShowShareDialog ( false ) ; CommentUtils . addComment ( this , entity , text , options , new CommentAddListener ( ) { @ Override public void onError ( SocializeException error ) { handleError ( AddCommentWithoutShareActivity . this , error ) ; } @ Override public void onCreate ( Comment comment ) { handleSocializeResult ( comment ) ; } @ Override public void onCancel ( ) { handleCancel ( ) ; } } ) ;


signature:
public class SmartAlertUtils { /** * Handles a GCM message . Returns true ONLY if this message was intended for Socialize .
 * @ param context
 * @ param intent
 * @ return */
public static boolean onMessage ( Context context , Intent intent ) { } }

implementation: assertInitialized ( context ) ; Bundle messageData = intent . getExtras ( ) ; if ( messageData != null ) { String source = messageData . getString ( C2DMCallback . SOURCE_KEY ) ; if ( source != null && source . trim ( ) . equalsIgnoreCase ( C2DMCallback . SOURCE_SOCIALIZE ) ) { handler . onMessage ( context , intent ) ; return true ; } } return false ;


signature:
public class SmartAlertUtils { /** * Handles a broadcast intent received by a Broadcast Receiver on Android .
 * Call this method if you already have a broadcast receiver defined but want to also utilize Socialize SmartAlerts .
 * @ param context The current context .
 * @ param intent The broadcast intent provided by Android .
 * @ return Returns true if Socialize handled the intent . This indicates the intent was designed to be handled by Socialize and you do not need to handle it yourself . */
public static boolean handleBroadcastIntent ( Context context , Intent intent ) { } }

implementation: return Socialize . getSocialize ( ) . handleBroadcastIntent ( context , intent ) ;


signature:
public class EntityLauncher { /** * / * ( non - Javadoc )
 * @ see com . socialize . launcher . Launcher # launch ( android . app . Activity , android . os . Bundle ) */
@ Override public boolean launch ( final Activity context , Bundle data ) { } }

implementation: if ( entityLoaderUtils != null ) { final SocializeEntityLoader entityLoader = entityLoaderUtils . initEntityLoader ( ) ; if ( entityLoader != null ) { Object idObj = data . get ( Socialize . ENTITY_ID ) ; if ( idObj != null ) { long id = Long . parseLong ( idObj . toString ( ) ) ; try { SocializeSession session = notificationAuthenticator . authenticate ( context ) ; Entity entity = entitySystem . getEntitySynchronous ( session , id ) ; return loadEntity ( context , entityLoader , entity ) ; } catch ( Exception e ) { handleError ( "Failed to load entity" , e ) ; } } else { handleWarn ( "No entity id found.  Entity based notification cannot be handled" ) ; } } else { handleWarn ( "No entity loader found.  Entity based notification cannot be handled" ) ; } } return false ;


signature:
public class NotificationOpenEventTask { /** * / * ( non - Javadoc )
 * @ see com . socialize . launcher . LaunchTask # execute ( android . content . Context , android . os . Bundle ) */
@ Override public void execute ( Context context , Bundle extras ) throws SocializeException { } }

implementation: try { if ( logger != null && logger . isDebugEnabled ( ) ) { logger . debug ( "Recording notification open event..." ) ; } final SocializeEvent event = new SocializeEvent ( ) ; event . setBucket ( "NOTIFICATION_OPEN" ) ; String json = extras . getString ( C2DMCallback . MESSAGE_KEY ) ; JSONObject obj = new JSONObject ( json ) ; event . setData ( obj ) ; notificationAuthenticator . authenticateAsync ( context , new SocializeAuthListener ( ) { @ Override public void onError ( SocializeException error ) { logError ( error ) ; } @ Override public void onCancel ( ) { } @ Override public void onAuthSuccess ( SocializeSession session ) { eventSystem . addEvent ( session , event , new EventListener ( ) { @ Override public void onError ( SocializeException error ) { logError ( error ) ; } @ Override public void onPost ( ) { if ( logger != null && logger . isDebugEnabled ( ) ) { logger . debug ( "Notification open event recorded." ) ; } } } ) ; } @ Override public void onAuthFail ( SocializeException error ) { logError ( error ) ; } } ) ; } catch ( Exception e ) { throw SocializeException . wrap ( e ) ; }


signature:
public class Base64Utils { /** * Encodes a byte array into Base64 notation .
 * @ param source The data to convert
 * @ param off Offset in array where conversion should begin
 * @ param len Length of data to convert
 * @ param alphabet is the encoding alphabet
 * @ param maxLineLength maximum length of one line .
 * @ return the BASE64 - encoded byte array */
public byte [ ] encode ( byte [ ] source , int off , int len , byte [ ] alphabet , int maxLineLength ) { } }

implementation:
int lenDiv3 = ( len + 2 ) / 3 ; // ceil ( len / 3)
int len43 = lenDiv3 * 4 ; byte [ ] outBuff = new byte [ len43 // Main 4:3
+ ( len43 / maxLineLength ) ] ; // New lines
int d = 0 ; int e = 0 ; int len2 = len - 2 ; int lineLength = 0 ; for ( ; d < len2 ; d += 3 , e += 4 ) { // The following block of code is the same as
// encode3to4 ( source , d + off , 3 , outBuff , e , alphabet ) ;
// but inlined for faster encoding ( ~ 20 % improvement )
int inBuff = ( ( source [ d + off ] << 24 ) >>> 8 ) | ( ( source [ d + 1 + off ] << 24 ) >>> 16 ) | ( ( source [ d + 2 + off ] << 24 ) >>> 24 ) ; outBuff [ e ] = alphabet [ ( inBuff >>> 18 ) ] ; outBuff [ e + 1 ] = alphabet [ ( inBuff >>> 12 ) & 0x3f ] ; outBuff [ e + 2 ] = alphabet [ ( inBuff >>> 6 ) & 0x3f ] ; outBuff [ e + 3 ] = alphabet [ ( inBuff ) & 0x3f ] ; lineLength += 4 ; if ( lineLength == maxLineLength ) { outBuff [ e + 4 ] = NEW_LINE ; e ++ ; lineLength = 0 ; } // end if : end of line
} // end for : each piece of array
if ( d < len ) { encode3to4 ( source , d + off , len - d , outBuff , e , alphabet ) ; lineLength += 4 ; if ( lineLength == maxLineLength ) { // Add a last newline
outBuff [ e + 4 ] = NEW_LINE ; e ++ ; } e += 4 ; } assert ( e == outBuff . length ) ; return outBuff ;


signature:
public class Base64Utils { /** * Decodes four bytes from array < var > source < / var >
 * and writes the resulting bytes ( up to three of them )
 * to < var > destination < / var > .
 * The source and destination arrays can be manipulated
 * anywhere along their length by specifying
 * < var > srcOffset < / var > and < var > destOffset < / var > .
 * This method does not check to make sure your arrays
 * are large enough to accommodate < var > srcOffset < / var > + 4 for
 * the < var > source < / var > array or < var > destOffset < / var > + 3 for
 * the < var > destination < / var > array .
 * This method returns the actual number of bytes that
 * were converted from the Base64 encoding .
 * @ param source the array to convert
 * @ param srcOffset the index where conversion begins
 * @ param destination the array to hold the conversion
 * @ param destOffset the index where output will be put
 * @ param decodabet the decodabet for decoding Base64 content
 * @ return the number of decoded bytes converted
 * @ since 1.3 */
private int decode4to3 ( byte [ ] source , int srcOffset , byte [ ] destination , int destOffset , byte [ ] decodabet ) { } }

implementation:
// Example : Dk = =
if ( source [ srcOffset + 2 ] == EQUALS_SIGN ) { int outBuff = ( ( decodabet [ source [ srcOffset ] ] << 24 ) >>> 6 ) | ( ( decodabet [ source [ srcOffset + 1 ] ] << 24 ) >>> 12 ) ; destination [ destOffset ] = ( byte ) ( outBuff >>> 16 ) ; return 1 ; } else if ( source [ srcOffset + 3 ] == EQUALS_SIGN ) { // Example : DkL =
int outBuff = ( ( decodabet [ source [ srcOffset ] ] << 24 ) >>> 6 ) | ( ( decodabet [ source [ srcOffset + 1 ] ] << 24 ) >>> 12 ) | ( ( decodabet [ source [ srcOffset + 2 ] ] << 24 ) >>> 18 ) ; destination [ destOffset ] = ( byte ) ( outBuff >>> 16 ) ; destination [ destOffset + 1 ] = ( byte ) ( outBuff >>> 8 ) ; return 2 ; } else { // Example : DkLE
int outBuff = ( ( decodabet [ source [ srcOffset ] ] << 24 ) >>> 6 ) | ( ( decodabet [ source [ srcOffset + 1 ] ] << 24 ) >>> 12 ) | ( ( decodabet [ source [ srcOffset + 2 ] ] << 24 ) >>> 18 ) | ( ( decodabet [ source [ srcOffset + 3 ] ] << 24 ) >>> 24 ) ; destination [ destOffset ] = ( byte ) ( outBuff >> 16 ) ; destination [ destOffset + 1 ] = ( byte ) ( outBuff >> 8 ) ; destination [ destOffset + 2 ] = ( byte ) ( outBuff ) ; return 3 ; }


signature:
public class Base64Utils { /** * Decodes data from web safe Base64 notation .
 * Web safe encoding uses ' - ' instead of ' + ' , ' _ ' instead of ' / '
 * @ param s the string to decode ( decoded in default encoding )
 * @ return the decoded data */
public byte [ ] decodeWebSafe ( String s ) throws Base64DecoderException { } }

implementation: byte [ ] bytes = s . getBytes ( ) ; return decodeWebSafe ( bytes , 0 , bytes . length ) ;


signature:
public class Base64Utils { /** * Decodes Base64 content using the supplied decodabet and returns
 * the decoded byte array .
 * @ param source The Base64 encoded data
 * @ param off The offset of where to begin decoding
 * @ param len The length of characters to decode
 * @ param decodabet the decodabet for decoding Base64 content
 * @ return decoded data */
public byte [ ] decode ( byte [ ] source , int off , int len , byte [ ] decodabet ) throws Base64DecoderException { } }

implementation:
int len34 = len * 3 / 4 ; byte [ ] outBuff = new byte [ 2 + len34 ] ; // Upper limit on size of output
int outBuffPosn = 0 ; byte [ ] b4 = new byte [ 4 ] ; int b4Posn = 0 ; int i = 0 ; byte sbiCrop = 0 ; byte sbiDecode = 0 ; for ( i = 0 ; i < len ; i ++ ) { sbiCrop = ( byte ) ( source [ i + off ] & 0x7f ) ; // Only the low seven bits
sbiDecode = decodabet [ sbiCrop ] ; if ( sbiDecode >= WHITE_SPACE_ENC ) { // White space Equals sign or better
if ( sbiDecode >= EQUALS_SIGN_ENC ) { // An equals sign ( for padding ) must not occur at position 0 or 1
// and must be the last byte [ s ] in the encoded value
if ( sbiCrop == EQUALS_SIGN ) { int bytesLeft = len - i ; byte lastByte = ( byte ) ( source [ len - 1 + off ] & 0x7f ) ; if ( b4Posn == 0 || b4Posn == 1 ) { throw new Base64DecoderException ( "invalid padding byte '=' at byte offset " + i ) ; } else if ( ( b4Posn == 3 && bytesLeft > 2 ) || ( b4Posn == 4 && bytesLeft > 1 ) ) { throw new Base64DecoderException ( "padding byte '=' falsely signals end of encoded value " + "at offset " + i ) ; } else if ( lastByte != EQUALS_SIGN && lastByte != NEW_LINE ) { throw new Base64DecoderException ( "encoded value has invalid trailing byte" ) ; } break ; } b4 [ b4Posn ++ ] = sbiCrop ; if ( b4Posn == 4 ) { outBuffPosn += decode4to3 ( b4 , 0 , outBuff , outBuffPosn , decodabet ) ; b4Posn = 0 ; } } } else { throw new Base64DecoderException ( "Bad Base64 input character at " + i + ": " + source [ i + off ] + "(decimal)" ) ; } } // Because web safe encoding allows non padding base64 encodes , we
// need to pad the rest of the b4 buffer with equal signs when
// b4Posn ! = 0 . There can be at most 2 equal signs at the end of
// four characters , so the b4 buffer must have two or three
// characters . This also catches the case where the input is
// padded with EQUALS _ SIGN
if ( b4Posn != 0 ) { if ( b4Posn == 1 ) { throw new Base64DecoderException ( "single trailing character at offset " + ( len - 1 ) ) ; } b4 [ b4Posn ++ ] = EQUALS_SIGN ; outBuffPosn += decode4to3 ( b4 , 0 , outBuff , outBuffPosn , decodabet ) ; } byte [ ] out = new byte [ outBuffPosn ] ; System . arraycopy ( outBuff , 0 , out , 0 , outBuffPosn ) ; return out ;


signature:
public class ViewUtils { /** * Records a view against the given entity for the current user .
 * @ param context The current context .
 * @ param e The entity to be viewed .
 * @ param listener A listener to handle the result . */
public static void view ( Activity context , Entity e , ViewAddListener listener ) { } }

implementation: proxy . view ( context , e , listener ) ;


signature:
public class GetActionsByApplicationActivity { /** * / * ( non - Javadoc )
 * @ see com . socialize . demo . DemoActivity # executeDemo ( ) */
@ Override public void executeDemo ( String text ) { } }

implementation: ActionUtils . getActionsByApplication ( this , 0 , PAGE_SIZE , new ActionListListener ( ) { @ Override public void onList ( ListResult < SocializeAction > result ) { handleSocializeResult ( result ) ; } @ Override public void onError ( SocializeException error ) { handleError ( GetActionsByApplicationActivity . this , error ) ; } } ) ;


signature:
public class SocializeActionProxy { /** * / * ( non - Javadoc )
 * @ see java . lang . reflect . InvocationHandler # invoke ( java . lang . Object , java . lang . reflect . Method , java . lang . Object [ ] ) */
@ Override public Object invoke ( Object proxy , Method method , Object [ ] args ) throws Throwable { } }

implementation:
try { if ( synchronous || method . isAnnotationPresent ( Synchronous . class ) || ! isVoidMethod ( method ) ) { Context context = findContext ( args ) ; if ( context != null ) { synchronized ( this ) { SocializeService socialize = Socialize . getSocialize ( ) ; if ( ! socialize . isInitialized ( context ) ) { socialize . init ( context ) ; if ( ! socialize . isAuthenticated ( ) && ! method . isAnnotationPresent ( NoAuth . class ) ) { socialize . authenticateSynchronous ( context ) ; } } } } return method . invoke ( getBean ( ) , args ) ; } else { Activity context = findActivity ( args ) ; if ( context != null ) { SocializeListener listener = findListener ( args ) ; // Always init to set the context
invokeWithInit ( context , listener , method , args ) ; } else { throw new MethodNotSupportedException ( "No activity found in method arguments for method [" + method . getName ( ) + "]" ) ; } } // Always void
return null ; } catch ( Throwable e ) { SocializeLogger . e ( e . getMessage ( ) , e ) ; throw e ; }


signature:
public class CommentListView { /** * Called when the current logged in user updates their profile . */
public void onProfileUpdate ( ) { } }

implementation: commentAdapter . notifyDataSetChanged ( ) ; if ( commentEntrySlider != null ) { commentEntrySlider . updateContent ( ) ; } if ( notifyBox != null ) { try { UserSettings user = userUtils . getUserSettings ( getContext ( ) ) ; if ( user . isNotificationsEnabled ( ) ) { notifyBox . setVisibility ( View . VISIBLE ) ; } else { notifyBox . setVisibility ( View . GONE ) ; } } catch ( SocializeException e ) { if ( logger != null ) { logger . error ( "Error getting user settings" , e ) ; } else { e . printStackTrace ( ) ; } notifyBox . setVisibility ( View . GONE ) ; } }