简体   繁体   中英

Augmented Reality Example with LookAR

i'm trying to compile an example for the LookAR Framework, but everytime i open the app on my phone it crashes.

I'm using Eclipse with the Android SDK and testing in my phone with Android 2.3.3 Gingerbread.

package com.example.turistear;

import es.ucm.look.ar.LookAR;
import es.ucm.look.data.EntityData;
import es.ucm.look.data.LookData;
import android.os.Bundle;

public class MyARActivity extends LookAR {

    public MyARActivity(){
            super(true , true , true , true ,100.0f , true);
    }
@Override
public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);

    EntityData data = new EntityData ( ) ;
    data.setLocation (10 , 0 , 0 ) ;
    LookData.getInstance().getDataHandler().addEntity ( data );
    LookData.getInstance().updateData();

}
}

This is the Layout (i think the problem is here)

<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context=".MyARActivity" >

<TextView
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:layout_centerHorizontal="true"
    android:layout_centerVertical="true"
    android:text="@string/hello_world" />

</RelativeLayout>

And this is the Manifest

<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.example.turistear"
android:versionCode="1"
android:versionName="1.0" >

<uses-sdk
    android:minSdkVersion="9"
    android:targetSdkVersion="10" />
<uses-permission android:name="android.permission.CAMERA"/>

<application
    android:allowBackup="true"
    android:icon="@drawable/ic_launcher"
    android:label="@string/app_name"
    android:theme="@style/AppTheme" >
    <activity
        android:name="com.example.turistear.MyARActivity"
        android:label="@string/app_name" >
        <intent-filter>
            <action android:name="android.intent.action.MAIN" />

            <category android:name="android.intent.category.LAUNCHER" />
        </intent-filter>
    </activity>
</application>

</manifest>

Hope you guys can help me.

Thanks.

Set your minSdkVersion inside the manifest to 7 or below and remove targetSDKVersion(For easier implementation for phones of higher OS version). That should do it

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM