Private Storage with App2sd.

by Nathan » Fri, 20 May 2011 05:05:32 GMT

Sponsored Links
 I found this message about App Install location:

"The .apk file is saved on the external storage, but all private user
data, databases, optimized .dex files, and extracted native code are
saved on the internal device memory"

Based on this, I believe it is a bad idea to place anything large
(meaning more than a few megabytes), as a private storage file.

ie, if I call

openFileOutput(FILENAME, Context.MODE_PRIVATE);

It should be only for little files. If a user moves their app to the
SD Card, it doesn't really give them any more room for these files.

For anything else, I should plan on it being on the storage card, and
open to the public.

Am I right?



Re: Private Storage with App2sd.

by Mark Murphy » Fri, 20 May 2011 05:11:23 GMT


Yes. IOW, having the app installed on external storage has no effect
on files created on openFileOutput().

Mark Murphy (a Commons Guy)  |  | 

Android 3.0 Programming Books: 


Sponsored Links

Other Threads

1. Fwd: Info required on call to onLocationChanged() functionality.

         I am developing a GPS based application, and for my application I
need to get the current location, and also need to update the UI as and when
the location changes. So for that I am using Location Manager and location
listener package as follows,

public class HelloMapViewSec extends MapActivity

 public void onCreate(Bundle savedInstanceState)
        LocationManager lm = (LocationManager)
  myLocationListener = new MyLocationListener();
  lm.requestLocationUpdates(LocationManager.GPS_PROVIDER, 0, 0,
  Location myLocation = lm.getLastKnownLocation("network"); //using "gps"
returned NULL
  if(myLocation != null)
   lat =  myLocation.getLatitude() * 1E6;
   lng =  myLocation.getLongitude() * 1E6;
   GeoPoint point = new GeoPoint(lat.intValue(),lng.intValue());
   //And had an overlay to point in MapView

 //MyLocationListener Class defined for instantiating a location listener
    private class MyLocationListener implements LocationListener
        public void onLocationChanged(Location loc)
            if (loc != null)
                    "Location changed : Lat: " + loc.getLatitude() +
                    " Lng: " + loc.getLongitude(),

        public void onProviderDisabled(String provider) {
            // TODO Auto-generated method stub
         System.out.println("GPS : Provider Disabled" + provider);

        public void onProviderEnabled(String provider) {
            // TODO Auto-generated method stub
         System.out.println("GPS : Provider Enabled" + provider);

        public void onStatusChanged(String provider, int status,
            Bundle extras) {
            // TODO Auto-generated method stub
         System.out.println("GPS : Status Changed to " + provider + "[" +
status + "]");

I am able to get the current user details using the above code, but I am not
able to see the LocationListener's onLocationChanged() functionality getting
called within a distance coverage of 10/100m. I have tried by changing the
minDistance parameter of lm.requestLocationUpdates() from 10 to 100, but
still I dont see any quick response. I need a call to LocationListener's
onLocationChanged() functionality within 10/100m so that I can do
speed/distance calculations.
On further analysis I saw that the onLocationChanged() will be called on a
500m change only.
How can I make the a call to LocationListener's onLocationChanged()
functionality within 10/100m travel?
If not possible then is there any alternate method/means for calculating the
speed/distance travelled by user?

Thanks and regards,


2. resources variable


I have a general question about pass in the resource variable:

when i reference a string type, it's posible to do it this way

Toast.makeText(this, R.string.app_error, Toast.LENGTH_LONG).show();

or this way (instance by using getResources method):

Resources myResources = getResources();
CharSequence styledText = myResources.getText(R.string.stop_message);

But when it's an Array, only the second method is possible:

String[] stringArray;
stringArray = myResources.getStringArray(R.array.string_array);

Why it's not possible to reference an Array using the code line?

String[] stringArray;
stringArray = R.array.string_array;



3. How to use GPS receiver in Gphone

4. Long boot for emulator.. avoid restart?

5. Newbie needs help Updating my ADP1

6. Flash animation, question.

7. Help regarding facebook integration applicaiton