简体   繁体   中英

add class to manifest.xml

I'm trying to run the sample in this tutorial : http://www.devx.com/wireless/Article/42482/0/page/1?comment=61407-0#comment61407-0
it seems to run fine in the emulator(I'm not sure cause the application uses the camera and it can't be shown in the emulator) . but when I try to run it on my device ( Nexus S) it forces to stop the application. the application has only two files , one main activity and another class called CustonCameraView.java which is used in the main activity . should I somehow add this class to the manifest.xml file ?
thanks
this is my manifest.xml file :

<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
      package="com.smtabatabaie.locationAR"
      android:versionCode="1"
      android:versionName="1.0">
    <uses-sdk android:minSdkVersion="10" />
    <uses-permission android:name="android.permission.CAMERA"></uses-permission>
    <uses-feature android:name="android.hardware.camera" />
    <uses-feature android:name="android.hardware.camera.autofocus" />

    <application android:icon="@drawable/icon" android:label="@string/app_name">
        <!-- <uses-permission android:name="android.permission.CAMERA" /> -->
        <activity android:name=".main"
                  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>

have you added all necessary permissions to your manifest.xml?

according to http://developer.android.com/reference/android/hardware/Camera.html you would have to add the following 3 permissions:

<uses-permission android:name="android.permission.CAMERA" />
<uses-feature android:name="android.hardware.camera" />
<uses-feature android:name="android.hardware.camera.autofocus" />

could you please add the Logcat error message so that we can see what is causing the force close in the first place?

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