vijay

welcome Netizen

Share Your Knowledge.It is a way to achieve immortality

Monday, July 30, 2012

Download button in png format for android


Here you can use the below button image in your android application.
It’s very easy process to set button image style as we like it.Just you can download the any png type buttons and set image as background for button control.
Here I gave some type of image, if you like these below images then follow the below steps to set background image.
Download the below image:

 
Steps:
First import the images into application drawable folder.
In xml design set the background image from the drawable folder.
Also set the button text
Code:
<Button
        android:id="@+id/button2"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:text="Enter"
        android:textColor="#ffffff"
        android:layout_gravity="center"
         android:background="@drawable/btnorange" />
    <Button
        android:id="@+id/button3"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:text="Enter"
        android:textColor="#ffffff"
        android:layout_gravity="center"
         android:background="@drawable/btnbluee" />
    <Button
        android:id="@+id/button1"
        android:layout_width="150dp"
        android:layout_height="wrap_content"
        android:text="Enter"
        android:textColor="#ffffff"
        android:layout_gravity="center"
        android:background="@drawable/btnblack" />


Friday, July 27, 2012

Earn more money with your mobile application


If you are mobile developer ,you are developing more application on your own ,,then start earning with your application.Now Nokia have tie up with  entered into partnerships withBharti Airtel (Airtel), Vodafone India (Vodafone) and Reliance Mobile, the top GSM mobile operators in India, to offer integrated billing solutions.

Even you can download the price application from the nokia store directly without using any credit card, they can get the money form your prepaid balance or in your postpaid.

For Developers have an opportunity to create and distributing your local application in Nokia store.
Then you can get the profit depends on your application download and usage on market.

Publish Nokia store on easy steps:

Here are the steps for adding your apps to Nokia Store once you've tested and packaged them:
Step 1: Register to become a publisher if you haven't already done so. There is a one-time 1 euro registration fee.
Step 2: Go to the Nokia Publish self-serve tool.
Step 3: Add your content metadata, including icons, screen shots, and content descriptions. Choose a price point.
Step 4: Upload your packaged installation file.
Step 5: Select the devices, countries and languages to which you want to distribute your content.
Step 6: Submit your content for our Quality Assurance (QA) review. Plan for a turnaround time of four to six days.
Once your content receives QA approval, it will be pushed live to the Nokia Store content servers through a scheduled export process. Through your Nokia Publish account, you can view daily reports on downloads, sales, and estimated revenues. You are paid on a monthly basis once you've accumulated more than 100 euros in sales.
For more information refer the link

Wednesday, July 25, 2012

Create different type gradient color in android


Here I will explain to create the different type of gradient color applied in android application.
Normally the gradient colors are used to apply as background color to make our application more style.
In android we can create the three type of gradient color.
1. Linear
2. Radial
3. Sweep
Initially we need to create on xml file with gradient color specification then we can use the xml file throughout the project .we set the xml file as background in any layout used in the activity.
Step 1:
Create new xml file with shape layout,name the xml file bggrad.xml
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android"
    android:shape="rectangle">
    <gradient android:type="linear"
        android:gradientRadius="200"
        android:startColor="#8B8A88"
        android:endColor="#CCCCCC"
        />  
</shape>

Here you can set the gradient type as you like there are three types available linear,sweep and radial by changing the radius the shade will be differ. Also set the start and end color
Step 2:
Then use the xml file as background in your all xml files for example see the below code..
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:orientation="vertical"
    android:background="@drawable/bggrad">  
</LinearLayout>

Here I set the background bggrad xml file, so your layout has apply the gradient color.
I hope you like this article ..post your valuable comments here……..




Friday, July 20, 2012

How to remove empty rows from the datatable


Here I want share some useful code,Normally we have get the scenario to the data form the excel table or output table, while getting  in some table contains empty row,when import all the data to datatable we get some empty rows in datable.so when binding the record we donn’t like to bind with empty value.
In that case you can use the below code to remove the empty rows from the datatable.

Code:

  Dim dt, dt1 As New DataTable
        Dim dr As DataRow()
        dt.Columns.Add("name", GetType(System.String))
        dt.Columns.Add("stud", GetType(System.String))
        dt.Rows.Add("Rahul", "v1")
        dt.Rows.Add("", "")
        dt.Rows.Add("sairam", "v1")
        dt.Rows.Add("sathish", "v1")
        dt.Rows.Add("vengatesh", "v1")
        dt.Rows.Add("Lokesh", "v1")
        dt.Rows.Add("www.dotnetcode.in", "v1")
        dt.Rows.Add("", "")
        ''Here filter the empty rows value
        dr = dt.Select("name<>''")
        ''Here clone the dt columns name with dt1
        dt1 = dt.Clone()
        'dt.Clear()
        For Each DRow As DataRow In dr
            ''Finally copy the rows to anther datatable dt1
            dt1.ImportRow(DRow)
        Next
        '**********www.dotnetcode.in***********
        '--------------------------------------

