Ogre3d using Android nativeactivity

Source: Internet
Author: User

Yesterday Ogre3d compiled to the Android platform after the installation, and then look back to the code found that in the Android project actually no Java source files, from the manifest file to know that the original use is nativeactivity. This look let me confused, no Java files, no activity, then I want to access ads or some other SDK how to do it? What should I do if I want to jump into the game interface from an activity?

Article from Http://blog.csdn.net/huutu qq:790621656

Ogre3d's Manifest file reads as follows: article from Http://blog.csdn.net/huutu qq:790621656

<?xml version= "1.0" encoding= "Utf-8"?><!--begin_include (manifest)--><manifest xmlns:android= "http        ://schemas.android.com/apk/res/android "package=" com.example.native_activity "android:versioncode=" 1 " Android:versionname= "1.0" > <!--this is the platform API where Nativeactivity was introduced. --&LT;USES-SDK android:minsdkversion= "9"/> <!--this apk have no Java code itself, so set Hascode to FAL Se--<application android:label= "@string/app_name" android:hascode= "false" > <!--our activity is             The built-in Nativeactivity framework class. This would take care of integrating and our NDK code.                --<activity android:name= "android.app.NativeActivity" android:label= "@string/app_name"  android:configchanges= "Orientation|keyboardhidden" > <!--tell nativeactivity the name of OR. So --<meta-data Android:name= "Android.app.liB_name "android:value=" native-activity "/> <intent-filter> <actio n android:name= "Android.intent.action.MAIN"/> <category android:name= "Android.intent.category.LAUNCH ER "/> </intent-filter> </activity> </application></manifest> <!--end_ INCLUDE (manifest)--

You can see that the entry for the specified program is nativeactivity.article from Http://blog.csdn.net/huutu qq:790621656

Article from Http://blog.csdn.net/huutu qq:790621656

At the time of no solution, thought should be able to use an activity to inherit nativeactivity, and then immediately try, sure enough.

Article from Http://blog.csdn.net/huutu qq:790621656

The following steps:

(1) Create a new myactivity and make the corresponding layout file, create a button, add the response event, click the button to jump to the game interface.

(2) Create a new mainactivity inherit from Nativiactivity.

(3) Modify the nativiactivity in the manifest file as mainactivity.

(4) Modify the start activity in manifest to myactivity.






Project Operation Result:

Click the button to switch to the game activity (OK here is the NDK demo's Solid Color Interface)

Article from Http://blog.csdn.net/huutu qq:790621656

Demo Download:

http://download.csdn.net/detail/cp790621656/8542371
article from Http://blog.csdn.net/huutu qq:790621656

Ogre3d using Android nativeactivity

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.