Win a copy of OCP Java SE 8 Programmer II Exam Study Guide this week in the OCP forum!

abdy hussein

Greenhorn
+ Follow
since Feb 16, 2012
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
1
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by abdy hussein

Since I know the host Ip address is there a way I can use it to get its hostname?. I know am going out of topic but I would appreciate any help on this.

Thanks.
I think its definitely not a java issue becoz I am getting this erro; "Ping request could not find host Wifly GSX. Please check the name and try again."

Thanks.
I think I do add elements to the list at line 121.

Sorry to have posted the whole code. The file operations are meant for something else that have no effect on the above problem.

Thanks.
6 years ago
Hi,

I was working on a simple GUI program to send short messages to a remote device.. The title of the messages are saved on a list after the messages are sent such that the user can select to view previously sent messages.
I have got the first part working perfectly but my program doesn't remember anything after each run. The list will be empty after running the program each time. Here is my code. I used Netbeans IDE to design the interface but I did the event handling part. Adding items to the list starts from line no. 96.

6 years ago
Hi all,

I have a created a TCPClient class to handle the socket programming on the client side. The server is a device that I intend to send messages to execute various commands. Under this class I have constructed a client socket with the server's host name and port no. Running the program throws UnknownHostException. I have verified I am using the correct device name. i knew this after I checked on my router's configuration page where a list of connected devices were displayed.

But when I use an InetAddress object containing the server's IP address, I get no errors and the connection is successful. This however brings a huge limitation in that, I have to enter the IP address every time since the device's (server) DHCP is enabled. What could be the problem?

Here is the code.



Thanks.
To answer your question, here is a sample of a graphic array the LCD uses to display certain image

/*------------------------------------------------------------------------------
; DFrobot bitmap - size 48x24 pixels, black/white image
------------------------------------------------------------------------------*/
unsigned char DFrobot_bmp[]=

{
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xFF,0x01,0x01,0x39,0x39,0x39,0x39,0x39,0x39,
0x01,0x01,0xFF,0xFF,0x01,0x01,0xC9,0xC9,0xC9,0xC9,0xC9,0xC9,0xFF,0xFF,0xFF,0xFF,
0xFF,0x19,0x19,0x19,0x19,0xFF,0xE6,0x00,0x7C,0xFE,0xFF,0xFF,0x83,0x01,0x01,0x01,
0x83,0xC6,0x7C,0x00,0x00,0xFF,0xFF,0xFF,0x19,0x19,0x19,0x99,0xFF,0xFE,0x00,0x38,
0xFE,0xFF,0xFF,0xC3,0x81,0x01,0x01,0x83,0x87,0xFE,0x3C,0x00,0x01,0x01,0xFF,0xFF,
0xFF,0xFF,0x01,0x01,0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x03,0x02,0x02,0x02,0x02,
0x02,0x02,0x02,0x02,0x02,0x03,0x03,0x03,0x02,0x02,0x03,0x03,0x03,0x03,0x03,0x03,
0x00,0x00,0x01,0x01,0x01,0x00,0x00,0x00,0x00,0x01,0x01,0x00,0x00,0x00,0x01,0x01,
0x01,0x01,0x01,0x01,0x01,0x00,0x00,0x00,0x00,0x00,0x01,0x01,0x01,0x01,0x01,0x01,
0x01,0x00,0x00,0x00,0x00,0x00,0x01,0x01,0x01,0x01,0x01,0x01,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x01,0x01,0x01,0x00,0x00,0x00,0x00,0x00,0x00
};

6 years ago
Hi everyone.

I am on the middle of a project requiring sending of data from computer (created a GUI using java) to a microcontroller (to be displayed on an LCD) wirelessly using Wi-Fi. I have been successful in sending textual data but want to move one step ahead by sending images (this time I will b using a graphical lcd 48 by 84 display). The problem is that the graphic lcd displays the image when it is in the form of an array (hexadecimal values). So I thought of converting the image before sending it to the microcontroller.

I want to update the same GUI i used to send the textual data to be able to accept the image file then convert before sending. Since the maximum display size is 48 by 64 and can only display black and white images therefore i have to place a restriction where the accepted file should be a bmp file format before loading it to the GUI. My knowledge on image processing is very limited and I was hoping to get some ideas over here on how to solve this problem.

Thanks.

6 years ago
Hi william thanks for the suggestion....I was able to connect to the device and send commands.

I really appreciate your help...
The host name is ok as I got this from my router's configuration page before I switched to adhoc mode. I tried to change the port number but same result. could this be something to do with the adhoc mode as I am not familiar with it?....
Hi,

I recently embarked on a project involving controlling a microcontroller remotely using wifi. Commands are sent from a windows app to a wifly shield which passes them to the mcu. The wifly shield and the computer are on the same adhoc network and i was able to ping and telnet between them successfully. The problem arises when the app throws an unknownHostException after sending the commands. I checked the ports and host name clearly and everything is ok. The app is the client while the wifly shield is the server and at the time of sending the commands the shield is up and running. Here is the TCPClient class that the app uses.



Here is the event handling part that uses the TCPClient class



Hope to find some help over here. Thanks.