FTP Tests via the Emulator

Bradley James Marks

Member
Licensed User
Longtime User
All,

I just purchased Basic4Android. I am trying to conducts some FTP tests.

Is it possible to test FTP functions via the emulator? I keep running into problems.

Thanks,
Brad
 

Bradley James Marks

Member
Licensed User
Longtime User
I added "PassiveMode = True" and FTP.List now works nicely via emulation mode. (One step forward!!!)

I would now like to get "FTP.DownloadFile" to work in emulation mode.

I copied one of the examples in the B4A documentation as shown on the next line.


FTP.DownloadFile("JobControlRecord1.txt" , False , File.DirRootExternal , "B4ADdown.txt")

I am now receiving this error

LastException.Message = java.io.FileNotFoundException: /mnt/sdcard/B4ADdown.txt (Permission denied)

I would guess that the parameter "File.DirRootExternal" is generating the "/mnt/sdcard/" in the path.

I currently do not have access to a real Android device, so my FTP testing is limited to emulation mode.

Is there a way to get FTP.Download to work in emulation mode?

Thanks,
Brad Marks
 
Upvote 0

Bradley James Marks

Member
Licensed User
Longtime User
Erel,

Thanks for your assistance.

No, I had not configured the emulator to have a SD card.

I tried to do so and kept receiving an error.

I then did some more digging and stumbled upon the "mksdcard" utility.

http://www.b4x.com/android/wiki/index.php/AVD

I tried this utility as described here
http://developer.android.com/tools/help/mksdcard.html

From a DOS prompt, I keyed in the command as shown on this page.

When I do this, it keeps echoing back to me the "usage" info for the mksdcard utility.

I must be missing something.

Thanks,
Brad
 
Upvote 0

Bradley James Marks

Member
Licensed User
Longtime User
Erel,

Thanks for your assistance.

I set up a new AVD with Size=9MiB. When I tried "Start", I received a message "Failed to allocate memory :8"

I then set up another AVD pointing at a file instead of using the "Size" option. When I tried "Start" for this AVD, I received this message "###Warning SD Card File Must be at Least 9mb, ignoring C:\SD.img Failed to allocate Memory :8"

I am currently away from home and do not have access to a real device. We are driving home today and I hope to be able to test with a real device tonight. Still, I can see where it would be handy to be able to test with a virtual device in the future, so I would like to get things working with AVDs.

Thanks again.

Sincerely,
Brad Marks
 
Upvote 0

Bradley James Marks

Member
Licensed User
Longtime User
Erel,

I tried 16mb and again received the "Failed to allocate memory error" with the AVD.

However, I am no longer on the road. I am now back at home and have a physical Android device.

My first test with the real device worked perfectly!!!

I am all smiles.

Thanks for all of your help.

Sincerely,
Brad Marks
 
Upvote 0
Top