{"action":"opened","issue":{"url":"https://api.github.com/repos/benjaminaaron/SumoVizUnity/issues/22","labels_url":"https://api.github.com/repos/benjaminaaron/SumoVizUnity/issues/22/labels{/name}","comments_url":"https://api.github.com/repos/benjaminaaron/SumoVizUnity/issues/22/comments","events_url":"https://api.github.com/repos/benjaminaaron/SumoVizUnity/issues/22/events","html_url":"https://github.com/benjaminaaron/SumoVizUnity/issues/22","id":114156947,"number":22,"title":"filepath to assets on Android","user":{"login":"benjaminaaron","id":5141792,"avatar_url":"https://avatars.githubusercontent.com/u/5141792?v=3","gravatar_id":"","url":"https://api.github.com/users/benjaminaaron","html_url":"https://github.com/benjaminaaron","followers_url":"https://api.github.com/users/benjaminaaron/followers","following_url":"https://api.github.com/users/benjaminaaron/following{/other_user}","gists_url":"https://api.github.com/users/benjaminaaron/gists{/gist_id}","starred_url":"https://api.github.com/users/benjaminaaron/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/benjaminaaron/subscriptions","organizations_url":"https://api.github.com/users/benjaminaaron/orgs","repos_url":"https://api.github.com/users/benjaminaaron/repos","events_url":"https://api.github.com/users/benjaminaaron/events{/privacy}","received_events_url":"https://api.github.com/users/benjaminaaron/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/benjaminaaron/SumoVizUnity/labels/bug","name":"bug","color":"fc2929"},{"url":"https://api.github.com/repos/benjaminaaron/SumoVizUnity/labels/TODO","name":"TODO","color":"0052cc"},{"url":"https://api.github.com/repos/benjaminaaron/SumoVizUnity/labels/unity","name":"unity","color":"bfe5bf"}],"state":"open","locked":false,"assignee":{"login":"benjaminaaron","id":5141792,"avatar_url":"https://avatars.githubusercontent.com/u/5141792?v=3","gravatar_id":"","url":"https://api.github.com/users/benjaminaaron","html_url":"https://github.com/benjaminaaron","followers_url":"https://api.github.com/users/benjaminaaron/followers","following_url":"https://api.github.com/users/benjaminaaron/following{/other_user}","gists_url":"https://api.github.com/users/benjaminaaron/gists{/gist_id}","starred_url":"https://api.github.com/users/benjaminaaron/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/benjaminaaron/subscriptions","organizations_url":"https://api.github.com/users/benjaminaaron/orgs","repos_url":"https://api.github.com/users/benjaminaaron/repos","events_url":"https://api.github.com/users/benjaminaaron/events{/privacy}","received_events_url":"https://api.github.com/users/benjaminaaron/received_events","type":"User","site_admin":false},"milestone":{"url":"https://api.github.com/repos/benjaminaaron/SumoVizUnity/milestones/1","html_url":"https://github.com/benjaminaaron/SumoVizUnity/milestones/Sprint1%20presentation","labels_url":"https://api.github.com/repos/benjaminaaron/SumoVizUnity/milestones/1/labels","id":1370643,"number":1,"title":"Sprint1 presentation","description":"","creator":{"login":"benjaminaaron","id":5141792,"avatar_url":"https://avatars.githubusercontent.com/u/5141792?v=3","gravatar_id":"","url":"https://api.github.com/users/benjaminaaron","html_url":"https://github.com/benjaminaaron","followers_url":"https://api.github.com/users/benjaminaaron/followers","following_url":"https://api.github.com/users/benjaminaaron/following{/other_user}","gists_url":"https://api.github.com/users/benjaminaaron/gists{/gist_id}","starred_url":"https://api.github.com/users/benjaminaaron/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/benjaminaaron/subscriptions","organizations_url":"https://api.github.com/users/benjaminaaron/orgs","repos_url":"https://api.github.com/users/benjaminaaron/repos","events_url":"https://api.github.com/users/benjaminaaron/events{/privacy}","received_events_url":"https://api.github.com/users/benjaminaaron/received_events","type":"User","site_admin":false},"open_issues":6,"closed_issues":6,"state":"open","created_at":"2015-10-22T15:22:54Z","updated_at":"2015-10-29T22:01:51Z","due_on":"2015-11-04T23:00:00Z","closed_at":null},"comments":0,"created_at":"2015-10-29T22:01:51Z","updated_at":"2015-10-29T22:01:51Z","closed_at":null,"body":"`Application.dataPath` as the function to give you the filepath to your assets doesn't work on Android, therefore we need alternatives to define the path to the three files we need to read in at runtime: \r\n- **IDmappings**\r\n- **.scenario**\r\n- **.trajectories**\r\n\r\nIn c0781c4 I changed the filepath logic to `Resources.Load` which was @zumbam's idea. I deleted the `Assets/data` folder completely and put the files into [`Resources/vadere_output`](https://github.com/benjaminaaron/SumoVizUnity/tree/master/Assets/Resources/vadere_output).\r\n\r\nSince `TextAsset` can unfortunately only read certain extensions, I renamed the `.scenario` file to `MyScenario_scenario.json` and the `.trajectories` file to `MyScenario_trajectories.txt`. The IDmappings file got a `.txt` instead of the `.config`. This adds an extra manual step in the process from vadere to unity, which is not nice but we can live with it :stuck_out_tongue_winking_eye: \r\n\r\nOne big pain point atm in my eyes is the lack of streamreading options for TextAssets. Because [this line](https://github.com/benjaminaaron/SumoVizUnity/blob/master/Assets/Helper/FileLoaderJSON.cs#L98) is really horrible for big trajectory files, we really should try to use a line by line reader here instead of a all-in-one reader.\r\n\r\nAn alternative to `Resources.Load` might be *Streaming Assets* which can also be used to render filepaths on Android correctly as it says [here](http://docs.unity3d.com/Manual/StreamingAssets.html).\r\n\r\nAnother alternative to loading the files as `TextAsset` would be to write our own asset types, than we have the best control over it. Not sure though if the effort is worth it.\r\n\r\nClosing this for now as we have a working solution for *Sprint1*. Might reopen this at a later stage."}}