Skip to main content


Showing posts from November, 2013

Formatting and Styling Text in CSS

Text indention [text-indent]
The property text-indent allows you to add an elegant touch to text paragraphs by applying an indent to the first line of the paragraph. p { text-indent: 10px; } Text alignment [text-align]
The CSS property text-align corresponds to the attribute align used in old versions of HTML. Text can either be aligned to the left, to the right or centred. In addition to this, the value justify will stretch each line so that both the right and left margins are straight. p { text-align: left; } h1{ text-align: right; } h2{ text-align: center; } b { text-align: justify; } Text decoration [text-decoration]
The property text-decoration makes it is possible to add different "decorations" or "effects" to text. Some properties are underline, overline, line-through. h1 { text-decoration: underline; } h2 { text-decoration: overline; } h3 { text-decoration: line-thr…

Transferring user to new web page automatically

<META HTTP-EQUIV="Refresh" CONTENT="2;URL="> Use the code above inside your head tag and your web page will be redirected to "" within 2 seconds.
Change the value of CONTENT="2" to some other integer to decrease or increase the delay of redirection of webpage.If "0" is given the change will be seen immediately.

How to align your TabHost at the bottom of the screen

There is a simplest way to align Tabbar at the bottom of the page.
The code is given below copy and download the code and try it...

In the previous example we learned a simple example to add Tabs to our application.Only a small change can give you tabs at the bottom of the page.

In the previous example the xml was like this...
<TabHost xmlns:android="" xmlns:tools="" android:id="@android:id/tabhost" android:layout_width="fill_parent" android:layout_height="fill_parent" tools:context=".MainActivity" > <LinearLayout android:layout_width="fill_parent" android:layout_height="fill_parent" android:orientation="vertical" > <TabWidget android:id="@android:id/tabs" android:layout_width="fill_parent" a…

How to create a full screen activity in Android

In this tutorial we are going to learn how to create a full screen Activity..
Copy and download the code and try yourself..
import android.os.Bundle; import android.view.Window; import android.view.WindowManager; import; public class FullscreenActivities extends Activity { @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); //removes the unwanted contents..... requestWindowFeature(Window.FEATURE_NO_TITLE); getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN, WindowManager.LayoutParams.FLAG_FULLSCREEN); //...................... setContentView(R.layout.activity_fullscreen_activities); } 

Change Tabbar Text (title) dynamically in Android - a simple example

Changing title of tabbar is bit easier in android
Copy and download the code below and try it....

Basic tabbar tutorials see here...
import android.os.Bundle; import android.view.View; import android.view.View.OnClickListener; import android.widget.TabHost; import android.widget.TabHost.TabSpec; import android.widget.TabWidget; import android.widget.TextView; import; import android.content.Intent; public class MainActivity extends TabActivity { TabWidget tw; TabHost tabHost; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); /** TabHost will have Tabs */ tabHost = (TabHost)findViewById(; TabSpec firstTabSpec = tabHost.newTabSpec("tab_id1"); TabSpec secondTabSpec = tabHost.newTabSpec("tab_id2"); TabSpec thirdTabSpec = tabHost.newTabSpec("tab_id3"); …

Using TabHost to create a simple Tabbar application - An Android Example

For creating a tabbar application first create a tabhost object to create tabs
In activity_main.xml we create TabHost and specify a layout where we are going to insert the tabs.
Copy and download the code and try it yourself....

Now we are going to create three tabs.
Lets us now first make the xml for it

activity_main.xml :
TabHost provided flexibility of managing data in different views by providing tabbed interface(compared to TabLayout). TabHost basically a container, where you need to put tab widget, which will host tabbed interface and FrameLayout, within which the different views are presented.
TabHost ( main container of tab view ) TabWidget ( used to navigate between tabs ) FrameLayout ( for tab content ) <TabHost xmlns:android="" xmlns:tools="" android:id="@android:id/tabhost" android:layout_width="fill_parent" android:layout_height="…

Using Font in CSS

Font family [font-family]
The property font-family is used to set a prioritized list of fonts to be used to display a given element or web page.
h1 {font-family: arial, verdana, sans-serif;} h2 {font-family: "Times New Roman", serif;} Font style [font-style]
The property font-style defines the chosen font either in normal, italic or oblique.
h2 {font-family: "Times New Roman", serif; font-style: italic;} Font variant [font-variant]
The property font-variant is used to choose between normal or small-caps variants of a font. A small-caps font is a font that uses smaller sized capitalized letters (upper case) instead of lower case letters.
h1 {font-variant: small-caps;} h2 {font-variant: normal;} Font weight [font-weight]
The property font-weight describes how bold or "heavy" a font should be presented. A font can either be normal or bold.
h1 {font-family: arial, verdana, sans-serif; font-weight: bold;} h2 {font-family: …

Taking Random Values in Corona

Syntax for taking random numbers or values in corona has been given below.
Download the code and try it...

        math.random()          math.random( m )          math.random( m, n )
math.random() ---> a number between 0 and 1
math.random(m) ---> an integer between 1 and n (inclusive)
math.random(m,n) ---> an integer between m and n (inclusive)
math.random() ---> a number between 0 and 1 math.random(20) ---> an integer between 1 and 20 (inclusive) math.random(20, 40) ---> an integer between 20 and 40 (inclusive)

Apple gets India in line: Massive queues to buy iPhone 5S and iPhone 5C on the day of launch

"There isn't much I would stand in line for," enthused 24-year-old Chaitanya Chainani from Wadala. After 2 hours of waiting in line, he finally held the iPhone 5S in his hand.
Mumbai's Phoenix Mills in Lower Parel was one of the selected venues of the launch. The event was supposed to start at 5pm. People were queuing up since 8am. Dhanteras was a smart occasion to launch the two new Apple devices.
read more click here.......

String Functions In Corona

Here is a list of string function which are very useful...

string.byte() Returns the internal numerical codes of the characters in a string.string.char()Returns a string in which each character has the internal numerical code equal to its corresponding argument. string.find() Looks for the first match of a pattern in a string. If found, it returns the indices where the occurrence starts and ends; otherwise, returns nil. string.format()Returns a formatted string following the description given in its arguments. string.gmatch()Returns a pattern-finding iterator. string.gsub()Replaces all occurrences of a pattern in a string. string.len()Returns the length of a string (number of characters). string.lower()Changes uppercase characters in a string to lowercase. string.match()Extracts substrings by matching patterns in a string. string.rep()Replicates a string by returning a string that is the concatenation of n copies of a specified string. string.reverse()Reverses a string.string.sub()Ret…