I'm using this code to use photoSphere in my android app:
@Override
public void onConnected(Bundle connectionHint) {
uri = Uri.parse("android.resource://" + getPackageName() + "/" + R.raw.mu1);
mClient.loadPanoramaInfo(this, uri);
}
and it works as intended. But when I tried to load a the same file from another path it failed and I don't know why..Do anyone have any idea why is this happening?
this it the code I use..:
@Override
public void onConnected(Bundle connectionHint) {
Uri uri = Uri.parse(MyApplication.getPhotoStorage()+"/mu1.jpg");
mClient.loadPanoramaInfo(this, uri);
}
At first I thought the uri is wrong but then I used it to create a file and checked its size, and was as intended. I'd really appreciate any help
Ok I figured it out. Don't know why but apparently this wasn't the correct Uri of the file.so in order to get the uri I used this function on the file
Uri uri = Uri.fromFile(file);
and it worked like a charm.Hopefully I'll help anyone that stumbles upon this post