首先要清楚目标是什么?魔窗官网有成果视频展示,接入之前最好看一下,方向不对努力白费,不要急着对着文档操作 , 理清思路,磨刀不误砍柴功。
公司要求的只是集成mlin功能,所以其他略去
名词解释:
应该清楚 cocos、unity等集成的单 activity 官网给的文档是用安卓写的两个页面 两个activity 所以很坑
其实单个activity 的集成还简单了呢,首先要导入jar包,这步是必须的,选中工程buidpath-》cofigerBuidPath 然后选中 library这个tab addjar 引入jar (事先要拷贝到libs下,找不到就刷新项目)
配置AndroidMainTest.xml文件
添加必要权限、设置魔窗appid、添加回调url
我的粘贴到这里 有注释 (含微信sdk)
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.powerfox.qp.klhnmj"
android:versionCode="1"
android:versionName="1.0"
android:installLocation="auto">
<uses-sdk android:minSdkVersion="14"/>
<uses-feature android:glEsVersion="0x00020000" />
<application android:label="@string/app_name"
android:icon="@drawable/icon">
<!-- Tell Cocos2dxActivity the name of our .so -->
<meta-data android:name="android.app.lib_name"
android:value="cocos2dcpp" />
<!-- 启动页面 -->
<activity android:name="org.cocos2dx.cpp.AppActivity"
android:label="@string/app_name"
android:screenOrientation="landscape"
android:theme="@android:style/Theme.NoTitleBar.Fullscreen"
android:configChanges="orientation|keyboardHidden|screenSize">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
<intent-filter>
<data android:scheme="kuailaihngame"/>
<action android:name="android.intent.action.VIEW" />
<category android:name="android.intent.category.DEFAULT" />
<category android:name="android.intent.category.BROWSABLE" />
</intent-filter>
</activity>
<!-- 微信回调 -->
<activity
android:name="com.powerfox.qp.klhnmj.wxapi.WXEntryActivity"
android:label="@string/app_name"
android:exported="true"
android:launchMode="singleTop"
android:theme="@android:style/Theme.Translucent"
/>
<!--总的activity,必须注册!!! -->
<activity android:name="com.zxinsight.common.base.MWActivity" android:exported="true"
android