【问题标题】:Augmented Reality Example with LookAR使用 LookAR 的增强现实示例
【发布时间】:2012-12-18 16:58:34
【问题描述】:

我正在尝试为 LookAR 框架编译一个示例,但每次我在手机上打开应用程序时都会崩溃。

我正在使用带有 Android SDK 的 Eclipse,并在我的手机中使用 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();

}
}

这是布局(我认为问题出在这里)

<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>

这是清单

<?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>

希望你们能帮助我。

谢谢。

【问题讨论】:

    标签: java android augmented-reality


    【解决方案1】:

    将清单中的 minSdkVersion 设置为 7 或以下,并删除 targetSDKVersion(为了更容易实现更高操作系统版本的手机)。应该这样做

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2012-06-11
      • 2019-01-12
      • 2011-06-14
      • 1970-01-01
      相关资源
      最近更新 更多