All the empty rows are filtered and stored into another datatable. This is not  the final solution to remove the empty rows,even if you have any other method or code please share here with your
Comments..

Thursday, July 19, 2012

How to show two items in a List View in android application


Already I have written articles about ListView, it’s about to context menu using in listview.


Here I would share the method to use display two items in List View.
For display Single item in ListView we use array adapter, to display multiple items in List View, we use simple adapter.
Below I clearly depict to use the step by step method to use multiple items in ListView.
Step 1:
First create a layout to use in list view, with respect to the display items must add the textview,Here I would display two items and one image in list view, so I added two TextView and image .
rowlayout.xml
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:orientation="horizontal"
    android:paddingTop="20dp">          
<ImageView
        android:id="@+id/icon"
        android:layout_width="22dp"
        android:layout_height="22dp"
        android:layout_marginLeft="4dp"
        android:layout_marginRight="10dp"
        android:layout_marginTop="4dp"
        android:src="@drawable/man" >
    </ImageView>
    <LinearLayout
       android:layout_width="wrap_content"
    android:layout_height="wrap_content"
          android:orientation="vertical">
    <TextView
        android:id="@+id/label"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:text="@+id/label"
       android:textSize="12sp"        
       android:textStyle="bold"
        android:textColor="#000000">       
    </TextView> 
     <TextView
        android:id="@+id/label1"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:textSize="12sp"
        android:textStyle="italic"
        android:typeface="sans"
        android:textColor="#000000">       
    </TextView>
    </LinearLayout> 
</LinearLayout>

Friday, July 13, 2012

Show Dialog or Message box in android application


Here I share a bit of useful information to use efficient show dialog box in android application.
Showing message box to user is very important to get the confirmation from the user.so dialog box must use in all the activity to result to user. When use dialog we need create separate layout every time we must call the layout set the message to the user. Instead of writing the code in all the activity create separate class for dialog box just pass only the message.
By writing the code by this way to reduce the code size, it will be very neat maintaining the code.
1.       First create the xml layout for to use in Dialog box.
dialog.xml
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
   android:orientation="vertical"
   android:layout_width="fill_parent"
   android:layout_height="fill_parent">
    <ScrollView
              android:layout_width="fill_parent"
              android:layout_height="fill_parent">
                            <LinearLayout
                     android:orientation="vertical"
                     android:layout_width="fill_parent"
                     android:layout_height="fill_parent"
                     android:paddingLeft="5px"
                     android:paddingRight="5px"
                     android:paddingBottom="10px" >
                     <TextView
                           android:id="@+id/textView1"
                           android:layout_width="wrap_content"
                           android:layout_height="wrap_content"
                           android:layout_centerHorizontal="true"
                           android:layout_marginBottom="5dip"
                           android:layout_marginLeft="5dip"
                           android:layout_marginRight="5dip"/>            
                     <Button
                           android:id="@+id/button1"
                           android:text="@string/clc"
                           android:layout_width="wrap_content"
                           android:layout_height="wrap_content"
                           android:layout_gravity="center"/>       
              </LinearLayout>     
       </ScrollView>   
</LinearLayout>

2.       

 create common class file ,here I use class file name as setdialog.class


Write the below code on the class file..
Code:
void alert(final Dialog dialog,String msg )
       {
              // For Dialog Button**********************************
              dialog.setContentView(R.layout.dialog);
              dialog.setTitle("Result");
              final TextView dialogtxt = (TextView) dialog
                           .findViewById(R.id.textView1);
              final Button closeButton = (Button) dialog
                           .findViewById(R.id.button1);
              closeButton.setOnClickListener(new View.OnClickListener() {
                     @Override
                     public void onClick(View v) {
                           // TODO Auto-generated method stub
                           dialog.dismiss();
                     }
              });
                     dialogtxt.setText(msg);
              dialog.show();
              // ****************************************************
       }

Next step we must create the object for the class we use the dialog box wherever we want….
For an example I pass the message to dialog box from the activity.
First I create object for setdialog class and pass the message and dialog and alos don’t forget the below code activity class file
final Dialog dialog = new Dialog(this);
setdialog show=new setdialog();
show.alert(dialog,"Details are succesfully updated");

That’s it…In the above code if you have any doubt plz share with comments…