b4aServer example

Rusty

Well-Known Member
Licensed User
Longtime User
I'm not familiar with PHP/Java and would appreciate an example in either VB or C# if anyone has such a thing. I've got the b4aServer on my Android device running just fine.
Thanks in advance.
 

Rusty

Well-Known Member
Licensed User
Longtime User
Thanks, Erel.
I have already viewed those. I am sorry to be so thick, but the Android app B4aServer (APK) works well on my Asus. What I am needing is an example in VB or C# on the PC side.
I don't know/use PHP and am trying to create a PC application that talks with B4aServerExample.
I'm currently trying to create a VB TCPClient application to do this and am a bit lost on the protocols. I have it connecting, but not transmit/receiving.
Any further help is greatly appreciated.
 
Upvote 0

Rusty

Well-Known Member
Licensed User
Longtime User
I was able to run the PHP code you provided in the example with the installed Java. It worked well in a command prompt.
I'm trying to create a deployment function with a (PC forms) user interface.
I have created a PC based database management system that creates databases, files etc. In order for my users to be able to deploy these files to the Androids they use, I need to be able to copy files to the Android. (It would be good to retrieve files as well.)
Honeycomb androids do not mount as USB drives but instead as Portable Media Devices. As such, my current PC application can not read/write to the android via USB cable.
I'm trying to create an acceptable user interface to allow my users to conduct deployment activities.
I don't understand your last statement: "You do not need to write code that directly connects to the device. You should instead make an executable that gets the arguments from the desktop server and returns the data to the device."
I thought my tcpclient application was attempting to do this.
Sorry for being so dense...
Thanks
 
Upvote 0

Rusty

Well-Known Member
Licensed User
Longtime User
Erel,
I wrote a PC based client program. It successfully connects and sends files. However, when I send an .apk file, the Android OS does not recognize it as an "app".
Text files, when viewed, look good.
It appears that the files are correctly formatted, but the Android OS does not recognize them. For example, if I send an .apk, it doesn't install, but if I open it via USB on my pc, it is a properly formatted .zip (apk) file. likewise for my SQLite databases, the Android OS doesn't recognize it, but if I open it via USB, it opens correctly and the data is correct as well.
Any ideas?
Thanks,
 
Last edited:
Upvote 0

Rusty

Well-Known Member
Licensed User
Longtime User
I figured this out.
You MUST trim any folder or file names before creating or writing the files.
If you create a folder /sdcard/android/data/test___ (___ means some spaces)Android will create a folder (or file) with the spaces in the folder/file name. The file named test___ is different than the file named test
Also, the Android OS does not see test___.apk as the same file as test.apk. It also does not see the test___.apk as an ".apk" (app) and won't install it even though the file is valid (if you browse it with 7zip or ??).
When you see the folder/file within a file Manager, it does not show you the spaces at the end of your file but if you create a test.apk and a test___.apk, it appears you have duplicate files.
 
Upvote 0
Top