みなさんこんにちは! 以前の記事の続きになります。
SampleAppにLicenseKeyを入れる
以前の記事で無事build出来るようになったわけですが、正常に動きません。 おそらくLicense Keyを入れてないからじゃないか、と思ったのでLisence Keyを入れる場所を調べてみると、公式にありました!何も問題なかった!
公式によると com.qualcomm.vuforia.samples.SampleApplicationのSampleApplicationSession.java:336に書けばよいといいことらしいので書きましょう!
private class InitVuforiaTask extends AsyncTask
{
// Initialize with invalid value:
private int mProgressValue = -1;
protected Boolean doInBackground(Void... params)
{
// Prevent the onDestroy() method to overlap with initialization:
synchronized (mShutdownLock)
{
Vuforia.setInitParameters(mActivity, mVuforiaFlags, " your_license_key ");
do
{
// Vuforia.init() blocks until an initialization step is
// complete, then it proceeds to the next step and reports
// progress in percents (0 ... 100%).
// If Vuforia.init() returns -1, it indicates an error.
// Initialization is done when progress has reached 100%.
mProgressValue = Vuforia.init();
// Publish the progress value:
publishProgress(mProgressValue);
// We check whether the task has been canceled in the
// meantime (by calling AsyncTask.cancel(true)).
// and bail out if it has, thus stopping this thread.
// This is necessary as the AsyncTask will run to completion
// regardless of the status of the component that
// started is.
} while (!isCancelled() && mProgressValue >= 0
&& mProgressValue 0);
}
}
最後に
やった!これで動くだろう!と思ってわくわくして待ってたのですが、USBでつないで動かしてみると以下のエラーが(´・ω・`)
s3dReadConfigFileってやつの75行目でエラーが出てるのはわかるのですが・・・ もう少しsample appを動かすまでの旅は続きそうです。
ついに動きました!色々ありがとうございました!