- Home /
OpenFeint Facade integration Unity Android
Does anybody have experience with integrating OpenFeint into their existing Android project. I've tested OpenFeint with their test project successfully on a variety of Android devices, but for the life of me can't figure out how to get it working in an existing project.
It comes down to editing the Manifest file properly, which is where I'm stuck. Can anybody show a working example of a Manifest file that has integrated OpenFeint's activities, permissions, and application tag changes? Using the new Unity 3.5 Manifest base file if possible would be appreciated.
EDIT: Still not understanding what is going wrong with my particular situation, so I'm going to post the two manifest files to see if someone can spot what needs to be changed.
OpenFeint included Manifest File:
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.gree.giraffe" android:versionCode="1" android:versionName="1.0">
<uses-sdk android:minSdkVersion="7" />
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<uses-permission android:name="android.permission.READ_PHONE_STATE" />
<uses-permission android:name="android.permission.ACCESS_WIFI_STATE" />
<uses-permission android:name="android.permission.GET_ACCOUNTS" />
<application>
<activity android:name="com.gree.giraffe.BaseActivity">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity android:name="com.gree.giraffe.DialogActivity" android:theme="@android:style/Theme.Dialog"/>
<!-- OpenFeint Activities -->
<activity android:name="com.openfeint.internal.ui.IntroFlow"
android:label="IntroFlow"
android:configChanges="orientation|keyboardHidden"
android:theme="@style/OFNestedWindow" />
<activity android:name="com.openfeint.api.ui.Dashboard"
android:label="Dashboard"
android:configChanges="orientation|keyboardHidden"
android:theme="@style/OFNestedWindow"/>
<activity android:name="com.openfeint.internal.ui.Settings"
android:label="Settings"
android:configChanges="orientation|keyboardHidden"
android:theme="@style/OFNestedWindow"/>
<activity android:name="com.openfeint.internal.ui.NativeBrowser"
android:label="NativeBrowser"
android:configChanges="orientation|keyboardHidden"
android:theme="@style/OFNestedWindow"/>
</application>
My Manifest file merged with Unity3d:
<?xml version="1.0" encoding="utf-8"?>
<manifest
xmlns:android="http://schemas.android.com/apk/res/android"
package="com.unity3d.player"
android:installLocation="preferExternal"
android:versionCode="1"
android:versionName="1.0">
<supports-screens
android:smallScreens="true"
android:normalScreens="true"
android:largeScreens="true"
android:xlargeScreens="true"
android:anyDensity="true"/>
<application
android:icon="@drawable/app_icon"
android:label="@string/app_name"
android:debuggable="true">
<activity android:name="com.unity3d.player.UnityPlayerProxyActivity"
android:label="@string/app_name"
android:configChanges="fontScale|keyboard|keyboardHidden|locale|mnc|mcc|navigation|orientation|screenLayout|screenSize|smallestScreenSize|uiMode|touchscreen">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity android:name="com.unity3d.player.UnityPlayerActivity"
android:label="@string/app_name"
android:configChanges="fontScale|keyboard|keyboardHidden|locale|mnc|mcc|navigation|orientation|screenLayout|screenSize|smallestScreenSize|uiMode|touchscreen">
</activity>
<activity android:name="com.unity3d.player.UnityPlayerNativeActivity"
android:label="@string/app_name"
android:configChanges="fontScale|keyboard|keyboardHidden|locale|mnc|mcc|navigation|orientation|screenLayout|screenSize|smallestScreenSize|uiMode|touchscreen">
<meta-data android:name="android.app.lib_name" android:value="unity" />
<meta-data android:name="unityplayer.ForwardNativeEventsToDalvik" android:value="false" />
</activity>
<activity android:name="com.unity3d.player.VideoPlayer"
android:label="@string/app_name"
android:configChanges="fontScale|keyboard|keyboardHidden|locale|mnc|mcc|navigation|orientation|screenLayout|screenSize|smallestScreenSize|uiMode|touchscreen">
</activity>
<!-- OpenFeint Activities -->
<activity android:name="com.openfeint.internal.ui.IntroFlow"
android:label="IntroFlow"
android:configChanges="orientation|keyboardHidden"
android:theme="@style/OFNestedWindow" />
<activity android:name="com.openfeint.api.ui.Dashboard"
android:label="Dashboard"
android:configChanges="orientation|keyboardHidden"
android:theme="@style/OFNestedWindow"/>
<activity android:name="com.openfeint.internal.ui.Settings"
android:label="Settings"
android:configChanges="orientation|keyboardHidden"
android:theme="@style/OFNestedWindow"/>
<activity android:name="com.openfeint.internal.ui.NativeBrowser"
android:label="NativeBrowser"
android:configChanges="orientation|keyboardHidden"
android:theme="@style/OFNestedWindow"/>
<!-- META-DATA -->
<service android:name="com.prime31.billing.BillingService" />
<receiver android:name="com.prime31.billing.BillingReceiver">
<intent-filter>
<action android:name="com.android.vending.billing.IN_APP_NOTIFY" />
<action android:name="com.android.vending.billing.RESPONSE_CODE" />
<action android:name="com.android.vending.billing.PURCHASE_STATE_CHANGED" />
</intent-filter>
</receiver>
</application>
<!-- PERMISSIONS -->
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="com.android.vending.BILLING" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.GET_ACCOUNTS" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
I followed the directions per OpenFeint's directions on editing the Manifest file, and it still doesn't work. The OpenFeint included Manifest file, when used with my existing projects, allows full use of OpenFeint in a built scene inside my own project, but when I try to insert the activity tags as they suggest on their website into the Unity Generated Manifest file, nothing works.
I'm not sure how much use showing you my $$anonymous$$anifest file would be as I have a whole bunch of other stuff in there but the OF related activities I have that should be placed between your application tags:
<activity android:name="com.openfeint.internal.ui.IntroFlow"
android:label="IntroFlow"
android:configChanges="orientation|keyboardHidden"
android:theme="@android:style/Theme.NoTitleBar"
android:screenOrientation="landscape">
</activity>
<activity android:name="com.openfeint.api.ui.Dashboard"
android:label="Dashboard"
android:configChanges="orientation|keyboardHidden"
android:theme="@android:style/Theme.NoTitleBar"
android:screenOrientation="landscape">
</activity>
<activity android:name="com.openfeint.internal.ui.Settings"
android:label="Settings"
android:configChanges="orientation|keyboardHidden"
android:theme="@android:style/Theme.NoTitleBar"
android:screenOrientation="landscape">
</activity>
<activity android:name="com.openfeint.internal.ui.NativeBrowser"
android:label="NativeBrowser"
android:configChanges="orientation|keyboardHidden"
android:theme="@android:style/Theme.NoTitleBar"
android:screenOrientation="landscape">
</activity>
Well, I added all the required activities to the $$anonymous$$anifest file in the Application tag space, and OF simply wont' work in my application. Do I have to change other things inside of the Unity generated $$anonymous$$anifest file? Such as the package name?
By researching and narrowing down the possibilities, it seems that the BaseActivity needs to be launched within my project, but I'm not quite sure how to do that. I would have to have some kind of intent I would assume in order to launch it so it's waiting for code calls from Unity.
I simply don't understand how anybody can get OpenFeint working integrated into their project without knowing how to manually edit the manifest file.