Giter Site home page Giter Site logo

msoftware / android-socialbuttons Goto Github PK

View Code? Open in Web Editor NEW

This project forked from gcacace/android-socialbuttons

0.0 2.0 0.0 300 KB

A simple Like Button with shares count, which open Facebook native app to let the user share links to his wall.

License: Apache License 2.0

Java 100.00%

android-socialbuttons's Introduction

Android Social Buttons

A set of social buttons with shares count, and interactions with native apps, to let the user share links using his favourite social apps.

Screenshot

Social Networks Supported

  • Facebook
  • Twitter

Features

  • No Facebook or Twitter SDK needed
  • No tricky WebView
  • Native Social App detection
  • Can hide shares count baloon if zero
  • Shares count in a formatted Facebook style
  • Localized in english, french, german, italian and spanish

Android 2.2+ support

Quick Setup

1. Include library

Manual:

  • Clone this GIT repository
  • Import both library and demo to Eclipse
  • In Eclipse, right click on your personal project and go to Properties, then to the Android tab
  • Add the library to the dependency list

or

Maven dependency:

<dependency>
	<groupId>it.gcacace.android.socialbuttons</groupId>
	<artifactId>library</artifactId>
	<version>1.0.1</version>
</dependency>

2. Android Manifest

<manifest>
	<uses-permission android:name="android.permission.INTERNET" />
	...
	<application android:name="MyApplication">
		...
	</application>
</manifest>

3. Add view to your application

With URL inside XML:

<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:tools="http://schemas.android.com/tools">
	...
    <it.gcacace.android.socialbuttons.FacebookSharesButton
        xmlns:socialbutton="http://schemas.android.com/apk/res/it.gcacace.android.socialbuttons.demo"
        android:id="@+id/sharesButton1"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        socialbutton:fbsharesUrl="http://www.facebook.com/" />
	...
</LinearLayout>

or

With URL specified programmatically:

@Override
protected void onCreate(Bundle savedInstanceState) {
	super.onCreate(savedInstanceState);
	setContentView(R.layout.activity_main);
	...
	// Find the second SharesButton from the inflated layout
	FacebookSharesButton sharesButton = (FacebookSharesButton) findViewById(R.id.sharesButton2);
	
	// Set sharesUrl to an URL
	sharesButton.setSharesUrl("http://mobile.fanpage.it/segui-la-diretta-del-google-i-o-2103/");
	
	// Fetch the shares count (this call is asynchronous)
	sharesButton.fetchShares();
	...
}

License

Copyright 2013 Gianluca Cacace

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

   http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.

android-socialbuttons's People

Contributors

gcacace avatar

Watchers

Michael jentsch avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.