FTP Download in Android Extremely Slow (Fast in just Java)

I am downloading MP3 files from an FTP server. It is for an Android application which will download and the then play the MP3 files. The downloading is implemented in Java using apache commons library and the code is largely based on another tutorial. The download works very fast on my desktop running Java taking about 5 seconds to download a file which is ~10mb, but on the same code run on an Android device (I have tried 2) is ridiculously slower taking 5-10 minutes to download the same file. (Both tests were done over Wifi).

Code based on: http://androiddev.orkitra.com/?p=28&cpage=2#comment-40

The code below shows the two methods used: connect and download.

    public boolean connect(String host, String username, String pass, int port){
    try{

        mFTPClient.connect(host, port);

        if(FTPReply.isPositiveCompletion(mFTPClient.getReplyCode())) {
                boolean loginStatus = mFTPClient.login(username,  pass);

                mFTPClient.setFileType(FTP.BINARY_FILE_TYPE);
                mFTPClient.enterLocalPassiveMode();
                mFTPClient.setKeepAlive(true);

                return loginStatus;
        }


    } catch (Exception e){
        System.err.println("Error: Could not connect to: " + host);
        e.printStackTrace();
    }

    return false;
}

    public boolean download(String srcFilePath, String dstFilePath) {
    boolean downloadStatus = false;
    try {
        FileOutputStream dstFileStream = new FileOutputStream(dstFilePath);
        downloadStatus = mFTPClient.retrieveFile(srcFilePath,   dstFileStream);
        dstFileStream.close();
        return downloadStatus;
    } catch (Exception e) {
        System.err.println("Error: Failed to download file from " + srcFilePath + " to " + dstFilePath);
    }
    return downloadStatus;
}

Hopefully I have mentioned all the details needed and would appreciate if anyone could explain why it is so much slower and how if at all I can make it download in a reasonable time.

Installing mcrypt extension for PHP on OSX Mountain Lion

Apologies in advance for the potential n00b questions, I am trying to install the mcrypt extension for PHP on my OSX Mountain Lion machine.

The following steps in terminal is what I have done so far to achieve my PHP install

cd /path/to/downloaded/php-5.3.21/ext/mcrypt/
/usr/bin/phpize
./configure
cd /path/to/downloaded/php-5.3.21
./configure --with-config-file-path=/private/etc/php.ini --with-apxs2=/usr/sbin/apxs
make
sudo make install

Which seems to work well and installs PHP 5.3.21 fine. I have then done

sudo nano /private/etc/php.ini

And included

extension=mcrypt.so

Along with an Apache restart, phpinfo() doesn't show that the mcrypt extension is loaded.

I then tried to specify the extension_dir inside php.ini, again with no luck.

I have done

locate mcrypt.so
/opt/local/lib/php/extensions/no-debug-non-zts-20090626/mcrypt.so
/usr/local/Cellar/php53-mcrypt/5.3.18/mcrypt.so

And tried both directories as the extension_dir, with no luck.

I have also tried the following, after much Googling

./configure --with-config-file-path=/private/etc/php.ini --with-apxs2=/usr/sbin/apxs --with-mcrypt

Which seems to work OK, but then upon "make", it returns

ext/mcrypt/mcrypt.o: No such file or directory
ext/mcrypt/mcrypt_filter.o: No such file or directory

Again, no success.

What am I doing wrong? It seems like the physical compile of mcrypt.so is not happening, or is compiling incorrectly as I would suspect there to be another mcrypt.so found under locate?

Anyone please help? I've gone through pages upon pages of Google searches with no luck!

Adding a user on .htpasswd

I am using .htpasswd to password protect certain directory on my server. However, I noticed that everytime I do this sudo htpasswd -c /etc/apache2/.htpasswd newuser my current contents of .htpasswd will be overwritten. Every directory of my site has their own user on .htpasswd.

How can I not overwrite instead add a new user on my .htpasswd?

Running Node.js in apache?

We have an Apache Webserver installed on a machine which also serves pages using Perl.

For a project I've decided to use Node.js instead of Perl/Ruby. Just wondering if it's possible to use Apache as my webserver (so it serves the pages) and use Node.js to dynamically create the web pages (this is for a web app I am creating)?

So in other words can they work hand in hand just like Apache/Perl or Apache/PHP etc..

Apache won’t run in xampp

I have just installed XAMPP and everything works fine except that I can't get apache to run. It seems that port 80 is the problem, I have disabled Skype to use port 80 but it doesn't seem to fix it. I read somewhere that the SSL port can be the problem and should be changed. But I cant figure out were the port is or how to change it.

"Check the "/xampp/apache/logs/error.log" file"

I have tried to check this file but inside "logs" there isn't anything. From apache I can go to error but there is not any recently changed documents.

The error:

20:34:24  [Apache]  Problem detected!
20:34:24  [Apache]  Port 80 in use by "system"!
20:34:24  [Apache]  Apache WILL NOT start without the configured ports free!
20:34:24  [Apache]  You need to uninstall/disable/reconfigure the blocking application
20:34:24  [Apache]  or reconfigure Apache to listen on a different port

20:40:50  [Apache]  Attempting to start Apache app...
20:40:50  [Apache]  Status change detected: running
20:40:51  [Apache]  Status change detected: stopped
20:40:51  [Apache]  Error: Apache shutdown unexpectedly.
20:40:51  [Apache]  This may be due to a blocked port, missing dependencies, 
20:40:51  [Apache]  improper privileges, a crash, or a shutdown by another method.
20:40:51  [Apache]  Check the "/xampp/apache/logs/error.log" file
20:40:51  [Apache]  and the Windows Event Viewer for more clues

How to I fix these errors?