Log in or register to post comments

Failed to Initialze QCAR

April 3, 2013 - 12:31pm #1

Hi

I ahve craeted my own application integrating  VideoPlayback and  ImageTarget.

On pressing Home button and then opening again , i m getting message " failed to initalize QCAR"

 

please tell me what can be possible causes for same?

i have alraedy checked onPause and onResume and they seem to be ok

Failed to Initialze QCAR

April 7, 2013 - 5:26am #12

Ok, well, that's good to hear.

 

Failed to Initialze QCAR

April 7, 2013 - 4:54am #11

I was not able to find the issue. 

So , I reintegrate Imagetarget Sample to VideoPlayback. Now everything is running fine.

I just hope that i should n't get this issue again.

Failed to Initialze QCAR

April 4, 2013 - 2:10am #10

According to Android LifeCycle , on pressing home button only onPause is called. which is happening in my app and default playback app.

Yes, that's what I was saying too; and this is causing the issue, because for some wird reasons when you relaunch the app, the onCreate is called again (which should not), and QCAR is reinitialized (which causes the error, since QCAR was not destroyed).

What is strange is that this does not happen with the original samples (or do you see this issue also on the original samples ???), so it is hard to tell here what goes wrong after you integrated them...

A possible workaround might be to add some code which checks if QCAR is already initialized and then skip the InitQCARTask execution if not needed; 

however, it would be best if you review again all the code (including onPause and onResume) and maybe put some LOGS to verify which life-cycle functions (onPause, onResume, onCreate, onDestroy) are called at the different steps of your test ...

 

 

 

Failed to Initialze QCAR

April 4, 2013 - 1:50am #9

Hi,

According to Android LifeCycle , on pressing home button only onPause is called. which is happening in my app and default playback app.

The error is coming in both seceneros , second time

1. you press home button and select app by clicking app icon in task manager

2. or you click app icon

Failed to Initialze QCAR

April 4, 2013 - 1:37am #8

Ok, I see. So, the initialization of QCAR happens because the onCreate is called (when launching again after you pressed the Home button);

however, when pressing the HOME button, the onDestroy is not called, so this is the root of the issue..

when you launch after pressing HOME (i.e. the second time), how do you start the app ? by clicking on the App icon ? 

 

 

Failed to Initialze QCAR

April 3, 2013 - 10:47pm #7

It's there.

 

OnCreate Code

 

 

protected void onCreate(Bundle savedInstanceState) {
DebugLog.LOGD("VideoPlayback::onCreate");
Log.e("Oncreate:", "VideoPlayback::onCreate");
super.onCreate(savedInstanceState);
 
// Set the splash screen image to display during initialization:
mSplashScreenImageResource = R.drawable.splash_screen_video_playback;
 
// Load any sample specific textures:
mTextures = new Vector<Texture>();
loadTextures();
 
// Query the QCAR initialization flags:
mQCARFlags = getInitializationFlags();
 
// Update the application status to start initializing application
updateApplicationStatus(APPSTATUS_INIT_APP);
 
// Create the gesture detector that will handle the single and
// double taps:
mSimpleListener = new SimpleOnGestureListener();
mGestureDetector = new GestureDetector(getApplicationContext(), mSimpleListener);
 
mVideoPlayerHelper = new VideoPlayerHelper[NUM_TARGETS];
mSeekPosition = new int[NUM_TARGETS];
mWasPlaying = new boolean[NUM_TARGETS];
mMovieName = new String[NUM_TARGETS];
 
// Create the video player helper that handles the playback of the movie
// for the targets:
for (int i = 0; i < NUM_TARGETS; i++) {
mVideoPlayerHelper[i] = new VideoPlayerHelper();
mVideoPlayerHelper[i].init();
mVideoPlayerHelper[i].setActivity(this);
}
......
 
 
NO CHANGE DONE IN INITQCAR
secondly , the app is running fine on new launch . Ony in secenerio mentioned below , it' fails to initalize qcar
 

Failed to Initialze QCAR

April 3, 2013 - 1:28pm #6

Ok. Thanks. Can you also check that you have this code in your onCreate() method ?

 

mQCARFlags = getInitializationFlags();
 
note: the line above should appear before the following line:
 
updateApplicationStatus(APPSTATUS_INIT_APP);
 

Failed to Initialze QCAR

April 3, 2013 - 1:07pm #5

This code only exists  in INIT_QCAR in my app. it executes QCAR task.

 

case APPSTATUS_INIT_QCAR:

Failed to Initialze QCAR

April 3, 2013 - 1:00pm #4

Are you sure you have not duplicated this code ?

    try
    {
           mInitQCARTask = new InitQCARTask();
           mInitQCARTask.execute();
    }
    catch (Exception e)
    {
          DebugLog.LOGE("Initializing QCAR SDK failed");
    }
            

 

Failed to Initialze QCAR

April 3, 2013 - 12:55pm #3

Hi ,

 

I have not done any change in INITQCARTask . Already checked it.

Regards

 

Failed to Initialze QCAR

April 3, 2013 - 12:52pm #2

Hi, that message comes from the InitQCARTask (see the original code in ImageTargets.java or VideoPlayback.java);

you should check that the InitQCARTask is executed in the same way as in the original samples...

 

Log in or register to post comments