Thingse/app/src/main/java/com/daneshzaki/thingse/Preferences.java
/*
	 * This method reads content from a file
	 * 
	 * */
This method reads content from a file
This method reads content from a file
private String[] readContentFromFile(String fileName)
    {	
    	ArrayList <String> list = new ArrayList <String> ();
    	try
    	{
			BufferedReader reader = new BufferedReader(new FileReader(Environment.getExternalStorageDirectory().getAbsolutePath() + File.separator + fileName));
			String tmp ="";
			while((tmp=reader.readLine())!=null)
			{
				list.add(tmp);
			}
			reader.close();
    	}
    	catch (IOException e)
    	{
    		Log.e("Preferences", e.getMessage(), e); 
    		e.printStackTrace();
    	}    	    	
		return Arrays.copyOf(list.toArray(), list.toArray().length, String[].class);	
    }
private String [ ] readContentFromFile ( String fileName ) { ArrayList < String > list = new ArrayList < String > ( ) ; try { BufferedReader reader = new BufferedReader ( new FileReader ( Environment . getExternalStorageDirectory ( ) . getAbsolutePath ( ) + File . separator + fileName ) ) ; String tmp = "" ; while ( ( tmp = reader . readLine ( ) ) != null ) { list . add ( tmp ) ; } reader . close ( ) ; } catch ( IOException e ) { Log . e ( "Preferences" , e . getMessage ( ) , e ) ; e . printStackTrace ( ) ; } return Arrays . copyOf ( list . toArray ( ) , list . toArray ( ) . length , String [ ] . class ) ; }
This method reads content from a file
This method reads content from a file
//read from the file //BufferedReader reader = new BufferedReader(new FileReader(getDir("",MODE_WORLD_WRITEABLE).getAbsolutePath()+fileName));