Embed the CANTK runtime in an existing app

Source: Internet
Author: User

1, first take Cantk-runtime-demos to Local:

clone https://github.com/drawapp8/cantk-runtime-demos

2. Create an Android App (or copy an existing project):

cd cantk-runtime-demos-n-k com.-a-p./MyApp  -t cd MyApp

3, merge PhoneGap and cantk-runtime related files.

GAMERUNNER=../GameRunner/platforms/androidmkdir$GAMERUNNER$GAMERUNNER$GAMERUNNER$GAMERUNNER$GAMERUNNER/CordovaLib/src/* src/.rm -rf assets/www/cordova-js-src/

4, modify Androidmanifest.xml, add activity

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

5, Start 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);

(Please put the game in SDcard, the path is the same as the URL specified above, there is a test game in embeddemo/examples/)

6, compiling and installing

debugadb install -r bin/MyApp-debug.apk

If compiling however, please modify Project.Properties:

target=android-21

Example: Https://github.com/drawapp8/cantk-runtime-demos/tree/master/EmbedDemo

Copyright NOTICE: This article for Bo Master original article, without Bo Master permission not reproduced.

Embed the CANTK runtime in an existing app

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.