Create a Virtual Machine in Windows Azure

What is Windows Azure?


Microsoft Azure is a cloud computing platform and infrastructure, created by Microsoft, for building, deploying and managing applications and services through a global network of Microsoft-managed datacenters.

What is a Virtual Machine?


A virtual machine (VM) is a software-based emulation of a computer. Virtual machines operate based on the computer architecture and functions of a real or hypothetical computer.

Steps to create a Virtual Machine in Azure


01. Login to your Azure account
   

02. When you login to the Azure Account you would see something similar to
    

03. Navigate to Virtual Machine in the left corner menu bar

You can see already created virtual machines.
 

04. In order to create a new virtual machine click “NEW” button in the left bottom corner

05. Fill the required information and press “CREATE A VIRTUAL MACHINE”


06. To start the virtual machine go to the created virtual machine then navigate to the Dashboard and press Connect which can be seen in the bottom
   

It will download an .rdp file as shown in the following image
    

07. Open .rdp file and click connect
   

08. Enter username and password which were given while creating the virtual machine.

09. In the certification window press yes in order to complete the connection
   


Finally you’ll be connected with the virtual machine as shown in the above image. 

How to remove watermark from WOW Slider

What is wow slider?


The most strong and popular web design trend over last couple of years is a sliding horizontal panels also known as Sliders or Carousels. It's a very effective method to increase the web site usability and engage the user.

WOW Slider is a responsive jQuery image slider with amazing visual effects (Collage, Photo, Domino, Page, Rotate, Blur, Flip, Blast, Fly, Blinds, Squares, Slices, Basic, Fade, Ken Burns, Stack, Stack vertical, Basic linear, Book, Cube and Seven) and tons of professionally made templates.

How to create a slide show using WoW Slider?



2. In the main navigation bar click Downloads and go to the downloads page.

3. In the downloads page, enter your user name, email address and get the download link.

    


4. After downloading, install it and then open it.

    


5. Add few photos, select a template, set image sizes, select transitions and create an awesome slider

6. Finally select a method and hit publish.

The created folder would look like    



When you open the slider in a web browser you can see there is a water mark in the bottom right corner. As you can see before adding this slider to a web page we have to get rid of this.



How to remove the water mark


1. Go to data1 folder and then to the images folder. There you can see the added images with the watermarks. Replace the images with the original once but keep in mind the image sizes needs to fit with the watermarked images.

2. After replacing the images go to engine1 folder, right click on wowslider.js and open it.

3. Press ctrl + f (Find) and type “0 0 0 0” then hit “Find Next” twice.

4. You will be able to see something similar to

margin:"0 0 0 0","border-radius":"5px","-moz-border-radius":"5px",outline:"none"}).attr({href:"http://"+d.toLowerCase()}).html(d).bind("contextmenu",function(c){return false}).show().appendTo…………..

Here change show() to hide() and save it. Then this code fragment would look like

margin:"0 0 0 0","border-radius":"5px","-moz-border-radius":"5px",outline:"none"}).attr({href:"http://"+d.toLowerCase()}).html(d).bind("contextmenu",function(c){return false}).hide().appendTo…………..

5. Again when you run index.html file and open the slider in a browser, no watermark can be seen.

    



As you can see it is very easy to remove the watermarks from the wow slider. Therefore you can create amazing sliders and make your web site look more professional. 

How get an Android certificate in eclipse and the Google Maps API key

This is one thing that bothers so many beginners who wants to add a google map to their android application. So in this tutorial I will show the path towards getting a API Key from google.  To access the Google Maps servers with the Maps API, you have to add a Maps API key to your application. The key is free, you can use it with any of your applications that call the Maps API, and it supports an unlimited number of users.

01. How to find your app's certificate information


Step by step I’ll show you how get it done in eclipse. First start eclipse and let’s create a new project
We’ll call the project “demogooglemap” and specially remember the name of the package that you put because we’ll need it shortly.




