Pages

Tuesday, June 18, 2013

ListView -Top and bottom fixed

<?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"
>
    <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
        android:layout_width="fill_parent"
        android:layout_height="wrap_content"
        android:orientation="horizontal"
    >
        <TextView 
            android:textSize="12px" 
            android:text="something here" 
            android:layout_width="50px" 
            android:layout_height="wrap_content"
            /> 
        <TextView 
            android:textSize="12px" 
            android:text="something here" 
            android:layout_width="fill_parent" 
            android:layout_height="wrap_content"
        />
    </LinearLayout>
    <RelativeLayout
        android:orientation="vertical"
        android:layout_width="fill_parent"
        android:layout_height="fill_parent"
    >
        <LinearLayout
            android:id="@+id/footer"
            android:orientation="horizontal"
            android:layout_height="wrap_content"
            android:layout_width="fill_parent"
            android:layout_alignParentBottom="true"
        >

            <TextView 
                android:layout_height="wrap_content" 
                android:layout_width="0dip" 
                android:layout_weight="1" 
                android:textSize="12px" 
                android:text="50%" 
                /> 
            <TextView 
                android:layout_height="wrap_content" 
                android:layout_width="0dip" 
                android:layout_weight="1" 
                android:textSize="12px" 
                android:text="50%" 
            /> 

        </LinearLayout>
        <ListView
            android:id="@+id/tablebody"
            android:layout_width="fill_parent"
            android:layout_height="wrap_content"
            android:layout_alignParentTop="true"
            android:layout_above="@id/footer"
        />
    </RelativeLayout>
</LinearLayout>

Monday, June 17, 2013

Android Vibrate on click

If you want to make the phone to vibrate when you click on a button from your application:
1. You have to declare in your AndroidManifest.xml the permission:
?
1
<uses-permission android:name="android.permission.VIBRATE"/> 

Tuesday, June 11, 2013

Android camera .set wallapaper

Android Camera App Tutorial

             In this tutorial how to take a photo using the Android Phone camera and set the photo as wallpaper.Here we are using a Image View and 2 buttons for two actions.Lets start learning.
STEP BY STEP

Facebook key-android hash key

To get android key hash code follow these steps (for facebook apps)
  1. Download the openssl for windows here
  2. now unzip to c drive
  3. open cmd prompt
  4. type cd C:\Program Files\Java\jdk1.6.0_26\bin
  5. then type only keytool -export -alias myAlias -keystore C:\Users\your user name\.android\myKeyStore | C:\openssl-0.9.8k_WIN32\bin\openssl sha1 -binary | C:\openssl-0.9.8k_WIN32\bin\openssl enc -a -e
i.e
keytool -exportcert -alias androiddebugkey -keystore C:\Users\YOURUSERNAME\.android\debug.keystore | C:\openssl-0.9.8k_WIN32\bin\openssl sha1 -binary | C:\openssl-0.9.8k_WIN32\bin\openssl enc -a -e

ENTER PASSWORD: android 
  1. Done


GOOGLE MAPS KEY

  1. open cmd prompt
  2. type cd C:\Program Files\Java\jdk1.7.0_10\bin
  3. then type  
keytool -v -list -alias androiddebugkey -keystore "C:\Users\YOUR USERNAME\.android\debug.keystore" 

password is android
4.copy md5 and sh1 


Simple Camera App Android

Java file