Hi,
So, i solved the 80% of the problem, now when debugging i have all the path
to the settings.dat:
/data/data/acrburant.android.com/files/settings.dat
However, i'm facing a problem when writing the file to the SDCARD. I have
permission denied and "SDCARD not mounted" exception.
Here is the code:
File sdCard = Environment.getExternalStorageDirectory();
if(!Environment.getExternalStorageState().equals(Environment.MEDIA_MOUNTED))
{
Log.d("Carburant", "Sdcard was not mounted !!" );
}
else
{
File nmea_file;
File root = Environment.getExternalStorageDirectory();
FileWriter nmea_writer = null;
try {
nmea_file = new File(root,"settings.dat");
if(!nmea_file.exists()) {
Log.w("Carburant", "File Doesn't Exists!");
nmea_file.createNewFile();
}
copyfile(nom,sdCard.getAbsolutePath() + nmea_file);
}
catch (IOException e)
{
Log.w("Carburant", "Unable to write", e);
}
finally
{
if (nmea_writer != null)
{
try
{
nmea_writer.close();
}
catch (IOException e)
{
Log.w("Carburant", "Exception closing file", e);
}
}
}
}
}
I well added this line : <uses-permission
android:name="android.permission.WRITE_EXTERNAL_STORAGE" /> to the
androidmanifest.xml.
I hope that i well did my homework.
Thank you for your help.
2011/4/4 TreKing <[email protected]>
> On Mon, Apr 4, 2011 at 2:23 PM, Alaeddine Ghribi <
> [email protected]> wrote:
>
>> I readed and i'm reading all this docs! i just can't find the right
>> function to use! you are just send links and "google "JAVA IO" without any
>> precision!
>>
>
> Once again, the functions to use are at the link I posted. The only thing
> Android related about your problem is how to get to the root directory for
> the files you want to manipulate. Beyond that, it's strictly Java IO. So
> that's where you need to do your homework.
>
>
>> I think that you are becoming angry now!
>>
>
> I'm really not though I'm a little over the top. I just don't know how many
> times I can repeat the same information in a single thread.
>
>
> -------------------------------------------------------------------------------------------------
> TreKing <http://sites.google.com/site/rezmobileapps/treking> - Chicago
> transit tracking app for Android-powered devices
>
> --
> You received this message because you are subscribed to the Google
> Groups "Android Developers" group.
> To post to this group, send email to [email protected]
> To unsubscribe from this group, send email to
> [email protected]
> For more options, visit this group at
> http://groups.google.com/group/android-developers?hl=en
>
--
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en