After creating the project go to Windows à preferences  

 


Expand the Android tab à Build, then copy the SHA1 fingerprint value as it will also be needed shortly.

 


02. Obtain a Google Maps API key


After required information is collected now it is time to obtain the API key from google. To do it

1. Navigate to your project in the Google APIs Console (https://code.google.com/apis/console/?noredirect)
It will ask you to log in then you will be redirected to a page which will look like

    

Then go to Services page, verify that the "Google Maps Android API v2" is enabled.

      

Next in the navigation bar, click API Access.





Now In the resulting dialog, enter the SHA-1 fingerprint, then a semicolon, then your application's package name. Here you have to use previously gathered SHA1 fingerprint value and the package name we used while creating the project.


Now copy the API key as shown in the following image



03. Add the API key to your application


Add the following code in the AndroidManifest.xml withe the API key which you got from the google console. 

<meta-data
   
android:name="com.google.android.maps.v2.API_KEY"
   
android:value="API_KEY"/>


Replace the android:value, API_KEY with the value returned by Google console

Connect Genymotion by adding genymotion plugin to eclipse

In one of my previous posts I showed how to download and install genymotion in your computer. But to run android applications that you have built, genymotion virtual device has to get connected with eclipse. So in this tutorial I will show how to connect genymotion in order to run and test your android application in it.

1. Setup genymotion plugin in eclipse


Here I assume you have fulfilled all the prerequisites in order to develop android applications using eclipse.
After opening eclipse go to help menu and press Install new software



    


In the given “Work with:” space, type “Genymotion – http://plugins.genymotion.com/eclipseand press Add

In the popup windows type as it shows in the following image


Then select Genymobile and press next

    

    


Finally it will add genymotion to eclipse. Now you can see a small icon which represents the genymotion virtual device.
   

2. Run android project in genymotion

After successfully setting up genymotion in eclipse now you can use it to run what you have built so far.
Before starting to run any projects you need to start genymotion virtual device

Click the above shown small icon in order to start a genymotion virtual device and it will prompt to select a device which we have already downloaded and installed. If you don’t know how to do it follow my previous tutorial.


Select a device and press start then it will start the genymotion emulator.
    

    


Now to run your project by selecting the genymotion emulator.

Follow the steps as shown in the following images.

    

    

    


As shown above, select the virtual device and press ok. The project will then run in the previously started genymotion virtual device.



You can see how fast the application starts compared to other inbuilt emulators. So you can run any project in the similar way.



Get a Faster Android Emulator to run applications


In this tutorial I will show you how run your android application much faster than in the normal emulator.  The new emulator is known as genymotion. You’ll need VirtualBox installed, and you’ll also need to sign up for a free Genymotion account before you can start download virtual machines.

1. Go to the main genymotion web site and sign up in order to download genymotion


After signing up you will be able to download genymotion. While downloading it will ask to download VirtualBox so if your machine doesn’t have it let it be downloaded.


2. After downloading process is completed run the setup


Not many issues keep on pressing next, easy setup process. It will prompt to install virtualbox and if it is already installed just ignore it.

3. Run Genymotion


After the installation process run genymotion.



Then the main interface would look like this. Play around and get familiar with it. Here in the list it shows the devices which I have already downloaded and installed.



I will show you how to add a new device

As shown in the following picture press Add button, then it will prompt a new window.



Here select a device to be downloaded from the list. After selecting a device press Next. you will see more details of the device that you have selected.



Start downloading the device by pressing next



4. After downloading virtual devices you can run it. Select a device from the list and press Play then the device will start automatically.







You can see how fast this works compare to other android emulators. Because it takes advantages of OpenGL hardware acceleration, it allows you to test your applications with amazing 3D performance.

An Android Application to Locate mobile devices


To find the exact location of a person or any kind of a device we have to use Latitude and Longitude values of that particular object. So using the mobile application that we are going to built, it can be used to get the Latitude and Longitude values according to the location of the mobile device. The values will dynamically change when mobile device location changes.

Let's build the Application

First in order  to create the android application follow the following steps 

1. Create a new android application project



Here in the Application name put what ever name that you would like to use and accordingly the Project Name and the Package Name would also be generated. 


After that, press Next button until you come across the following page and hit finish. 


2. Adding permission

After successfully creating the application, there is a set of permission that needs to be added in order to get the latitude and longitude values. 

So go to the main AndroidManifest.xml page and add the following code just before <application> starts

    <uses-permission android:name="android.permission.ACCESS_FINE_LOCATION"/>
    <uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION"/>


3. Adjusting the layout

Now let's look at how to create the main interface and how the values will be displayed.

Go to res --> layout --> activity_main.xml,  add text fields and the Graphical Layout should look like

 And in the  activity_main.xml file the complete code should look like

<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:tools="http://schemas.android.com/tools"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:paddingBottom="@dimen/activity_vertical_margin"
    android:paddingLeft="@dimen/activity_horizontal_margin"
    android:paddingRight="@dimen/activity_horizontal_margin"
    android:paddingTop="@dimen/activity_vertical_margin"
    tools:context=".MainActivity" >

    <TextView
        android:id="@+id/textView1"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_alignParentLeft="true"
        android:text="Measure GPS Cordinates"
        android:textAppearance="?android:attr/textAppearanceMedium" />

    <TextView
        android:id="@+id/textView2"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_alignLeft="@+id/textView1"
        android:layout_below="@+id/textView1"
        android:layout_marginTop="122dp"
        android:text="Latitude"
        android:textAppearance="?android:attr/textAppearanceMedium" />

    <TextView
        android:id="@+id/textLat"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_alignBottom="@+id/textView2"
        android:layout_marginLeft="41dp"
        android:layout_toRightOf="@+id/textView2"
        android:text=""
        android:textAppearance="?android:attr/textAppearanceMedium" />

    <TextView
        android:id="@+id/textView4"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_alignLeft="@+id/textView2"
        android:layout_centerVertical="true"
        android:text="Longitude"
        android:textAppearance="?android:attr/textAppearanceMedium" />

    <TextView
        android:id="@+id/textLong"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_alignBottom="@+id/textView4"
        android:layout_alignLeft="@+id/textLat"
        android:text=""
        android:textAppearance="?android:attr/textAppearanceMedium" />
    

</RelativeLayout>

4. Finally add the following code in the MainActivity.java file 


And the complete code 


package com.example.location;

import android.location.Location;
import android.location.LocationListener;
import android.location.LocationManager;
import android.os.Bundle;
import android.app.Activity;
import android.content.Context;
import android.widget.TextView;


public class MainActivity extends Activity {
TextView textLat;
TextView textLong;
double pLat;
double pLong;
    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);
        
        textLat = (TextView)findViewById(R.id.textLat);
        textLong = (TextView)findViewById(R.id.textLong);
        
        LocationManager lm = (LocationManager)getSystemService(Context.LOCATION_SERVICE);
        LocationListener ll = new myLocationListeren();
        lm.requestLocationUpdates(LocationManager.GPS_PROVIDER, 0, 0, ll);
    }
    
        class myLocationListeren implements LocationListener{

@Override
public void onLocationChanged(Location location) {
if(location != null)
{
pLat = location.getLatitude();
pLong = location.getLongitude();
textLat.setText(Double.toString(pLat));
textLong.setText(Double.toString(pLong));
}
}

@Override
public void onProviderDisabled(String provider) {
// TODO Auto-generated method stub
}

@Override
public void onProviderEnabled(String provider) {
// TODO Auto-generated method stub
}

@Override
public void onStatusChanged(String provider, int status,
Bundle extras) {
// TODO Auto-generated method stub
}

        }
        
}
   

When you run the code in a real android device it will give values according to device location. When you move the values will also be moved.