Sunday, May 27, 2012

How To Create an Android App

If you have some basic Java knowledge, it’s quite easy to create a simple Android app. Technically, you don’t even have to have an Android smartphone, because you can run and test your app in an emulator. Nevertheless, having a smartphone is a better option.
Here is the list of things you need:
  • Eclipse IDE
  • Android ADT plugin for Eclipse
  • Android smartphone
  • Android SDK which matches the Android version on your smartphone
To create a simple Hello World app, follow these steps:

STEP 1 – Download Eclipse

You can download Eclipse IDE at this link: http://www.eclipse.org/downloads/packages/eclipse-classic-372/indigosr2

STEP 2 – Download Android ADT plugin

  1. Start Eclipse, then select Help > Install New Software….
  2. Click Add, in the top-right corner.
  3. In the Add Repository dialog that appears, enter “ADT Plugin” for the Name and the following URL for the Location:
    https://dl-ssl.google.com/android/eclipse/
  4. Click OK
    Note: If you have trouble acquiring the plugin, try using “http” in the Location URL, instead of “https” (https is preferred for security reasons).
  5. In the Available Software dialog, select the checkbox next to Developer Tools and click Next.
  6. In the next window, you’ll see a list of the tools to be downloaded. Click Next.
  7. Read and accept the license agreements, then click Finish.
    Note: If you get a security warning saying that the authenticity or validity of the software can’t be established, click OK.
  8. When the installation completes, restart Eclipse.

STEP 3 – Download Android SDK

Make sure Eclipse is closed. On Windows 7, go to C:\Users\\android-sdks. Open “SDK Manager.exe”. On other systems android-sdks folder should also be in your home folder.

Download the SDK which matches the version on your phone.

STEP 4 – Configure the phone

Other possibility is to use an emulator. But the main disadvantage of that possibility is slow loading: for every change you make in the source code and wish to test it, you have to wait 2-3 minutes (depending on your computer’s speed) for the emulator to load.
To configure your phone for testing, do as follows:
Setting -> Applications -> Development -> tick USB debugging
Then connect your phone to your PC with an USB cable.

STEP 4 – Open a new Android project

Click File -> New Android project.

Enter the name of your project.

Choose the SDK that matches Android version on your phone.

Add a name of your package.

STEP 5 – Add some code

ADT plugin has created the main activity for you. That code is executed when the application starts.

Delete this line:
setContentView(R.layout.main);
And add these 3:
TextView tv = new TextView(this); 
tv.setText("Hello, Android"); 
setContentView(tv);
Eclipse will prompt you to import the required library for TextView. Just click on the light bulb on the left and double click “Import ‘TextView’”.

STEP 6 – Run the app

Click Run->Run or press Ctrl+F11.
Select your device.

And that’s it! Check your phone to see the results.

10 Cool HTML Tricks

Are you creating or maintaining a blog or a website? You should then know that websites use HTML markup language to represent the content. You would like to have a cool feature or layout? Check out this 10 cool tricks!

HTML trick no. 1 – Clear form input

If you want to provide a visitor a possibility to easily clear his or her input in a form, you just need to add a required button. This line does it all:


HTML trick no. 2 – Add spacing

To add spacing between certain items, add one or more non-breaking space special characters:   . In the following example there are 4 non-breaking spaces between the circle and the square:
    

HTML trick no. 3 – Add a horizontal line

You just have to use the “

” tag.

HTML trick no. 4 – Set character encoding

If you use non-ASCII characters, you should set character encoding in order to display those characters properly. The most commonly used encoding is UTF-8. You have to add the following code into the head section of a document:

Make sure that the document itself is also saved in UTF-8 encoding.

HTML trick no. 5 – Get found!

In order to be more visible to search engines, you should provide some meta data about your site. For example, if you have a web site for selling car parts, you should add meta data somewhat like this:


HTML trick no. 6 – Redirect visitor

If you want to redirect the visitor to another URL, for example 5 seconds after accessing your page, add the following line to the head section:
http://www.the-domain-you-want-to-redirect-to.com”>

HTML trick no. 7 – Encode URL

If you want to link to a document or file which’s path contains non-ASCII characters, you should “URL encode” Check this link out for the complete reference: http://www.w3schools.com/tags/ref_urlencode.asp

HTML trick no. 8 – Add voice recognition (HTML 5)

If you want to add speech recognition to a text input in a HTML5 document, just insert the following line:

HTML trick no. 9 – Insert math equations (HTML 5)

HTML5 supports adding math equasions using MathML language. The just have to be between the tags: and . For example, to insert a fraction x/y use the following code:


x
y


HTML trick no. 10 – Insert a SVG image (HTML 5)

HTML5 supports adding SVG (Stored Vector Graphics) images to documents. The just have to be between the tags: and .  For example, to add a circle to a document use the following code:
http://www.w3.org/2000/svg”>

How to remove trojan DNSChanger?



What is DNSChanger malware? Yesterday, i reported that Google will warn users who are affected with DNSChanger trojan. After the post, many readers asked me to write about this Trojan in detail. In this post, i am writing about DNSChanger trojan. DNSChanger is kind of trojan which changes the DNS (Domain Name System) settings of a system to redirect system to some illegal websites. This