0

I want to produce .patt files of augmented reality marker dynamically and at run-time. In the AndAR Library .patt files must be in the asset folder. But since I generate these files in my Android program at run-time, I cannot save them in asset folder. (Because the folder becomes read-only at run-time.) How must I change the AndAR to read .patt files from sdcard? My problem is that AndAR library searches the asset folder to find .patt files by default, but I want AndAR search another location.

Opux
  • 702
  • 1
  • 10
  • 30
saeede
  • 117
  • 1
  • 9
  • Have you did dynamic generation of pattern file? I mean are you know that how to generate pattern file. Because I need only square image, means if I would point to any of the object my app will run. So can you please help me?? – Pratik Dasa Oct 07 '13 at 10:18

1 Answers1

0

You should add WRITE_EXTERNAL_STORAGE permission to your Android_Manifest.xml then you can write and read from sdcard but be careful, you should test if you can write to external before writing anything to make sure you are actually writing to SDcard. Other than eveyrthing is same as just regular Java io coding

<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" /> 
mgokgoz
  • 186
  • 1
  • 9
  • thanks MR mgokgoz,but my problem is not which you think,my problem is that AndAR library search asset folder to find .patt file defaultly .but I want AndAR search another location. – saeede Sep 16 '13 at 14:35
  • I was reading my config file from SD without no-problem. Could you show your code where you try to read/write .patt files? – mgokgoz Sep 17 '13 at 08:21
  • I could not see any code in AndAR library that show read/write from asset.this library defaultly do it. my source code is in http://github.com/RaghavSood/ProAndroidAugmentedReality chapter8 – saeede Sep 17 '13 at 13:49
  • This is what you did or what you are using for project. There is SDCardFileUtil class to get buffered reader or bitmap file which I think should work. I think you are using AssetsFileUtility instead which is only looking assets folder in project. – mgokgoz Sep 18 '13 at 06:51
  • these class are used to read model from sdcard or asset folder,But I dont know where it read .patt files.I think AndAR defaultly search asset folder. – saeede Sep 19 '13 at 07:24
  • How you use AndAR for patt files. Can't you read files externally then use objects that read patt files with AndAR lib? – mgokgoz Sep 19 '13 at 07:27
  • if you see model viewer class,the assetsFileUtility and sdCardutility are used to read the object that must augment on marker.I dont find where marker pattern is reading in this code... – saeede Sep 22 '13 at 17:47