この文書の現在のバージョンと選択したバージョンの差分を表示します。
| 両方とも前のリビジョン 前のリビジョン 次のリビジョン | 前のリビジョン | ||
|
facebook_sdk [2015/02/19 16:46] sou |
facebook_sdk [2015/02/20 15:12] (現在) sou [layout_main.xml] |
||
|---|---|---|---|
| ライン 2: | ライン 2: | ||
| --- //[[sou@mss-g.co.jp|宗 昂志]] 2015/02/18 15:08// | --- //[[sou@mss-g.co.jp|宗 昂志]] 2015/02/18 15:08// | ||
| ===== ログイン処理 ===== | ===== ログイン処理 ===== | ||
| + | ※SDKのダウンロートとかFacebook Devの設定は省いてます。 | ||
| + | |||
| 以下のようなログインボタンの実装です。\\ | 以下のようなログインボタンの実装です。\\ | ||
| - | こちらで使用しているボタンはSDKに組み込まれているログインボタンになります。\\ | + | こちらで使用しているボタンはSDKに組み込まれているログインボタンになります。 |
| {{:device-2015-02-19-154813.png?nolink&300|}} | {{:device-2015-02-19-154813.png?nolink&300|}} | ||
| + | |||
| + | ログインが完了すると、以下のようにボタンが切り替わります。\\ | ||
| + | SDKのボタンを使用する場合、ボタンの切り替え処理はSDKが行っているようなので、特に必要はなさそうです。\\ | ||
| + | もし自分でボタンを作成したい場合は、Session状態を見ながら切り替える必要があります。\\ | ||
| + | {{:device-2015-02-19-171150.png?nolink&300|}} | ||
| + | |||
| ==== AndroidManifest.xml ==== | ==== AndroidManifest.xml ==== | ||
| permissionとmeta-dataを追加します。 | permissionとmeta-dataを追加します。 | ||
| ライン 13: | ライン 21: | ||
| android:name="com.facebook.sdk.ApplicationId" | android:name="com.facebook.sdk.ApplicationId" | ||
| android:value="@string/facebook_appId" /> | android:value="@string/facebook_appId" /> | ||
| - | ==== layout_main.xml ==== | + | |
| + | ==== string.xml ==== | ||
| + | <string name="facebook_appId">appid</string> | ||
| + | |||
| + | ==== activity_main.xml ==== | ||
| <com.facebook.widget.LoginButton | <com.facebook.widget.LoginButton | ||
| - | android:id="@+id/authButton" | + | android:id="@+id/btn_auth" |
| android:layout_width="wrap_content" | android:layout_width="wrap_content" | ||
| android:layout_height="wrap_content" | android:layout_height="wrap_content" | ||