Click here to Skip to main content
15,889,556 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Greetings,

I've developed an app for android, but am stuck on a problem.

When using my app normal, the activity starts up, and this starts the service as well. The data it records during use gets saved to the SD card, and on closing the app it does so as well and stops the service.

Now, the problem is when I'm using the internet-connection on the phone using tethering/hotspot to get my laptop on line, the app wont write the data to the app.

I've set the permissions to read/write on the SD card.

Sample code saving data:
C#
using (StreamWriter FileWriter = new StreamWriter(Filepath, true))
            {
                FileWriter.WriteLine(Current.StartTime);
                FileWriter.WriteLine(Current.FinishTime);
                FileWriter.WriteLine(Current.Action);
            }


Only my service reads/writes on the SD. Reading is same as above using
C#
StreamReader
over
C#
StreamWriter


The broadcaster and receivers are working both ways between the activity and the service.

The app itself does not require an internet connection.

Can someone explain why I cant write to SDcard when tethering/hotspot is active?
Posted

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900