Solution to : Android Emulator not connecting to internet even though there is internet connection on computer


For the past 2 days,I was boggled by my android emulator not connecting to the internet even though there was internet on my computer.Before going into quick fix,I would like to explain my scenario

My Scenario !!

Previously,there was proxy server at my office,and recently the proxy server was removed.Though I had unset all the proxy settings from my Lucid Linux,my android emulator was still using proxy settings.I came to know about this by running the emulator from terminal by using
emulator -avd laaptu2.3 -verbose
Here put your emulator name at laaptu2.3
At the terminal,it showed that the emulator is taking the my previous proxy settings.

Road to solution !!!

First I had to unset the proxy settings,that was still on my Ubuntu machine.This happened due to the fact,that while unsetting proxy settings,my Ubuntu machine wasn’t able to apply it system-wide even though I clicked apply system-wide option.The first place to unset proxy settings was from environment variables and you can edit environment variables via
sudo gedit /etc/environment
And remove all proxy settings options,if present there.Now,restart the computer.

Main Solution !!!

After starting your machine, start the emulator via the following ways
Step 1:
emulator -avd laaptu2.3 -dns-server 8.8.8.8 -verbose
Emulator on dns server
adb server

Take a look at second picture and it may be possible that your adb server won’t start.First close the running emulator and execute following command on the terminal

adb kill-server
adb start-server
emulator -avd laaptu2.3 -dns-server 8.8.8.8 -verbose

Here 8.8.8.8 is the dns-server for Google.com,and after searching so many forums and solution,this method really works.

Step 2:
It may seem tedious to add always the dns server from terminal.So for that,you can set this parameter on eclipse and for that follow the steps

Go to run i.e. the green arrow sign on eclipse
Then navigate to run configurations
And a configuration window will be presented
Go to target
And finally to Additional emulator command line options

Eclipse additional command line

And apply the changes.Now your emulator can browse the internet.Above solution i.e. Main Solution works for Window machine too.Hope ,this saves time for some troubled developer.Have fun and enjoy 😉

Advertisements

Ubuntu 10: How to use svn under proxy server



We have proxy servers at our office and due to it, I have to make modifications on several applications that needs to access internet.I frequently use svn for checkout of Google codes and in order to execute svn checkout, I had to manually set proxy configurations. Since, Ubuntu is installed at my workstation I couldn’t find any GUI of svn to manually set proxy setting as I had done on my Windows.
So after few quick search,I found the way to configure proxy settings on Ubuntu and I am sharing this tip.Please follow the following procedure and make sure that svn is installed in your machine

  1. Open terminal
  2. Invoke super user
  3. Navigate to /etc/subversion folder
  4. Then edit servers file using gedit or any other text editor
  5. Then under [global] header put the proxy settings as
  6. [global]
    http-proxy-exceptions = *.
    ##put the location of your proxy server
    http-proxy-host = 192.168.3.5
    ##out the location of your port
    http-proxy-port =3128
  7. Now save the servers file
  8. Now you are able to use svn under your proxy server


Navigate to svn folder
Editing svn servers
Using svn checkout
checkout process

This is all,hope you all can use svn under proxy on your respective Ubuntu OS.

Ubuntu 10: Installing ,upgrading flashplayer 10.2 on Ubuntu


Right now I am hooked to Ubuntu and I really love to explore it.I do want to thank those brilliant people who have made this incredible piece of marvel and are giving out for free.Keep up this great work to inspire all of us.



Since mine was a new machine with freshly installed Ubuntu 10,I needed to install flashplayer plugin on it.I googled and browsed lots of websites and found a lot of resources,but none was helpful to me.Finally I found the right way to install flash player 10.2 via this website

http://linux-software-news-tutorials.blogspot.com/2010/09/install-flash-player-102-on-ubuntu.html”

and I like to share the same thing on my blog too.



Just follow the following commands on terminal to get updated version of flashplayer 10.2 on Ubuntu and F.Y.I this method works for upgrading flash player too on Ubuntu environment


  • sudo add-apt-repository ppa:sevenmachines/flash
  • sudo apt-get update
  • sudo apt-get install flashplugin64-installer

Hope this helps some of you to install or upgrade flashplayer 10.2 on Ubuntu 10

Ubuntu 10 : Using Android layoutopt command from terminal



Recently I got to know about “layoutopt” command of Android ,and this command is situated under androidsdk/tools folder.In windows,I do know how to set environment variables ,so that I could access “layoutopt” command from my command line.But in Ubuntu,I found it hard ,not because it is hard but the way to implement it couldn’t be found easily on the net. I found two ways to implement “layoutopt” command in Ubuntu and that is what I am going to share with you all

First Way

  1. Go to terminal
  2. Navigate to the android sdk folder’s tool by typing cd androidsdk/tools
  3. then type ./layoutopt

In this manner you can implement “layoutopt” by jumping directly to the tools location and typing out the “layoutopt” command

Second Way

  1. Go to terminal
  2. Type

  3. sudo su
  4. cd /etc
  5. gedit bash.bashrc



gedit bash.bashrc
Note:gedit works only if gedit is installed in your Ubuntu

After you have opened “bash.bashrc” on gedit then type the following codes on it


#Android
export PATH=$PATH:/home/santosh/android_sdk/android-sdk-linux_x86/tools/

  1. Here “santosh” is the username where you should put your username
  2. And my android sdk is placed in home folder named as android_sdk/android-sdk-linux_x86/ and you should put the location of your androidsdk folder

bash.bashrc



Now save the bash.bashrc file and exit the gedit.
Launch terminal and type layoutopt and holla ,you can access all android tools through command line







Hope now you all can enjoy Android tools through Ubuntu command lines