Android Augmented Reality
<p>I'm working on my first Android Augmented Reality application. The application works pretty good if the <code>ARActivity</code> runs as the first class (<code>android.intent.category.LAUNCHER</code>) in the <code>manifest</code> file. But when I added a splash screen which means the <code>ARActivity</code> will be the second to <code>run(android.intent.category.DEFAULT)</code>, the camera seems not detecting the marker. I believe the problem is all in the <code>manifest</code> file.</p>

<p>This is the manifest.xml</p>

<pre><code>&lt;manifest xmlns:android="http://schemas.android.com/apk/res/android"
    package="com.ar.armarkers"
    android:versionCode="1"
    android:versionName="1.0" &gt;

    &lt;uses-sdk
        android:minSdkVersion="8"
        android:targetSdkVersion="15" /&gt;

    &lt;uses-permission android:name="android.permission.CAMERA" /&gt;
    &lt;uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" /&gt;

    &lt;uses-feature android:name="android.hardware.camera" /&gt;
    &lt;uses-feature android:name="android.hardware.camera.autofocus" /&gt;

    &lt;application
        android:icon="@drawable/ic_launcher"
        android:label="@string/app_name"
        android:theme="@style/AppTheme" &gt;
        &lt;activity
            android:name=".Splash"
            android:screenOrientation="landscape"
            android:theme="@android:style/Theme.Black.NoTitleBar.Fullscreen" &gt;
            &lt;intent-filter&gt;
                &lt;action android:name="android.intent.action.MAIN" /&gt;

                &lt;category android:name="android.intent.category.LAUNCHER" /&gt;
            &lt;/intent-filter&gt;
        &lt;/activity&gt;
        &lt;activity
            android:name="com.ar.armarkers.MainActivity"
            android:clearTaskOnLaunch="true"
            android:label="@string/title_activity_main"
            android:noHistory="true"
            android:screenOrientation="landscape" &gt;
            &lt;intent-filter&gt;
                &lt;action android:name="com.ar.armarkers.MAINACTIVITY" /&gt;

                &lt;category android:name="android.intent.category.DEFAULT" /&gt;
            &lt;/intent-filter&gt;
        &lt;/activity&gt;
    &lt;/application&gt;

&lt;/manifest&gt;
</code></pre>

<p>MainActivity.java</p>

<pre><code>import edu.dhbw.andar.ARObject;
import edu.dhbw.andar.ARToolkit;
import edu.dhbw.andar.AndARActivity;
import edu.dhbw.andar.exceptions.AndARException;

import edu.dhbw.andar.pub.CustomRenderer;
import android.os.Bundle;

import android.util.Log;

public class MainActivity extends AndARActivity {

    private ARObject someObject;
    private ARToolkit artoolkit;

    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        CustomRenderer renderer = new CustomRenderer();
        setNonARRenderer(renderer);

        try {
            artoolkit = getArtoolkit();

            someObject = new CustomObject1("test", "marker16.pat", 80.0,
                    new double[] { 0, 0 });
            artoolkit.registerARObject(someObject);

            someObject = new CustomObject2
                    ("test", "marker17.patt", 80.0, new
                    double[]{0,0});
                    artoolkit.registerARObject(someObject);

        } catch (AndARException ex) {
            System.out.println("");
        }
        startPreview();
    }

    public void uncaughtException(Thread thread, Throwable ex) {
        // TODO Auto-generated method stub

        Log.e("AndAR EXCEPTION", ex.getMessage());
        finish();
    }

}
</code></pre>

<p>Splash.java</p>

<pre><code>import android.app.Activity;
import android.app.ProgressDialog;
import android.content.Intent;
import android.os.Bundle;
import android.view.Gravity;

public class Splash extends Activity {

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        // TODO Auto-generated method stub
        super.onCreate(savedInstanceState);
        setContentView(R.layout.splash);

        Thread timer = new Thread() {
            public void run() {
                try {
                    sleep(1000);
                } catch (InterruptedException e) {
                    e.printStackTrace();
                } finally {
                    Intent i = new Intent(getApplicationContext(),
                            MainActivity.class);
                    startActivity(i);
                }
            }
        };
        timer.start();
    }

}
</code></pre>
