Strict Standards: Non-static method utf_normalizer::nfc() should not be called statically in /www/htdocs/w006661d/anddev/includes/utf/utf_tools.php on line 1781
[phpBB Debug] PHP Notice: in file /bbc_download.php on line 73: Cannot modify header information - headers already sent by (output started at /includes/utf/utf_tools.php:1781)
[phpBB Debug] PHP Notice: in file /bbc_download.php on line 74: Cannot modify header information - headers already sent by (output started at /includes/utf/utf_tools.php:1781)
[phpBB Debug] PHP Notice: in file /bbc_download.php on line 75: Cannot modify header information - headers already sent by (output started at /includes/utf/utf_tools.php:1781)
[phpBB Debug] PHP Notice: in file /bbc_download.php on line 76: Cannot modify header information - headers already sent by (output started at /includes/utf/utf_tools.php:1781)
[phpBB Debug] PHP Notice: in file /bbc_download.php on line 77: Cannot modify header information - headers already sent by (output started at /includes/utf/utf_tools.php:1781)
[phpBB Debug] PHP Notice: in file /bbc_download.php on line 78: Cannot modify header information - headers already sent by (output started at /includes/utf/utf_tools.php:1781)
package com.cognizant.GFM2; import java.io.File; import java.net.URISyntaxException; import java.util.ArrayList; import java.util.Arrays; import java.util.Collections; import java.util.Iterator; import java.util.List; import android.app.AlertDialog; import android.app.ListActivity; import android.content.DialogInterface; import android.content.Intent; import android.content.DialogInterface.OnClickListener; import android.graphics.Color; import android.graphics.drawable.Drawable; import android.net.ContentURI; import android.os.Bundle; import android.view.KeyEvent; import android.view.View; import android.widget.ListView; public class GeneralizedFileManager2 extends ListActivity { private List directoryEntries = new ArrayList(); private List searchEntries = new ArrayList(); private File currentDirectory = new File("/"); private String folder_type; private static int checkWhichItem = 0; private boolean filter_dir = true; private boolean disable_onlistclick = false; /** Called when the activity is first created. */ @Override public void onCreate(Bundle icicle) { super.onCreate(icicle); setContentView(R.layout.main); Toolbar.setup(this); browseToRoot(); this.setTitleColor(Color.TRANSPARENT); searchFile(); } @Override public boolean onKeyUp(int keyCode, KeyEvent event) { switch (keyCode) { case KeyEvent.KEYCODE_DPAD_RIGHT: if (checkWhichItem > 4) { checkWhichItem = 0; } checkWhichItem++; searchFile(); return true; case KeyEvent.KEYCODE_DPAD_LEFT: checkWhichItem--; if (checkWhichItem < 0) { checkWhichItem = 4; } searchFile(); return true; } return false; } private void searchFile() { switch (checkWhichItem) { case 0: SearchForDirectory(getResources().getStringArray( R.array.fileEndingImage), "Image", checkWhichItem); break; case 1: SearchForDirectory(getResources().getStringArray( R.array.fileEndingAudio), "Audio", checkWhichItem); break; case 2: SearchForDirectory(getResources().getStringArray( R.array.fileEndingVideo), "Video", checkWhichItem); break; case 3: SearchForDirectory(getResources().getStringArray( R.array.fileEndingPackage), "Package", checkWhichItem); break; case 4: SearchForDirectory(getResources().getStringArray( R.array.fileEndingApp), "Android App", checkWhichItem); break; } } /** Calls the setNewFocus defined in Toolbar.java and sets the request to the appropriate icon. */ private void setNewFocus(int focus_id) { Toolbar.setNewFocus(focus_id); } /** * This function browses to the root-directory of the file-system. */ private void browseToRoot() { filterFiles(new File("/")); } private void browseTo(final File aDirectory) { if (!(aDirectory.isDirectory())) { OnClickListener okButtonListener = new OnClickListener() { // @Override public void onClick(DialogInterface arg0, int arg1) { try { // Lets start an intent to View the file, that was // clicked... Intent myIntent = new Intent( android.content.Intent.VIEW_ACTION, new ContentURI("file://" + aDirectory.getAbsolutePath())); startActivity(myIntent); } catch (URISyntaxException e) { e.printStackTrace(); } } }; OnClickListener cancelButtonListener = new OnClickListener() { // @Override public void onClick(DialogInterface arg0, int arg1) { // Do nothing } }; AlertDialog.show(this, "Question", "Do you want to open this file?\n" , "OK", okButtonListener, "Cancel", cancelButtonListener, false, null); } } /*Filters the unwanted dirs and passes the * rest and searches for the file types*/ private void filterFiles(final File aDir) { File[] filesAndDirs = aDir.listFiles(); List filesDirs = Arrays.asList(filesAndDirs); List updatedDir = new ArrayList(); if (filter_dir) { for (File file : filesDirs) { if (!((file.getPath().equals("/sys")) || (file.getPath().equals("/dev")) || (file.getPath().equals("/proc")) || (file.getPath() .equals("/etc")))) { updatedDir.add(file); } } } for (File file : updatedDir) { fillFiles(file); } } private List fillFiles(final File aDir) { this.currentDirectory = aDir; int currentDirectoryLength = this.currentDirectory.getAbsolutePath() .length(); File[] filesAndDirs = aDir.listFiles(); if (filesAndDirs != null) { List filesDirs = Arrays.asList(filesAndDirs); for (File file : filesDirs) { this.directoryEntries.add(file.getAbsolutePath().substring( currentDirectoryLength + 1)); if (file.isDirectory()) { fillFiles(file); } } } Collections.sort(this.directoryEntries); return this.directoryEntries; } /** * This will get the list of all the files * depending on the file type */ protected void SearchForDirectory(String[] searchText, String file_type, int file_type_no) { this.searchEntries.clear(); Drawable currentIcon = null; folder_type = file_type; for (String filetype : searchText) { for (Iterator iterator = directoryEntries.iterator(); iterator .hasNext();) { String type = (String) iterator.next(); if (type.contains(filetype)) { if (checkEndsWithInStringArray(type, getResources() .getStringArray(R.array.fileEndingImage))) { currentIcon = getResources().getDrawable( R.drawable.image); } else if (checkEndsWithInStringArray(type, getResources() .getStringArray(R.array.fileEndingPackage))) { currentIcon = getResources().getDrawable( R.drawable.packed); } else if (checkEndsWithInStringArray(type, getResources() .getStringArray(R.array.fileEndingAudio))) { currentIcon = getResources().getDrawable( R.drawable.audio); } else if (checkEndsWithInStringArray(type, getResources() .getStringArray(R.array.fileEndingApp))) { currentIcon = getResources().getDrawable( R.drawable.android); } else if (checkEndsWithInStringArray(type, getResources() .getStringArray(R.array.fileEndingVideo))) { currentIcon = getResources().getDrawable( R.drawable.video); } else { currentIcon = getResources().getDrawable( R.drawable.packed); } searchEntries.add(new IconifiedText(type, currentIcon)); } } if (!(this.searchEntries.isEmpty())) { IconifiedTextListAdapter itla = new IconifiedTextListAdapter( this); itla.setListItems(this.searchEntries); this.setListAdapter(itla); } else { disable_onlistclick = true; String no_match = "Sorry! No matches for " + folder_type; this.searchEntries.add(new IconifiedText(no_match, getCurrentIcon(file_type_no))); IconifiedTextListAdapter itlanomatch = new IconifiedTextListAdapter( this); itlanomatch.setListItems(this.searchEntries); this.setListAdapter(itlanomatch); } } /** This will set the focus of the icons whenever the LEFT or RIGHT Keypad are pressed. */ setNewFocus(checkWhichItem); } /** * This will get the current icon depending on the * file type. */ private Drawable getCurrentIcon(int file_type_no) { Drawable icon= null; switch (file_type_no) { case 0: icon= getResources().getDrawable( R.drawable.image); break; case 1: icon= getResources().getDrawable( R.drawable.audio); break; case 2: icon= getResources().getDrawable( R.drawable.video); break; case 3: icon= getResources().getDrawable( R.drawable.packed); break; case 4: icon= getResources().getDrawable( R.drawable.android); break; } return icon; } /** * Checks whether checkItsEnd ends with one of the Strings from fileEndings */ private boolean checkEndsWithInStringArray(String checkItsEnd, String[] fileEndings) { for (String aEnd : fileEndings) { if (checkItsEnd.endsWith(aEnd)) return true; } return false; } @Override protected void onListItemClick(ListView l, View v, int position, long id) { int selectionRowID = (int) this.getSelectionRowID(); File clickedFile = new File(this.currentDirectory.getAbsolutePath() + this.directoryEntries.get(selectionRowID)); if (clickedFile != null && !disable_onlistclick) { this.browseTo(clickedFile); } } }