码迷,mamicode.com
首页 > 其他好文 > 详细

libgdx robovm友盟游戏统计分析SDK的绑定

时间:2015-05-26 18:58:56      阅读:247      评论:0      收藏:0      [点我收藏+]

标签:android   robovm   libgdx   友盟游戏分析   ios绑定   

为了支持libgdx游戏引擎的推广,本人会定期编写IOS SDK绑定,并且分享给大家.

用法:

1.在robovm.xml里面配置你的.a路径(自己在data目录下创建一个libs目录,放入,a)

<libs>
      <lib>z</lib>   
       <lib>data/libs/libMobClickGameLibrary.a</lib>   
  </libs>

2.由于使用的全局变量,所以要现在xml里面定义一下才行

exportedSymbols

代码:

<libs>
      <lib>z</lib>   
       <lib>data/libs/libMobClickGameLibrary.a</lib>   
  </libs>
  <frameworks>
    <framework>UIKit</framework>
    <framework>OpenGLES</framework>
    <framework>QuartzCore</framework>
    <framework>CoreGraphics</framework>
    <framework>OpenAL</framework>
    <framework>AudioToolbox</framework>
    <framework>AVFoundation</framework>
  </frameworks>
  <exportedSymbols>
		<symbol>MobClickSocialType*</symbol>
  </exportedSymbols>
</config>


3.使用方法(只测试了部分)

@Override
	public boolean didFinishLaunching(UIApplication application,
			UIApplicationLaunchOptions launchOptions) {

		MobClick.startWithAppkey("your key",
				ReportPolicy.BATCH, "ios");

		MobClickGameAnalytics.pay(100, 1, 200);
		MobClickGameAnalytics.buy("xxoo", 1, 100);
		MobClickGameAnalytics.use("xxoo", 1, 100);

		MobClickGameAnalytics.startLevel("1");
		MobClickGameAnalytics.finishLevel("1");
		MobClickGameAnalytics.failLevel("1");

		final NSDictionary<NSString, NSString> dic = new NSDictionary<NSString, NSString>();
		dic.setAssociatedObject(new NSString("1"), new NSString("1"));
		dic.setAssociatedObject(new NSString("2"), new NSString("2"));

		MobClickSocialWeibo weibo = new MobClickSocialWeibo(MobClickSocialWeibo.MobClickSocialTypeSina(),
				"xxxxxxxooooo", "12345", dic);
		List<MobClickSocialWeibo> weibos = new ArrayList<MobClickSocialWeibo>();
		weibos.add(weibo);

		MobClickSocialAnalytics.postWeiboCounts(weibos,
				"your key", "测试", null);

		return super.didFinishLaunching(application, launchOptions);
	}

只测试了一部分代码,其余的还没有测试过, 请自行测试. 按照友盟文档来就行了.有不会的地方请留言

下载地址:https://github.com/tianqiujie/robovm-ios-bindings

libgdx robovm友盟游戏统计分析SDK的绑定

标签:android   robovm   libgdx   友盟游戏分析   ios绑定   

原文地址:http://blog.csdn.net/qq634416025/article/details/46009043

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!