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 /includes/session.php on line 1007: Cannot modify header information - headers already sent by (output started at /includes/utf/utf_tools.php:1781)
[phpBB Debug] PHP Notice: in file /includes/session.php on line 1007: Cannot modify header information - headers already sent by (output started at /includes/utf/utf_tools.php:1781)
[phpBB Debug] PHP Notice: in file /includes/session.php on line 1007: Cannot modify header information - headers already sent by (output started at /includes/utf/utf_tools.php:1781)

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 /includes/functions.php on line 4362: Cannot modify header information - headers already sent by (output started at /includes/utf/utf_tools.php:1781)
[phpBB Debug] PHP Notice: in file /includes/functions.php on line 4364: Cannot modify header information - headers already sent by (output started at /includes/utf/utf_tools.php:1781)
[phpBB Debug] PHP Notice: in file /includes/functions.php on line 4365: Cannot modify header information - headers already sent by (output started at /includes/utf/utf_tools.php:1781)
[phpBB Debug] PHP Notice: in file /includes/functions.php on line 4366: Cannot modify header information - headers already sent by (output started at /includes/utf/utf_tools.php:1781)
anddev.org • View topic - Save files to internal memmory?

Save files to internal memmory?

All your problems with Audio, Video and Images.

Save files to internal memmory?

Postby cruisx » Fri Apr 29, 2011 4:57 pm

Hey guys, I have a situation. Can someone tell me how to save files to the internal memory where it can be publically accesssed by any other program? I could save it to the sdcard but not everyphone has one. Im downloading a file from the web ( 500kb in size)

Code: Select all
public void Download()
     {
        try {
             //this is the file you want to download from the remote server
             String path ="http://dl.dropbox.com/u/27634579/file.bin";
             //this is the name of the local file you will create
             String targetFileName;
                 boolean eof = false;
             URL u = new URL(path);
             HttpURLConnection c = (HttpURLConnection) u.openConnection();
             c.setRequestMethod("GET");
             c.setDoOutput(true);
             c.connect();
            
             FileOutputStream f = new FileOutputStream(new File("/data/data/file.bin"));
                 InputStream in = c.getInputStream();
                 byte[] buffer = new byte[1024];
                 int len1 = 0;
                 while ( (len1 = in.read(buffer)) > 0 ) {
                 f.write(buffer,0, len1);
                          }
             f.close();
             } catch (MalformedURLException e) {
             // TODO Auto-generated catch block
             e.printStackTrace();
             } catch (ProtocolException e) {
             // TODO Auto-generated catch block
             e.printStackTrace();
             } catch (FileNotFoundException e) {
             // TODO Auto-generated catch block
             e.printStackTrace();
             } catch (IOException e) {
             // TODO Auto-generated catch block
             e.printStackTrace();
         }

     }
cruisx
Freshman
Freshman
 
Posts: 2
Joined: Fri Apr 29, 2011 4:52 pm

Top

Return to Multimedia Problems

Who is online

Users browsing this forum: No registered users and 7 guests