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 :-)

Wednesday, October 5, 2011

Very good multimedia converters.

I was searching for a converter that can convert audio to mobile formats, i found SUPER (C), it is a great utility for multimedia workers. One more software i found excellent for audio production/conversion is "Extreme Sample Converter".

1. SUPER (C)
Link: http://www.erightsoft.com/SUPER.html

It can convert Audio/videos to many formats including rare MMF (Yamaha's SMAF mobile format, but i haven't tested it). AMR, 3GP,  common audio and videos formats like FLV, SWF, AVI, formats for portable devices like IPhone, BlueRay, Nintendo DS (DPG), etc.


2. Extreme Sample Converter
Link: http://www.extranslator.com/

It can convert to almost all console, mobile, DLS, SF2 sound fonts, VSTi, AKAI, FLAC, YAMAHA etc containers. I converted Microsoft Windows (actually Roland) "General Midi DLS", gm.dls to gm.sf2, SoundFont and using in Midi Synthesis.

Monday, July 18, 2011

Some very good BIT hacking for programmers,

Today i found this page, looks very useful for all programmers. Many times we need some part of this page:

Link: http://www-graphics.stanford.edu/~seander/bithacks.html

Monday, May 30, 2011

Sites for finding alternatives for some specific software.

Below is the site for finding alternative applications for an application. e.g. LMMS is opensource alternative for FruityLoops ( music composition software ). I love lmms ;-)

link: http://alternativeto.net/

another good page: http://www.osalt.com/

A very good collection of GIMP tutorials.

I found this page while searching for gimp tutorials, this page contains many of tutorials you will find by googling.

Lots of Linux, OpenSource, games

I was looking for some gimp tutorials and via pics i found this great Linux game collection site, this is a must visit for people demanding games on Linux distros. Below is the link:

http://www.playdeb.net/

Friday, May 20, 2011

Portable Linux applications.

After using Winpenpack, portableapps for winows i was trying to build my own collection of portable apps for Linux, but good news is that some people have already done that for us all. ;-)

Below is the link of the site where you can download Linux Portable apps.


If you are trying to make portable builds then you can do it by setting LD_LIBRARY_PATH to your apps dirwctory and then launching it via shell script. I have created a script which copies all the dependencies into your application's directory so that you build that a portable suit. You can find some important scripts in Linux label ( look right list of labels ).  

A good article on 2D rotated rectangle collisions.

This article is simple, short and easy. Below is the link for the tutorial.

Tutorial - 2D Rotated Rectangles Collision Detection
http://www.ragestorm.net/tutorial?id=22


But in case you don't want to use rotated collision, what i do, is to treat rotated rectangles as a 4 points polygons and do the simple point in polygon Or polygon-polygon test.

Wednesday, March 16, 2011

Smoother motion using Interpolation.

I found this page last year (2010) and would like to recommend as must read if you are related to physics motion by programming.

LINK: http://sol.gfxile.net/interpolation/

Tuesday, January 11, 2011

What are UV / ST texture coordinates and UV mapping ?

I know many of you might be having trouble in understanding what UV/ST are. I too had during beginning of OpenGL texturing. Before eating too much time its just:

(U,V) = (X,Y) of texture.

U = X pixel position of image / image width ;
V = Y pixel position of image / image height ;

And we know how to cap something between 0 to 1 range. Just divide it by the maximum that's why we are dividing pixel position by width and height just to cap it between 0 to 1 range.

Now we do simple maths, multiply U value by 100 and we get pixel position in %age.
suppose U = 0.4 and V = 0.6, it simply means
40% width, and 60% height.

U is pointing to position = 0 + 40% of image width
V is pointing to position = 0 + 60% of image height

That is why texture coordinate system becomes
left = 0 (lowest width), right = 1 (max width)
bottom = 0 (lowest height), top = 1 (max height)


Image Source: = http://paulyg.f2s.com/graphics/uvexp.gif


EDIT:
Now what UV mapping is?
I'll try to explain in lame language.

Assume a triangle as your polygon data and a rectangular, balloon like, nonrigid sheet as texture, here we want to cover the triangle with desired portions of that sheet, what should we do in real world? Of-course we will try to stretch it around triangle in all possible ways,  we can start from wherever we want but limitation is simple, we have got 3 points to staple that sheet. this is exactly what OpenGL does. It asks which part of the texture you want to be mapped into which vertex of polygon. We can't tell OpenGL that hey put this UV in center on the polygon!

That's why the higher the number of vertices we have in polygon the better mapping we can do.

But in actual programming, we can assign almost any UV to any vertex. That would make the triangle with unusual patterns. I haven't tested this :-), try this in 3D modelling programs like Blender if you wanna save your time and experiment quickly on UV mapping. Then export your simple mesh into OBJ format, which you can read on text editors as well.

The best resources for studying OpenGL, OpenGL ES

I learned OpenGL in 2009 and completed my Greh game engine in mid 2010 with my own Game framework for menu, sounds, ai, collision etc.

However i would like to help others in their journey for OpenGL. I strongly recommend reading these resources instead of buying many books. Switching to resources too much without fully giving time to them just wastes time and demoralizes us.:-

1. OpenGL redbook: it's enough for studying OpenGL concepts. Click this link
2. The simplest and nicely described tutorial on OpenGL + shaders (i.e. covers OpenGL ES 2.0 also ).
    Click this link  pointer to http://duriansoftware.com/joe/
3. Nehe (Neon Helium) GL tutorials. Link
4. Going to learn about rendering models, UV mapping etc. Link
5. GLSL, OpenGL ES 2.0. Link
6. Good samples for some of important OpenGL techniques. Link
If you know more links then please let me know.