0

I want to implement (for educational purposes) a program that checks the connectivity status of my laptop with certain wireless "entities". For example it will check my connection to a certain cell (mobile telephony) or a specific WLAN AP (e.g. the WLAN of my house).

Can I do that using only Java or should I use C/C++? The platform will be Vista / XP and in the future maybe Linux.

Is there anyone that can guide me to the correct APIs (if any)?

Joel Coehoorn
  • 399,467
  • 113
  • 570
  • 794
user1304490
  • 181
  • 2
  • 2
  • 11

1 Answers1

0

I would definitely recommend C/C++, however, if you are trying to write one code and run it in both linux and windows check out jNetPCap which is an implementation of PCap library for Java. tell me exactly how you want to check the connectivity? pinging? or you just want to know to what wireless network you are connected ? do you want to measure network delay?

Bashir
  • 266
  • 3
  • 10
  • Hi. Thank you very much for your answer. I want to detect the presence or not of a specific WLAN or a cell (mobile phones). And then based on that I plan to implement an action. This means that I want to capture the SSID (or a better identifier) or the cell ID. As far as I understand I have two options: 1) Write C/C++ code and call it from Java - which C/C++ must be recompiled in order to run in both platforms. 2) Use JNetPCap,so that I will not have any issues and I will write only Java code. – user1304490 Mar 31 '12 at 11:25
  • However, and because there may be a commercial interest for this program (in the future) I want to avoid licences, etc. So I guess that my only option is to refresh my knowledge of C++. – user1304490 Mar 31 '12 at 11:28
  • Yes, if I was coding it, I would definitely go with C/C++. [this](http://stackoverflow.com/questions/9699618/wlan-ssid-in-java-c) might be helpful. – Bashir Mar 31 '12 at 21:17
  • Thank you Bashir. I am thinking of using j_interop - I want to write everything in java both because I am not comfortable with C++ and because I want portability. Cheers! – user1304490 Apr 01 '12 at 17:44