how to view data stored in sdcard in emulator itself?

Go To StackoverFlow.com

1

i have an app which stores data in app databse...and i wrote code to send the app data to sdcard created in emulator... the data file has been transferred to sd card and i can view that in eclipse...but how can i see that file in emulator??where it get saved??

the code which i used to tranfer is below

         try 
                        {
                            File sd = Environment.getExternalStorageDirectory();
                            File data = Environment.getDataDirectory();

                            if (sd.canWrite()) 
                            {
                                String currentDBPath = "\\data\\sharath.android.trail\\databases\\griet1";
                                String backupDBPath = "sdcard_db";
                                File currentDB = new File(data, currentDBPath);
                                File backupDB = new File(sd, backupDBPath);

                                if (currentDB.exists()) {
                                    FileChannel src = new FileInputStream(currentDB).getChannel();
                                    FileChannel dst = new FileOutputStream(backupDB).getChannel();
                                    dst.transferFrom(src, 0, src.size());
                                    src.close();
                                    dst.close();
                                }
                                boolean bool=true;
                                if(bool == true)
                                {
                                    Toast.makeText(Trial1Activity.this, "Backup Complete", Toast.LENGTH_SHORT).show();
                                    bool = false;
                                }
                            }               
                        } 
                        catch (Exception e) {
                            Log.w("Settings Backup", e);
                        }
                    }

thanks in advance

2012-04-05 19:52
by Sharath Vollala


1

If you're working in Eclipse, there is a built in File Explorer in the Android plugin. You can access it by going

Window > Show View... > Other > Android > File Explorer

2012-04-05 19:56
by Jwc24678
thanks for ur reply...my query is how to go that file in emulator itsel - Sharath Vollala 2012-04-05 20:14
actually i have to attach that file which got saved in sdcard to a mail...how can i got that path when i have to attach the file in android mobile - Sharath Vollala 2012-04-05 20:17
As far as I know, there is no "File Explorer" app that comes on the emulator. This would make it not possible to view the file on the emulator itself unless you installed some file explorer or had an app that could open it - Jwc24678 2012-04-06 16:00
ya...ur answer is very tru - Sharath Vollala 2012-04-06 17:40
Ads