Search Results

Search found 3 results on 1 pages for 'ankuj'.

Page 1/1 | 1 

  • Folder not created by app in android

    - by Ankuj
    I am creating a folder through my app File direct_playlist = new File(Environment.getExternalStorageDirectory().getAbsolutePath() + File.separator + PLAYLIST_PATH); if(!direct_playlist.exists()) { if(direct_playlist.mkdir()); //directory is created; } Even though the command executes perfectly I can not see the folder in Explorer. I have also given permission to my app in the manifest.xml <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/> When I try to access this folder my app crashes as the folder is not present.

    Read the article

  • Crash in C++ Code

    - by Ankuj
    I am trying to list all files in a directory recursively. But my code crashes without giving any error. When the given file is directory I recursively call the function or else print its name. I am using dirent.h int list_file(string path) { DIR *dir; struct dirent *ent; char *c_style_path; c_style_path = new char[path.length()]; c_style_path = (char *)path.c_str(); dir = opendir (c_style_path); if (dir != NULL) { /* print all the files and directories within directory */ while ((ent = readdir (dir)) != NULL) { if(ent->d_type == DT_DIR && (strcmp(ent->d_name,".")!=0) && (strcmp(ent->d_name,"..")!=0)) { string tmp = path + "\\" + ent->d_name; list_file(tmp); } else { cout<<ent->d_name<<endl; } } closedir (dir); } else { /* could not open directory */ perror (""); return EXIT_FAILURE; } delete [] c_style_path; return 0; } I am not getting as to what I am doing wrong here. Any clues ?

    Read the article

  • Async Task in a loop

    - by Ankuj
    How does one create an AsyncTask which keeps running itself after a fixed interval of time. For eg. get data from server every 5 minutes and give notification to caller thread that it has received the data. I searched on the forum but could not find much. What I have gathered so far is that 1) A UI thread will call AsyncTask 2) onPrExecute for UI thread access before executing 3) OnPostExecute for UI thread access after executing I dont need to show any progress update to the user. Also, the task will be destroyed when the app closes. Any tutorial for this will he helpful

    Read the article

1