Uploading and downloadingdata to a directory on a server.

by bigauto » Fri, 13 Mar 2009 10:25:01 GMT


Sponsored Links
 Hi, I was wondering if there is a simple way to upload and download
data to and from a directory in a server. If I have load and download
from a directory at  http://server.com/filedir , How should I go about
sending the data to a server and giving it a name so that I could
download the same data later? I wrote a method before with java that
saves an arraylist to and from my own pc like this

String filename = "userlist.dat";
                String directory = "dat";

                FileOutputStream fos = null;
                ObjectOutputStream out = null;

                try {
                        fos = new 
FileOutputStream(directory+File.separator+filename);
                        out = new ObjectOutputStream(fos);
                        out.writeObject(userlist); /////The arrayList 
(userlist) I wanted
to save
                        out.close();
                        fos.close();
                }
                catch(IOException ex){
                        System.out.println("saving list error");
                }

I was wondering if there is a similar method as that.
--~--~---------~--~----~------------~-------~--~----~



Other Threads

1. Emulator with disabled camera still has camera?

Hi!

I want to test that my app behaves correctly without camera support but I 
have no device without camera. So I created a avd with Camer support set to 
no. 

However when I run the emulator this call still returns true

public boolean hasCamera() {
        PackageManager packageManager = application.getPackageManager();
        return 
packageManager.hasSystemFeature(PackageManager.FEATURE_CAMERA);
    }

Is this a bug in the emulator that I should report or am I missing 
something?

thx

manfred

-- 

2. How to connect mysql with android

Basic steps for connecting Mysql with Android sdk

-- 

3. WTDiskusi

4. Honeycomb + Motodev's Xoom add-on - does not work

5. [WTS] Samsung Galaxy S i9000 16Gb

6. slidingdrawer problem

7. [WTS]DROID GLOBAL HARGA MANTAB