1,先取cantk-runtime-demos到本地:
創(chuàng)新互聯(lián)公司是一家專業(yè)提供淮安區(qū)企業(yè)網(wǎng)站建設(shè),專注與成都網(wǎng)站建設(shè)、做網(wǎng)站、HTML5、小程序制作等業(yè)務(wù)。10年已為淮安區(qū)眾多企業(yè)、政府機(jī)構(gòu)等服務(wù)。創(chuàng)新互聯(lián)專業(yè)網(wǎng)站建設(shè)公司優(yōu)惠進(jìn)行中。
git clone https://github.com/drawapp8/cantk-runtime-demos
2,創(chuàng)建一個(gè)Android App(或者拷貝現(xiàn)有的項(xiàng)目):
cd cantk-runtime-demos android create project -n MyApp -k com.demo -a MyAppActivity -p ./MyApp -t cd MyApp
3,合并phonegap和cantk-runtime相關(guān)文件。
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,啟動(dòng)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);
(請(qǐng)把游戲放在SDCARD中,路徑與上面指定的URL一致, EmbedDemo/examples/里有測(cè)試游戲)
6,編譯安裝
ant debug adb install -r bin/MyApp-debug.apk
如果編譯不過(guò),請(qǐng)修改project.properties:
target=android-21
示例:https://github.com/drawapp8/cantk-runtime-demos/tree/master/EmbedDemo
總結(jié)
以上就是這篇文章的全部?jī)?nèi)容了,希望本文的內(nèi)容對(duì)大家的學(xué)習(xí)或者工作具有一定的參考學(xué)習(xí)價(jià)值,謝謝大家對(duì)創(chuàng)新互聯(lián)的支持。如果你想了解更多相關(guān)內(nèi)容請(qǐng)查看下面相關(guān)鏈接
當(dāng)前標(biāo)題:將cantkruntime嵌入到現(xiàn)有的APP中的方法
文章URL:http://aaarwkj.com/article2/igcsoc.html
成都網(wǎng)站建設(shè)公司_創(chuàng)新互聯(lián),為您提供服務(wù)器托管、App設(shè)計(jì)、App開(kāi)發(fā)、網(wǎng)站內(nèi)鏈、網(wǎng)站排名、響應(yīng)式網(wǎng)站
聲明:本網(wǎng)站發(fā)布的內(nèi)容(圖片、視頻和文字)以用戶投稿、用戶轉(zhuǎn)載內(nèi)容為主,如果涉及侵權(quán)請(qǐng)盡快告知,我們將會(huì)在第一時(shí)間刪除。文章觀點(diǎn)不代表本網(wǎng)站立場(chǎng),如需處理請(qǐng)聯(lián)系客服。電話:028-86922220;郵箱:631063699@qq.com。內(nèi)容未經(jīng)允許不得轉(zhuǎn)載,或轉(zhuǎn)載時(shí)需注明來(lái)源: 創(chuàng)新互聯(lián)