Log in or register to post comments

[ASK] Log output Augmented Reality deployment in Android

October 23, 2012 - 1:20am #1

Hi all,

Anyway I am new in Android. I followed the sample tutorial the Vuforia AR with Unity package extension, and everything works fine.

I have a case to put my resource file (*.dat and *.xml) in server instead of embed them in *.apk deployment.

 

I try to modify the generated source code (DataSetLoadBehaviour) :

<code>

private const string DATA_SET_PATH = "Assets/StreamingAssets/QCAR/";

    private const string ResourceUrl = "http://myserver";

    IEnumerator DownloadAndSave(string filename)

    {

        string remoteFile = ResourceUrl + "/" + filename;

        string localFile = DATA_SET_PATH + filename; 

 

        Debug.Log("remoteFile: " + remoteFile);

        Debug.Log("localFile: " + localFile);

 

        if (System.IO.File.Exists(localFile))

        {           

            System.IO.File.Delete(localFile);            

        }

 

        WWW wwwdat = new WWW(remoteFile);

        yield return wwwdat;

 

        System.IO.File.WriteAllBytes(localFile, wwwdat.bytes);

               

    }

 void Awake()

    {

        if (Application.isEditor)

        {

            return;

        }

 

        DownloadAndSave("cave2.dat");

        DownloadAndSave("cave2.xml");

//....

//....

}

 

 

</code>

 

My question are :

  1. Is it possible to do that ? Or am I missing other thing to get this work ?
  2. when apk deployed to Android, where can I get the log/debug output file of Debug.Log (......);

 

Thanks in advance.

[ASK] Log output Augmented Reality deployment in Android

October 26, 2012 - 12:16pm #3

Yes that's possible. You'll want to set-up your dataset loading to use an absolute path to your file system, using the storage type STORAGE_ABSOLUTE

https://ar.qualcomm.at/sdk/android/Swappable%20Datasets%20-%20Android

also see https://ar.qualcomm.at/content/can-i-load-data-sd-card

As for debugging, I'd recommend setting up development environment to support Java debugging using Eclipse. This will also provide you with an ADB installation, which provides a lot of useful tools for debugging and managing apps on devices - https://ar.qualcomm.at/sdk/android/Set%20up%20Dev%20Env

[ASK] Log output Augmented Reality deployment in Android

October 23, 2012 - 5:02am #2

Hi, try the terminal for the debuging. See this link : http://forum.unity3d.com/threads/70197-Any-tips-for-debugging-Android

Log in or register to post comments