将cantk runtime嵌入到现有的APP中的方法
2019/7/7 21:49:49
本文主要是介绍将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
总结
以上就是这篇文章的全部内容了,希望本文的内容对大家的学习或者工作具有一定的参考学习价值,谢谢大家对找一找教程网的支持。如果你想了解更多相关内容请查看下面相关链接
这篇关于将cantk runtime嵌入到现有的APP中的方法的文章就介绍到这儿,希望我们推荐的文章对大家有所帮助,也希望大家多多支持为之网!
- 2024-01-18android.permission.read_media_video
- 2024-01-18android_getaddrinfo failed eai_nodata
- 2024-01-18androidmo
- 2024-01-15Android下三种离屏渲染技术
- 2024-01-09Android 蓝牙使用
- 2024-01-06Android对接华为AI - 文本识别
- 2023-11-15代码安全之代码混淆及加固(Android)
- 2023-11-10简述Android语音播报TTS
- 2023-11-06Android WiFi工具类
- 2023-07-22Android开发未来的出路