Tan Kok Lim

Greenhorn
+ Follow
since Oct 23, 2012
Merit badge: grant badges
For More
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
0
Received in last 30 days
0
Total given
0
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Tan Kok Lim

I'm transfer snowflake animation and modify it to be appear on linear layout without blocking any components on relative view.

But I have problem to transfer GLSurfaceView (which is derived from openGL ) into linearlayout where it will overlapped or closing everthings components on Relative view.

GLSurfaceView glView = new GLSurfaceView(this);
glView.setDebugFlags(GLSurfaceView.DEBUG_CHECK_GL_ERROR);
glView.setRenderer(new FireRenderer(context)); //This line is important
container.addView(glView);

My problem here how can I modify the code so its animation can be appear on background without crossing to block everythings on relative background.
11 years ago
After Few times attempts, I've succeeded in my code which can be working on client side in sending and server won't stop stop executing after each time received file form client.

Server Side



Client Side




11 years ago
okay, done i've settled by putting flag = false when it encountered number of file is reach to index array less one before max.
let said total file from client send is digit 2 but index 0 will stored digit 1, index 1 stored digit 2, while index 3 stored in nothings.



Here is my modified server's code:



Another Question is here because my server will be stop running after one time transfer is done, I want to keep it running, How can I do it? I mean how can i keep
clientSocket = serverSocket.accept() to open the port for running and waiting to received request from client after one time send is done.

Appreciate thankful to any helps.
11 years ago
Currently, I've created one android apps to enables to send/transfer file from internal storage to remote server via WAN when I stayed in outside.

All files is success transfer but at the end my server is ended up with this message, ( the picture/music files will be success rendered when I quit out this programs )

Exception in thread "main" java.lang.IllegalArgumentException: Illegal Capacity: -1
at java.util.ArrayList.<init>(Unknown Source)
at ServerSocket.com.ServerRun.main(ServerRun.java:60)

Here is my server side code,

Server :



Android Side



My problem is here how can I modify to server side code to avoid this problems on future. Appreciate to any helps and thanks.
11 years ago
Thanks for all your previous guide,

This time I've success to transfer a bunch of file from one directory to another directory but the the server's connection will be reset each time transfer is done.

the server will simply returns this message:

Starting...
Starting...
Starting...
Starting...
File Size =1716298
File Size =1649677
File Size =2555655
Starting...
Exception in thread "main" java.lang.IllegalArgumentException: Illegal Capacity: -1
at java.util.ArrayList.<init>(Unknown Source)
at ServerSocket.com.ServerRun.main(ServerRun.java:51)


Here below Is my code

Server Side:




Client Sides




My problem here how can I ensure continues running of server without reset each time transfer is completed? Thanks to any mindful helps.

11 years ago
okay....thanks to admin by help me putting code tag.

Anyone can help to solve here problem,,,,,,thanks

To Campbell Ritchie,

I can pass through the first file processing but I'll be stop at second file processing when running in the for loop process at client
the problem i found at os=clientData.getOutputStream() here where it will be stuck at second times in loop process.

I've modified the above code.

11 years ago
There is not problem in client side, no matter my client side sending how many but it could only able transfer one file to server side

at last it returns to this error:

Exception in thread "main" java.net.SocketException: Socket is closed
at java.net.Socket.getOutputStream(Unknown Source)
at clientSend.com.ClientSend.main(ClientSend.java:72)


Client Side




Server side





My problem is here how can i detect/scan number of file received from client by modifying server side coding then i can used to performed looping to write output file. Appreciate any help.
11 years ago