Sunday 15 March 2015

Hey guys I changed my blog's name. You can visit the blog.

http://www.geeksmember.blogspot.in/

Saturday 24 January 2015

Install virtual box/machine in host and guest operating system(Nested virtual machines)

Today I am going to describe how to install virtual box and creating a virtual machine in host operating system (windows ) as well as guest operating system(operating system installed on virtual machine already).

For nested first we have to install a guest operating system using virtual box. I am demonstrating here for windows as host operating system and Linux mint ( http://www.linuxmint.com/ ) as guest operating system but you can use any os image for guest operating system. Make sure that os image is not corrupted and you have the latest version of virtual box.

1.Download virtual box from the official oracle link. (Make sure you download the latest version)

2. After Downloading is completed go to the installed .exe file (for windows only) and run it. It will install virtual box on windows.(it will take few minutes)

3. After installing virtual box start virtual box click on new to add new guest operating system

Adding New Guest Operating System



Select the type of operating system u want to install as guest. I am installing mint whose base is inux 
so I am selecting Linux and Ubuntu(32 bit). Make sure you are selecting the correct version 32 bit or 64 bit. I am installing a 32 bit version of Linuxmint. Click on Next.

4. Select the RAM you want to give to guest operating system. There will be a recommended memory size on the basis of your total RAM. Give a little more than the recommended memory. Because we are going to install another os in that guest os.

5. Select the radio button which has the option 
Create a virtual hard drive now.

Click on create then again a pop up window will come.

6. Hard drive file type
Select the option  VDI( Virtualbox Disk Image)      then click on Next.

7. Next pop up comes for Storage on physical hard drive . 
Select the option Dynamically allocated

8. Select the file location where u want to install files in hard drive. And also give the size of the virtual hard drive around 20-30 gb (Because we are going to install another os in that host os).

9. Click on create and an virtual machine will be created in the left dialogue box of virtual box.

10. Right click on the newly created virtual machine and go to settings

Selecting the iso image from the hard disk or cd/Dvd.
in settings -> storage -> controller:IDE -> Empty(click) -> Attributes (select IDE Secondary Master) and click on DVD Icon to select the iso file. Choose the iso image file from where u have put that file.( If u don't have an iso for guest operating system. Download Linux mint from the below link.)

NOTE: Select the correct version 32 bit or 64 bit whatever you want to install.

After selecting iso image file click on ok.

11. Again go to that newly created virtual machine. Right click on it and click on start.
     It will start installing mint.
     It will take time ( around 10 - 15 minutes).

12. After that it will ask to set username for your os and password. Set that.
    And if you want , you can restart that guest operating system.

Installing virtual box in the guest LINUX MINT operating system.

1. Go to terminal. (ctrl+alt+t)

2. Make sure internet is working in guest operating system by running sudo apt-get update.

3. Then run following commands
for adding sources from where u can download run this command
sudo sh -c 'echo "deb http://download.virtualbox.org/virtualbox/debian trusty contrib" >> /etc/apt/sources.list'

4. run the command
wget http://download.virtualbox.org/virtualbox/debian/oracle_vbox.asc -O- | sudo apt-key add -

5. then again update
sudo apt-get update

6. install virtual box (whatever latest version is)
sudo apt-get install virtualbox-x.y

where x.y is version of latest virtual box.

7. download the dkms for virtual box
sudo apt-get install virtualbox-dkms


It will install latest virtual box in the mint.

For starting virtual box : Type virtualbox in the terminal. It will start the virtual box.

And for another guest on that guest operating system use this virtual box as the same process as above. First Download an iso in the guest operating system and repeat the above process.


For further detail you can visit this link.


I hope it helps. Feel free to comment. If you have a problem post. I will try to find a solution. Till then enjoy.






Tuesday 20 January 2015

Installing Android Studio and Deploy App on USB connected Android Device Instead of Emulator

In this post I am going to describe how to install Android Studio and make it work with your android device directly. The app will run directly on your android device which is connected using usb cable. If you don't have an android device than you can test your app on emulator. But Emulator is too slow to work with. If you have any android device( having min. android version ) can be used instead of emulator. That would be very much faster instead of working with emulator.


Installation:


1. First of we will see whether your system meet all the requirements which Android Studio needs.
   Visit this link to see the requirement.(depending which Operating System you are using)

2. If you meet all the hardware requirements, make sure that you have the latest version of java jdk and jre installed on your system. 

Note: The latest (till date) Android Studio needs java jdk7 or higher version.

You can download and install Java jdk and jre from the site below.

3. Now if you installed new java jdk and jre then set the environment variable PATH( in windows specifically) to the path where you have installed that jdk and jre.


 start(right click) -> system -> system advance setting ->advance -> environment variable

Set PATH Variable in Windows
If you have other than windows operating system you can search on google "how to set path variable for java jdk".

4. Now you are ready to install Android studio. Download it from the official website.


5. After downloading you will have the Android Studio adt bundle in your downloads.
                  android-studio-bundle-xxx.xxxxxxx.exe
         xxx.xxxxxxx will be your version which you have downloaded.

 click on it(for windows) and setup will start. It will ask simple things where you want to install ,language etc. go through it and install it. It will take little time. This process is easy.

Your android studio is installed . You can start developing android app but for changing the setting of the emulator to change it to your device go through the next process.

Setting your android device as default for running app instead of emulator:


1. First of all you will need an android device with min. android OS version(whichever you will  use  for developing app).

2. You need to download adb driver for your device. It is specific to every device. So search on google.
Download and install adb driver for your device.

3. You need to enable usb debugging in your phone. In older version(less than 4.2) there will be an option for developer in settings or application settings. Click on it you will get an option usb debugging.  Check that check box.

If you have android device having version 4.2 or higher go to settings -> about phone -> tap the build number 7 times.
Now go back to settings, you will find a developer option there. In which you will find the option for usb debugging.

Of course you have your phone is connected to system using usb.

Now your phone is ready. Just make a single change to android studio settings.

Changing Setting in Android Studio:



Near the button which is used to run the app a rotated green triangle in the following image. You will see a dropdown(app is written in the image) in which go to edit configuration and in Android Application go to app and general and set target device as usb. Following photo shows the Exact setting

Changing Setting in Android Studio


Now click on apply and ok. Attach your phone with usb. Restart Android Studio. Now whenever you run any app in Android Studio. It will be automatically deploy to your device instead of emulator. It is very much faster than the emulator.

I hope it helps. If you have any problems or queries do not hesitate to comment. May be I can help.
Till then enjoy developing your app.