Thursday, August 26, 2010

Transfer files using Wifi in Nokia mobile phone.

Many of us have the idea of transferring files between Laptop and Mobile phone using wifi connection, but it is not possible to do that directly. So we are going to do some tricks and gonna make it happen.
I am going to describe the steps using my mobile phone Nokia E63 and Laptop running Windows 7 Operating system. However other wifi enabled mobile phones and iPods will also be working.
Initially, we need the following:
1.Obviously, a wifi enabled mobile phone (say Nokia E63)
2. Laptop (In this post I’m using Windows 7 Home Premium operating system)
3. Web Server software. (IIS or Apache. In this post I’m using IIS 7.0 Web Server)

Setting up the IIS Web Server:
To setup the IIS Web Server you need either Windows XP Professional edition or Windows 7(any version except ‘Home Basic’). Here I’m going to show  you how to install IIS Web Server in Windows 7 Home Premium.
Open Control Panel—> Programs And FeaturesPrograms and features –> Turn Windows Feature on or offTurn Program Features On or Off .
A new dialog box will be opened. In that select Internet Information Services and click ok and wait while Windows installs IIS Server in your machine.
Windows Features
Now IIS is installed successfully.
Setting up the Ad Hoc network:
Now we have to setup the Ad Hoc network on our laptop.
Open Control panel—> Network and Sharing Centre Network Sharing Center --> Setup new connection or networkSetup New Adhoc Network .
In the new dialog window select setup a new network it will take some time to show the details. Then select the appropriate option to setup a ad hoc network with default values.
Configuring the website:
To configure the website we need to do little work here. Open Control Panel—> Administrative Tools—> Internet Information Services (IIS) Manager.
In the new windows that appears select the website under connections pane—> sites under that select your web site by double clicking it.
On the right pane select Bindings and click Add. Now select http as type and in the IP Address field put some ip address like 192.168.1.15 and leave the Port as 80. Leave the Host Name field empty and click Ok and click Close to return back to main window.
In the right pane under Manage Website select Restart. Now you will see something like this Browse Site   . Now click on Browse 192.168.1.15:80 (http) to check the whether the website is working correctly.  It will open your web browser and show the Welcome Page or IIS 7 Page.
Configuring the firewall in Laptop:
Open Control Panel—> Windows Firewall.
In the new window select Allow a program or feature through Windows Firewall option.
Firewall Programs
It will open a new dialog window select World Wide Web Services (HTTP) select Change Settings and select the Home/Work(private) and Public Check box and click Ok.
Windows Firewall IIS allowing
Configuring the connection for mobile phone:
Now click on the Wireless Networks icon in the System Tray Wireless Icon  and select the Ad hoc network you have created. In this example the Ad hoc network name is Dell Raja. Now click connect.Dell Raja AP
Now scan for wireless access point in mobile and select Start Browsing. In the web browser type in the IP Address you have given for the website, in our example 192.168.1.15. After getting connected to the Ad hoc network right click and select the status in the new dialog window select Properties in the Internet Protocol Version 4(TCP/IP4) and select Properties select Use the following IP address radio button and enter the ip address of the website we have previously configured, in our example 192.168.1.15 in the IP address field. Then enter the Default Gateway as 255.255.255.0. Click Ok if any pop up windows appears then click Ok.
Tip:
    If you connect your laptop to some other network then you may need to change the above settings to Obtain IP address automatically otherwise the connection may not work properly. 

Now disconnect your mobile phone from the laptop and connect it once again using the previous procedure.
Tip:
   Save a bookmark with the IP address and Connection name in the mobile for easy and quick access. See an example screen shot below.
Screenshot0008
After entering the IP address correctly you will see the IIS 7 Welcome page as you have seen before in the local (laptop’s) web browser.
Screenshot0009
Transferring files:
Now open the default folder for our website and paste the file you want to transfer. For our convenience we rename the file like “Sample.zip”. Now type in the address something like http://192.168.1.15/Sample.zip.
Screenshot0013
It will start to download the file with almost 550 kbps at an average.
Screenshot0015  Screenshot0019
The above screen shot shows the file is being downloaded at 606.54 KBps, quiet fast isn’t it.
Important Note:
        This trick will work for almost any mobile phone, PDA, IPod enhanced with Wifi.
        You can use also use Apache Web Server, which is an open source software but you have to follow its own installation and configuration procedure. To know how to setup Apache Web Server Click Here.


Enjoy faster file transfer.

Thursday, August 12, 2010

Print a character to screen without using any Library functions in C.



void main()
{
char far* src = (char far*) 0xB8000000L;
*src = 'H';
src += 2;
*src = 'i';
src+=2;
*src='!';
getch();
}


You may wonder whether it is possible to display a character in the screen without using any C library functions. Yes, it is possible by directly accessing the memory of the device's display buffer with a character pointer and assigning some character to it.

In the above code, the first line assigns the address of the memory location where we want to put the character. Actually the display buffer will be having 4000 memory blocks for printing characters in pure DOS mode.

Pure DOS mode supports printing of 2000 characters per screen.

Generally for displaying a character, two memory blocks(bits) are used. The first block for specifying What the character is and the second block of memory is to represent the property of the character, like color.

If you are printing something using the above method you will find the characters only at the top-left corner of the screen since you are accessing the initial memory address of the display buffer (0xB8000000L).

Anything you have printed on the screen before executing this code will be sent to the lower screen (if you have not specified any clrscr(); in this program)
Your Ad Here