Facebook Interlock Cocos2d-X ver.
Facebook Interlocking with Cocos2d-X
2 min read
Reference
Refer to Facebook's README
Overview
- Developer Registration
- Eclipse Environment Setup
- Troubleshooting
- Modifying AndroidManifest.xml
- Modifying String.xml
- Modifying AppActivity
- Utilizing JNI
1. Developer Registration
- App Creation
- Google Package Name
- Class Name
- Key Hash
2. Eclipse Environment Setup
- Import Facebook SDK downloaded into Eclipse
- Convert Facebook SDK to Library format
- Add Library to the project
- Put
android..
andBolt..
from Github Libs into the project's Libs folder.
3. Troubleshooting
- Add
android..
andBolt..
from Facebook SDK's properties -> Java Build Path -> Libraries to Add Jars. - Change SDK version to 4.4.2W in Properties -> Android.
- Change JDK version to 1.7 from 1.6 in Java Compiler.
- If errors persist, change project's SDK version to above 4.
4. Modifying AndroidManifest.xml
<activity android:name="com.facebook.FacebookActivity"
android:configChanges="keyboard|keyboardHidden|screenLayout|screenSize|orientation"
android:theme="@android:style/Theme.Translucent.NoTitleBar"
android:label="@string/app_name" />
<meta-data android:name="com.facebook.sdk.ApplicationId"
android:value="@string/facebook_app_id"/>
Add this.
5. Modifying String.xml
- In rex/values/string.xml, add
<string name="facebook_app_id">facebookId</string>
. - Enter the key value received from the developer site into facebookId.
6. Modifying AppActivity
7. JNI Helper
- Utilize JNI Helper
If there is any incorrect content, please point it out.,
Please share any better methods or ideas you have.