Back to project page CopresenceDataCollector.
The source code is released under:
Copyright (c) 2014, Xiang Gao All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: * Re...
If you think the Android project CopresenceDataCollector listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.
package org.sesy.coco.datacollector.file; /*from w ww.jav a2 s .c om*/ import java.io.File; import java.io.FileInputStream; import java.io.FileOutputStream; import java.nio.channels.FileChannel; import android.content.Context; import android.os.Environment; import android.provider.Settings.Secure; import android.util.Log; public class FileHelper { private Context _context; private String root; private String uuid; public FileHelper(Context context){ this._context = context; this.root = ""; this.uuid = ""; } public String getDir(){ uuid = Secure.getString(_context.getContentResolver(),Secure.ANDROID_ID); root = Environment.getExternalStorageDirectory().getPath() + "/DC" + uuid; File f = new File(root); if(!f.exists()){ buildDir(); } return root; } public boolean buildDir(){ File dir = new File(root); boolean success = dir.mkdir(); return success; } }