Tuesday, December 27, 2011

Use android device to connect to internet on PC using USB cable or any wireless source.

I was new to android, and wanted to connect to internet via GPRS/EDGE/3G connections. But unfortunately I couldn't find any modem support in android. In run of demand for a DUN connection I found tethering option in Android phone and found connecting to PC for internet via Android is dead easy!, thanks to tethering, below are the steps and references:-


My devices and setup:
Android version: v2.2, Froyo
Device: ZTE Blade (Or Dell XCD35, Idea Blade in India)
PC: Toshiba Satellite C650 AMD Athlon II P320 CPU, HD4200 ATI card
OS: Windows XP

STEPS:
1. Enable Internet on your Android phone via any source you have access to like GPRS/EDGE/3G data plans.
2. Connect the phone to your Laptop/desktop using USB cable (Otherwise below option will be disabled)
3. Go to phone settings and enable USB tethering :-

Press Home -> press menu -> wireless & networks -> Tethering & portable hotspot -> USB Tethering
Enable this check button.


Once enabled,  If your pc drivers are installed correctly, you will see HSUSB device connected message, remote NDIS adapter device will be shown on your device manager.


Verify the correct setup:
1. Check if your Android device shows BLUE USB icon on the taskbar which opens tethering upon touch event.
2. Open Device manager in windows XP or other OS. Network adapters should show

"Remote NDIS based internet sharing device"


My details are:
Manufacturer: ZTE Corporation
Location: Location 0 (ZTE HSUSB Device)
Control panel => Network Connections => Remote NDIS based internet sharing device




 4. Test internet on your phone if it works, then for sure you will get same speed in your PC.



You can test the speed of your internet by simple command. Open cmd.exe from run dialog and type

ping google.com

below is output from my console:

Pinging google.com [74.125.113.104] with 32 bytes of data:


Reply from 74.125.113.104: bytes=32 time=516ms TTL=45
Reply from 74.125.113.104: bytes=32 time=517ms TTL=45
Reply from 74.125.113.104: bytes=32 time=513ms TTL=45
Reply from 74.125.113.104: bytes=32 time=515ms TTL=45



The lower your time is the faster your internet connection will be. EDGE normally shows values between 200 to 700. Values above it are very slow connection. I get ~250 average in low traffic, ~20-30KBps.




CONCLUSION:
Android's USB tethering just means to share internet from your device to other device no matter what the source of your internet is. So we don't need any kind of Dial Up networking support in phones. So this is a universal solution and that's why android don't need DUN :-).




References:
Tethering & Hotspot
http://support.google.com/mobile/bin/answer.py?hl=en&answer=182134


Share your mobile data connection:
http://support.google.com/mobile/bin/answer.py?hl=en&answer=168932


Windows XP's Android RNDIS device information, tethering, INF file
http://www.android.com/drivers/tetherxp.inf



ZTE Blade drivers:
http://www.zte.co.jp/products/handsets/handsets_gallery/softbank/info/201012/P020101217594818380622.zip

ftp://ca:welcome@ftp.brightpointuk.co.uk/Technical%20Support/ZTE/ZTE_Handset_USB_Driver.exe


Plugging Android phone to PC shows a CDROM with their drivers which upon enabling SDCARD gets removed.



EXTRA (part of my marketing):

If above steps have solved your problem and you are happy, and you do not hate games :), please try the games I have developed.


DesiBallGame - My first android game, recently released

https://play.google.com/store/apps/details?id=org.greh.desiballgame


 My PlayStore profile:

https://play.google.com/store/apps/developer?id=GamesGreh


My website for games:

http://www.gamesgreh.in

Tuesday, December 20, 2011

How to get rid of slow android emulator during app development?

We know that Android emulator starts even slower than the PC itself. But a simple solution to get rid of slower booting of droid emulator is -

Solution when emulator is running -

Do not close the emulator until you are done with all build testings :-)

Simply run your android project and never close the emulator window until you are done with your work for the time, i am working with Eclipse and retest app builds as fast as we do with J2ME. All work the IDE has to do is upload/update the apk instead of relaunching of the emulator window again and again.


Solution #2 - Use Android-x86 in VirtualBox (or VMWare etc).

I don't want to write same thing which someone has already done. Please read the process in this page how to setup android in VirtualBox and use it for development.

http://www.andreybutov.com/2011/10/14/how-to-set-up-a-faster-android-emulator/


Now, most probably you will encounter "where is Host-Only adapter" option?
For that, Go to
File -> Preferences -> Network -> Add new Host-Only Network -> vboxnet0

Now upon selecting host-only network will show vboxnet0 instead of "no item selected".


Happy Droidevelopment :-)