Try popular Android Application by Feliz-Droid

Try popular Android Application by Feliz-Droid

Speaking Caller logo
Speaking Caller
   
Battery temperature logo
Battery Temperature
   
Dual Photo logo
Dual Photo
   
Ganesh Wallpapersl ogo
Lord Ganesh Wallpaper
   
Girly Pink Keyboard l ogo
Girly Pink Keyboard

Wednesday, February 1, 2012

How to hide status bar android

Hiding status bar requires your application screen should be full screen.

In order to hide status bar follow below steps.

Step 1)  Your screen don't have title.

requestWindowFeature(Window.FEATURE_NO_TITLE);
getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN, 
                            WindowManager.LayoutParams.FLAG_FULLSCREEN);
Step 2) Copy above code in your activity onCreate method.

Monday, January 30, 2012

How to create auto start android application example

If you want to make your application auto start after device boot finish.
you need to see if device boot completed this is done by BroadcastReceiver let see directly steps for this.

Step 1) Create a class BootUpReceiver.



package com.android;


import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;
import android.widget.Toast;

public class BootUpReceiver extends BroadcastReceiver{


@Override
public void onReceive(Context context, Intent intent) {

   Intent i = new Intent(context, StartupActivity.class);
            i.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
            context.startActivity(i);

}
}


Step 2) Add permissions in Manifest.



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

Step 3) Add receiver entry in Manifest.



  <receiver android:enabled="true" android:name=".BootUpReceiver"
        android:permission="android.permission.RECEIVE_BOOT_COMPLETED">
        <intent-filter>
            <action android:name="android.intent.action.BOOT_COMPLETED" />
            <category android:name="android.intent.category.DEFAULT" />
        </intent-filter>
    </receiver>





Complete Manifest File





<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
    package="com.android"
    android:versionCode="1"
    android:versionName="1.0" >

    <uses-sdk android:minSdkVersion="8" />
<uses-permission android:name="android.permission.RECEIVE_BOOT_COMPLETED" />
    <application
        android:icon="@drawable/ic_launcher"
        android:label="@string/app_name" >
         <receiver android:enabled="true" android:name=".BootUpReceiver"
        android:permission="android.permission.RECEIVE_BOOT_COMPLETED">
        <intent-filter>
            <action android:name="android.intent.action.BOOT_COMPLETED" />
            <category android:name="android.intent.category.DEFAULT" />
        </intent-filter>
    </receiver>
     
        <activity
            android:label="@string/app_name"
            android:name=".StartupActivity" >
               </activity>
    </application>

</manifest>

Step 4) My activity which I want to show to user when my application starts.
this will be your welcome activity.



package com.android;

import android.app.Activity;
import android.os.Bundle;


public class StartupActivity extends Activity {



/** Called when the activity is first created. */
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.main);


}
}