1

I've been trying to make sense out of ADF data by exporting it from the demo apps. However, when I try to perform the export it complains about no having ADF permissions. I'm calling the export routine right after REQUEST_TANGO_PERMISSION but I'm still unable to read the ADFs.

I went to the online docs but I wasn't able to find the name of this permission request intent. Does anybody know how to request this? Since it is intent based I'm assuming it should be requested in the same way that the main REQUEST_TANGO_PERMISSION.

Thanks for your help

Cristhopper

kriztho
  • 300
  • 2
  • 14

2 Answers2

0

Check permissions of the demo apps with the classes that you're trying to access. And if not that, just show me some code so that the community can help you figure out your problem. Because as of right now that's all I can think of.

Jack_9
  • 1
  • 4
0

You should call a intent to export/import the adfs, the intent you called need to specify the target location or ADF's uuid. Please take a look of the doc here (import/export section)

private static final String INTENT_CLASSPACKAGE = "com.projecttango.tango";
private static final String INTENT_IMPORTEXPORT_CLASSNAME = "com.google.atap.tango.RequestImportExportActivity";
// startActivityForResult requires a code number.
private static final String EXTRA_KEY_SOURCEUUID = "SOURCE_UUID";
private static final String EXTRA_KEY_DESTINATIONFILE = "DESTINATION_FILE";
Intent exportIntent = new Intent();
exportIntent.setClassName(INTENT_CLASSPACKAGE, INTENT_IMPORTEXPORT_CLASSNAME);
exportIntent.putExtra(EXTRA_KEY_SOURCEUUID, mUUIDList[info.position]);
exportIntent.putExtra(EXTRA_KEY_DESTINATIONFILE, mAppSpaceADFFolder);
thisActivity.startActivityForResult(exportIntent, Tango.TANGO_INTENT_ACTIVITYCODE);
xuguo
  • 1,816
  • 1
  • 11
  • 15
  • Thanks! This is exactly what I was looking for and I overlooked it when I was going through the doc. – kriztho Nov 07 '14 at 00:52
  • Jason Guo, how can I have access to the uuid if it's not through uuids = mTango.listAreaDescriptions(); I've been trying to use the intent way and even though the docs say that there shouldn't be any special permission to use exportAreaDescriptionFile(), I'm still unable to do it. It still complains about the permission. – kriztho Nov 07 '14 at 17:57
  • I'm not able to perform the exportAreaDescriptionFile() but even though the device prompts for that permission the file doesn't get writen to the sdcard. I'm doing the following: File f = Environment.getExternalStoragePublicDirectory(Environment.DIRECTORY_DOWNLOADS); File file = new File(f, "file.adf"); mTango.exportAreaDescriptionFile(uuid, file.getAbsolutePath()); Do yo know why might be going wrong? – kriztho Nov 07 '14 at 20:04
  • @kriztho exportAreaDescriptionFile() is actually a deprecate functions, you shouldn't use that any more. Now the export and import is being handle through the intent. That means, for example, you want to export a ADF, you call exportIntent.putExtra(EXTRA_KEY_SOURCEUUID, uuid); to specify the uuid you want to export. Then call exportIntent.putExtra(EXTRA_KEY_DESTINATIONFILE, target_path); to specify the path. And call the intent. After user give the permission, tango_core will move the ADF to the path you provided. If user deny the permission, then nothing will happen.. – xuguo Nov 07 '14 at 21:59
  • Thanks for the explanation. And I apologize for going back to the matter again. I have done everything you indicated and I'm still unable to write the file to the system. I did notice, however, that I keep on getting an Error message on the logcat that says VersionCode 2705. Do you think this might have something to do why I'm unable to export and effectively write the file to the external storage? I've been providing a directory path and also a file absolute path and still no results. – kriztho Nov 10 '14 at 19:03