将cantk runtime嵌入到现有的APP中的方法

发布时间:2019-08-08 发布网站:脚本宝典
脚本宝典收集整理的这篇文章主要介绍了将cantk runtime嵌入到现有的APP中的方法脚本宝典觉得挺不错的,现在分享给大家,也给大家做个参考。

1,先取cantk-runtime-demos到本地:

 gIT clone https://github.COM/drawapp8/cantk-runtime-demos

2,创建一个AndROId App(或者拷贝现有的项目):

 cd cantk-runtime-demos android create PRoject -n MyApp -k com.demo -a MyAppActivity -p ./MyApp -t  cd MyApp

3,合并phonegap和cantk-runtime相关文件。

 GamERUNNER=../GameRunner/platforms/android mkdir -p assets cp -rvf $GAMERUNNER/libs . cp -rvf $GAMERUNNER/src/* src/. cp -arvf $GAMERUNNER/res/XMl res cp -arvf $GAMERUNNER/assets/www assets/ cp -rfv $GAMERUNNER/CordovaLib/src/* src/. rm -rf assets/www/cordova-js-src/

4,修改AndroidManifest.xML,增加activity

 <activity android:name="com.tangide.GameRunnerActivity" android:label="@string/app_name"> </activity>

5,启动GameRunnerActivity

 import com.tangide.GameRunnerActivity; ... Intent intent = new Intent(); Bundle bundle = new Bundle();  intent.setClass(EmbedDemoActivity.this, GameRunnerActivity.class); bundle.putString("url", "file:///mnt/sdcard-ext/cantk-rt-root/game1/index.html"); intent.putExtras(bundle); startActivity(intent);

(请把游戏放在SDCARD中,路径与上面指定的URL一致, EmbedDemo/examples/里有测试游戏)

6,编译安装

 ant debug adb install -r bin/MyApp-debug.apk

如果编译不过,请修改project.proPErties:

 target=android-21

示例:https://github.com/drawapp8/cantk-runtime-demos/tree/master/EmbedDemo

总结

android教程
脚本网站
android studio

脚本宝典总结

以上是脚本宝典为你收集整理的将cantk runtime嵌入到现有的APP中的方法全部内容,希望文章能够帮你解决将cantk runtime嵌入到现有的APP中的方法所遇到的问题。

如果觉得脚本宝典网站内容还不错,欢迎将脚本宝典推荐好友。

本图文内容来源于网友网络收集整理提供,作为学习参考使用,版权属于原作者。
如您有任何意见或建议可联系处理。小编QQ:384754419,请注明来意。