keno krydenuu

Greenhorn
+ Follow
since Mar 03, 2017
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 keno krydenuu

Norman Radder wrote:

all these (including retrieving the PC IP) need to be done programmatically.


How will the Android program get the PC's IP address?



I have posted the answer to this already , here it is again- it works and its valid :
And if you want to get it in text format :-  
Java documentation  

If I don't want to obtain the IP programmatically i simply go to whatsmyIP.com
But I want it programmatically so i would use
I really don't need Fing app, the issue with my code is definitely not about retrieving IP (I didn't download)
To be honest I don't really know why your Fing app is useful because retrieving an IP address is the first-step most accessible thing.
More so  at the moment I am using wireless router connection so I only need internal IP which is even relatively straightfoward
If you are talking about available port, thats only slightly a little bit less straight forward
Its kinda funny, I've come to this forum seeking expert help, but i've ended up having to lecture someone about the basics of retrieving an IP address programmatically
I wonder where the socket programming experts on this forum are? Help please, with deep appreciations and gratitude in advance
4 years ago
Yeah, as far as i can see, Fing app is useless to this cause, This project obviously is a programmatic process, using a manual too like Fing app is a non-event
4 years ago

Norman Radder wrote:I don't know about that code. I'm not that knowledgeable on network stuff.  I've had good luck using the IP address that Fing returns.



The project I'm working on, all these (including retrieving the PC IP) need to be done programmatically. Doing this manually in the context of my project doesn't make any sense. Except if Fing can work programmatically I don't see the point  
4 years ago

Norman Radder wrote:Did you try the Fing app to see what IP address the PC has?

how to connect with the browser


On the tablet, I opened a browser and entered the URL: http://192.168.1.69:57908
I posted what was sent to the PC and saved by the FileServer program in an earlier post.



Ok, i never had the Fing app, but i will try and download Fing app asap now and check the PC IP

But in the meantime shouldn't the code below work as well in returning the correct IP? (I'm using wireless connection so its internal IP)
4 years ago

Like I said in my original post I'm a complete starter in this area (though a bit experienced in other areas), so I don't what you mean by connect to browser(or better said i don't know how to connect with the browser)

What about these 2 lines would it not return the correct computer IP and bind?

4 years ago

Norman Radder wrote:How do you get the IP address of the PC?  I used the Fing app on my tablet.



I used to return the IP address

4 years ago

Many thanks for you tests, Please if you have an Android can you help test the full code, i need to find out which part is failing on my side. I appreciate it, Thanks
4 years ago

[why is there no way of editing post here?]

Please take me through how it worked with yours , I must be doing something very wrong, something so simple but I can't just see it. I'm a starter so I'm probably getting something so simple so wrong
4 years ago

Norman Radder wrote:
The client code from lines 41 to 67  work with the FileServer code on my PC to send and save an image file.



It only gets to "waiting" on my own computer, you didn't make any modifications, did you?
4 years ago

Norman Radder wrote:Are there any error messages in the Android logcat?



No, there are no error messages, no crash dumb (no stack trace either, just waiting)

Norman Radder wrote:Have you tried testing with a browser on the Android device to see if it can connect to the server on the PC?



No, not tested with a browser. The code would have to be altered, but i simply wanted to send from Android device to server code on PC

Please I will appreciate if anyone can spot the anomaly with the code, thanks

BTW how do I get to edit button, wanted to edit original post but couldn't.  

Pleas if you can do help with the the code, i'm a starter but i think anyone very familiar socket programming would find it easy to spot whats missing, thanks
4 years ago
Hello
I am new to client-server programming. I am writing a simple client (Android platform/java) - server (pure java - NOT on Android - runs on PC) application. I am running the application on a router wireless network, so using internal IP 192.168.1.2  and trying to send a file image from Android to the server code. This is the basics that is needed to work. The Problem is connection is not fully established so the image file couldn't be sent. The code I guess would be a peice of cake to experts to see where i went wrong. When I googled people where talking in too high level manner and I still didn't know how to fix it.
I will appreciate your help, many thanks in advance.    Here is the entire code (no crash or exception, but just didn't make connections)


Client side (Android java)
first part of the code and the 2 last functions of the code is just to allow user to select any image from the gallery
So only the middle part is socket programming




Server side code (pure Java, not Android platform)
For now file size hard coded. int filesize=550000; but can be adjusted to the size of the image you will select



xml layout



permissions added to Androidmanifest.xml



output didn't get beyond waiting
4 years ago