Go Back   Android Forums > Android Development > Application Development

Application Development Dev Lounge for the Coder Folks



Reply
 
LinkBack Thread Tools
Old February 12th, 2010, 04:53 PM   #1 (permalink)
New Member
 
Join Date: Jan 2010
Posts: 3
 
Device(s):
Thanks: 0
Thanked 0 Times in 0 Posts
Question Writing files to system directory

Hello Devs,
I am trying to write data to a system file located in /data/misc/wifi/wpa_suppant.conf using this code.

Code:
       try {
            Runtime.getRuntime().exec("su");
            File root = Environment.getExternalStorageDirectory;
            File root = new File("/data/misc/wifi/");
            if (root.canWrite()){
                File textFile = new File(root + "wpa_supplicant.conf");
                boolean append = true;
                        FileWriter textWriter = new FileWriter(textFile, append);
                BufferedWriter out = new BufferedWriter(textWriter);
                
                out.write("network");
                out.flush();
                out.close();
                } catch (IOException e) {
        }
But i get no output. My phone is rooted so that is not the issue. Any suggestions?

Swiftwork is offline  
Reply With Quote
Sponsors
Old February 12th, 2010, 09:52 PM   #2 (permalink)
New Member
 
Join Date: Feb 2010
Posts: 4
 
Device(s):
Thanks: 0
Thanked 0 Times in 0 Posts
Default

/system filesystem probably was mounted as read only. you will need to remount to write to it if that's the case
hayaku is offline  
Reply With Quote
Old February 12th, 2010, 09:57 PM   #3 (permalink)
New Member
 
Join Date: Feb 2010
Posts: 4
 
Device(s):
Thanks: 0
Thanked 0 Times in 0 Posts
Default

also, you should output the exception so you can see what it's complaining about
hayaku is offline  
Reply With Quote
Reply

Bookmarks

Tags
access, android, app, application, dev, development, file, problem, root, system, wifi


Go Back   Android Forums > Android Development > Application Development User CP
Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Installing .apk in system/app directory Super_Grinch Droid - All Things Root 12 March 29th, 2011 12:40 PM
Support Full backup of system directory andyo70 LG Optimus M 13 March 1st, 2011 02:05 AM
Writing to /system/fonts after root isoelectric Incredible - All Things Root 9 July 2nd, 2010 08:52 PM
How to access /data/system directory from application Nemesis23 Developer 101 1 June 10th, 2010 06:36 PM
About system directory remount.. w.s.choi Application Development 0 June 7th, 2010 03:03 AM



All times are GMT -5. The time now is 01:29 AM.
Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2012, vBulletin Solutions, Inc.
Custom vBulletin Skins by: Relivo


SEO by vBSEO 3.3.2 ©2009, Crawlability, Inc.