Technical Knowledge

technical knowledge is that type of blogger in which you can find all the soluctions of your problems which you cannot solve you can see the video given on this blog and solve your problem by yourself.

Like us on Facebook

Technical Knowledge
Showing posts with label alarms. Show all posts
Showing posts with label alarms. Show all posts

Sunday, March 29, 2015

Using alarms : Android tutorial

Program description:

This program will demo how to create alarms with broadcast receiver.

This program has one activity and one static broadcast receiver. Activity has a button, on clicking that we will set an alarm which will expire after 5 seconds from now. Once alarm is triggered it will send a broadcast with action "com.techpalle.action.ALARM_RECEIVER".
Once broadcast receiver is triggered, it will show a toast message "alarm tirggered".

In order to send a broadcast by using alarms, here we will use pending intents.

Pending intent: It is used to perform intent operations at future point of time on our behalf by some one else (mostly by alarm manager or notification manager).

Broadcast will be send after 5 seconds from the time of button click. It will be send by alarm manager. Since we are not sending broadcast immediately, and it is sent after 5 seconds. So our intent to send broadcast will be pending till then. That's why it is called as pending intent.

Steps to do this alarm program with broadcast receiver in android:
1. Create a broadcast receiver that will be triggered/ called after 5 seconds.
2. Come to activity java file, Create alarm manager object by using getSystemService() method.
3. Create intent to send a broadcast.
4. Create pending intent to shoot a broadcast from above created intent.
5. set the alarm for next 5 seconds by using alarm manager and pass pending intent.

First Activity:

package com.techpalle.b15_alarms;

import android.os.Bundle;
import android.app.Activity;
import android.app.AlarmManager;
import android.app.PendingIntent;
import android.content.Context;
import android.content.Intent;
import android.view.Menu;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.Button;

public class MainActivity extends Activity {
Button b;
AlarmManager am;

@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
b = (Button) findViewById(R.id.button1);
//step1 : create alarm manager
am = (AlarmManager) getSystemService(Context.ALARM_SERVICE);
b.setOnClickListener(new OnClickListener() {
@Override
public void onClick(View v) {
//a. create intent
Intent in = new Intent();
in.setAction("com.techpalle.action.ALARM_RECEIVER");
//b. create pending intent
PendingIntent pi = PendingIntent.getBroadcast(
getApplicationContext(),
0,
in,
0);
//c. set alarm for 5 seconds.
am.set(AlarmManager.RTC_WAKEUP,
System.currentTimeMillis()+5000,
pi);


}
});
}
}

Broadcast receiver 
File name : AlarmRecvr.java

package com.techpalle.b15_alarms;

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

public class AlarmRecvr extends BroadcastReceiver {
@Override
public void onReceive(Context context, Intent intent) {
Toast.makeText(context, "Got the alarm..", 0).show();
}
}

xml file for first activity 
File name : activity_main.xml
  xmlns:tools="http://schemas.android.com/tools" 
android:layout_width="match_parent"
android:layout_height="match_parent"
android:paddingBottom="@dimen/activity_vertical_margin"
android:paddingLeft="@dimen/activity_horizontal_margin"
android:paddingRight="@dimen/activity_horizontal_margin"
android:paddingTop="@dimen/activity_vertical_margin"
tools:context=".MainActivity" >

Manifest file
File name : AndroidManifest.xml
  
package="com.techpalle.b15_alarms"
android:versionCode="1"
android:versionName="1.0" >
android:minSdkVersion="8"
android:targetSdkVersion="17" />
android:allowBackup="true"
android:icon="@drawable/ic_launcher"
android:label="@string/app_name"
android:theme="@style/AppTheme" >
android:name="com.techpalle.b15_alarms.MainActivity"
android:label="@string/app_name" >













Download complete code : Click to download

Android interview questions on Power manager and wake locks:
What is sleep mode? What will happen to CPU when LCD is turned off?
What are the two components that runs in Sleep mode also?
Every day night at 12 o clock I need to post some images to Facebook, in that case I will set repeating alarm for every day night 12 am. But to upload images I want to start service, how should I do this ?
What is the difference between Intent, Sticky Intent, and Pending Intent?

Repeating alarms with irregular intervals : Android tutorial

Program description:

This program will demo how to create alarms which will repeat at irregular intervals.

This program has one activity with one button, and a broadcast receiver.
On clicking the button, we will set an alarm for next 1 second, which triggers broadcast receiver.
Our program aim is to repeat next alarm at 2 seconds, next at 4 seconds, next at 8 seconds and so on.. For this requirement we can't use setRepeating() function of alarm manager.
We have to set the alarm manually in the receiver.

Once the first alarm (which was set for 1 second) is triggered, it will call broadcast receiver. In the receiver set alarm for next 2 seconds from that time. Which will again call same broadcast receiver after 2 seconds. Again set one more alarm for next 4 seconds in that receiver. For this we have to write a generic logic, because alarm has to repeat for n number of times.

First Activity:


package com.techpalle.b15_alarm_asg2;

import android.os.Bundle;
import android.app.Activity;
import android.app.AlarmManager;
import android.app.PendingIntent;
import android.content.Context;
import android.content.Intent;
import android.view.Menu;
import android.view.MenuItem;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.Button;

public class MainActivity extends Activity {
AlarmManager am;
Button b;

@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
am = (AlarmManager) getSystemService(Context.ALARM_SERVICE);
b = (Button) findViewById(R.id.button1);
b.setOnClickListener(new OnClickListener() {
@Override
public void onClick(View v) {
// TODO Auto-generated method stub
Intent in = new Intent();
in.setAction("com.techpalle.action.ALARM_INDEF");
int i=1;
in.putExtra("val", i);
PendingIntent pi = PendingIntent.getBroadcast(
getApplicationContext(),
0,
in,
0);
am.set(AlarmManager.RTC_WAKEUP,
System.currentTimeMillis()+1000,
pi);

}
});
}

@Override
public boolean onCreateOptionsMenu(Menu menu) {
// Inflate the menu; this adds items to the action bar if it is present.
getMenuInflater().inflate(R.menu.main, menu);
return true;
}

@Override
public boolean onOptionsItemSelected(MenuItem item) {
// TODO Auto-generated method stub
return super.onOptionsItemSelected(item);
}

}

Broadcast receiver 
File name : AlarmRecvr.java


package com.techpalle.b15_alarm_asg2;

import android.app.AlarmManager;
import android.app.PendingIntent;
import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;
import android.view.ViewDebug.FlagToString;
import android.widget.Toast;

public class AlarmRecvr extends BroadcastReceiver {
//public static int i = 1;
@Override
public void onReceive(Context context, Intent intent) {
int i = intent.getExtras().getInt("val");
i = i*2;
Toast.makeText(context, "Got", 0).show();
Intent in = new Intent();
in.setAction("com.techpalle.action.ALARM_INDEF");
in.putExtra("val", i);
PendingIntent pi = PendingIntent.getBroadcast(
context, 0, in, PendingIntent.FLAG_UPDATE_CURRENT);
AlarmManager am = (AlarmManager) context.getSystemService(context.ALARM_SERVICE);
am.set(AlarmManager.RTC_WAKEUP,
System.currentTimeMillis()+(i*1000),
pi);
}
}

xml file for first activity 
File name : activity_main.xml
  xmlns:tools="http://schemas.android.com/tools" 
android:layout_width="match_parent"
android:layout_height="match_parent"
android:paddingBottom="@dimen/activity_vertical_margin"
android:paddingLeft="@dimen/activity_horizontal_margin"
android:paddingRight="@dimen/activity_horizontal_margin"
android:paddingTop="@dimen/activity_vertical_margin"
tools:context=".MainActivity" >
android:id="@+id/textView1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/hello_world" />

Manifest file
File name : AndroidManifest.xml

  
package="com.techpalle.b15_alarm_asg2"
android:versionCode="1"
android:versionName="1.0" >
android:minSdkVersion="8"
android:targetSdkVersion="17" />
android:allowBackup="true"
android:icon="@drawable/ic_launcher"
android:label="@string/app_name"
android:theme="@style/AppTheme" >
android:name="com.techpalle.b15_alarm_asg2.MainActivity"
android:label="@string/app_name" >













Download complete code : Click to download

Android interview questions on Power manager and wake locks:
What is sleep mode? What will happen to CPU when LCD is turned off?
What are the two components that runs in Sleep mode also?
Every day night at 12 o clock I need to post some images to Facebook, in that case I will set repeating alarm for every day night 12 am. But to upload images I want to start service, how should I do this ?
What is the difference between Intent, Sticky Intent, and Pending Intent?

Repeating alarms : Android tutorial

Program description:

This program will demo how to create repeating alarms, which will trigger broadcast receivers.


This program has one activity with one button, and a broadcast receiver.
On clicking the button we will set an alarm which will trigger after 5 seconds from now.
That alarm will keep repeating for every next 5 seconds. Every time it triggers it will send a broadcast receiver. Broadcast receiver will print "got" message for every 5 seconds.

Before using this program, you should know  how to create alarms with broadcast receiver.

First Activity


package com.techpalle.b15_alarm_asg1;

import java.util.List;

import android.os.Bundle;
import android.app.Activity;
import android.app.ActivityManager;
import android.app.AlarmManager;
import android.app.PendingIntent;
import android.app.ActivityManager.RunningTaskInfo;
import android.content.Context;
import android.content.Intent;
import android.view.Menu;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.Button;

public class MainActivity extends Activity {
AlarmManager am;
Button b;
ActivityManager acm;

@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
acm = (ActivityManager) getSystemService(Context.ACTIVITY_SERVICE);
List l = acm.getRunningTasks(10);

b = (Button) findViewById(R.id.button1);
am = (AlarmManager) getSystemService(Context.ALARM_SERVICE);
b.setOnClickListener(new OnClickListener() {
@Override
public void onClick(View v) {
Intent in = new Intent();
in.setAction("com.techpalle.action.ALARM_REPEAT");
PendingIntent pi = PendingIntent.getBroadcast(
getApplicationContext(),
0, in, 0);
am.setRepeating(AlarmManager.RTC_WAKEUP,
System.currentTimeMillis()+5000,
5000,
pi);
}
});
}

@Override
public boolean onCreateOptionsMenu(Menu menu) {
// Inflate the menu; this adds items to the action bar if it is present.
getMenuInflater().inflate(R.menu.main, menu);
return true;
}

}

Broadcast receiver 
File name : AlarmRecvr.java
package com.techpalle.b15_alarm_asg1;

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

public class AlarmRecvr extends BroadcastReceiver {

@Override
public void onReceive(Context context, Intent intent) {
// TODO Auto-generated method stub
Toast.makeText(context, "got", 0).show();
}

}

xml file for first activity 
File name : activity_main.xml

  xmlns:tools="http://schemas.android.com/tools" 
android:layout_width="match_parent"
android:layout_height="match_parent"
android:paddingBottom="@dimen/activity_vertical_margin"
android:paddingLeft="@dimen/activity_horizontal_margin"
android:paddingRight="@dimen/activity_horizontal_margin"
android:paddingTop="@dimen/activity_vertical_margin"
tools:context=".MainActivity" >
android:id="@+id/textView1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/hello_world" />

Manifest file
File name : AndroidManifest.xml
  
package="com.techpalle.b15_alarm_asg1"
android:versionCode="1"
android:versionName="1.0" >
android:minSdkVersion="8"
android:targetSdkVersion="17" />
android:allowBackup="true"
android:icon="@drawable/ic_launcher"
android:label="@string/app_name"
android:theme="@style/AppTheme" >
android:name="com.techpalle.b15_alarm_asg1.MainActivity"
android:label="@string/app_name">












hi

Download complete code : Click to download

Android interview questions on Power manager and wake locks:
What is sleep mode? What will happen to CPU when LCD is turned off?
What are the two components that runs in Sleep mode also?
Every day night at 12 o clock I need to post some images to Facebook, in that case I will set repeating alarm for every day night 12 am. But to upload images I want to start service, how should I do this ?
What is the difference between Intent, Sticky Intent, and Pending Intent?

Monday, March 23, 2015

Using alarms : Android tutorial

Program description:

This program will demo how to create alarms with broadcast receiver.

This program has one activity and one static broadcast receiver. Activity has a button, on clicking that we will set an alarm which will expire after 5 seconds from now. Once alarm is triggered it will send a broadcast with action "com.techpalle.action.ALARM_RECEIVER".
Once broadcast receiver is triggered, it will show a toast message "alarm tirggered".

In order to send a broadcast by using alarms, here we will use pending intents.

Pending intent: It is used to perform intent operations at future point of time on our behalf by some one else (mostly by alarm manager or notification manager).

Broadcast will be send after 5 seconds from the time of button click. It will be send by alarm manager. Since we are not sending broadcast immediately, and it is sent after 5 seconds. So our intent to send broadcast will be pending till then. That's why it is called as pending intent.

Steps to do this alarm program with broadcast receiver in android:
1. Create a broadcast receiver that will be triggered/ called after 5 seconds.
2. Come to activity java file, Create alarm manager object by using getSystemService() method.
3. Create intent to send a broadcast.
4. Create pending intent to shoot a broadcast from above created intent.
5. set the alarm for next 5 seconds by using alarm manager and pass pending intent.

First Activity:

package com.techpalle.b15_alarms;

import android.os.Bundle;
import android.app.Activity;
import android.app.AlarmManager;
import android.app.PendingIntent;
import android.content.Context;
import android.content.Intent;
import android.view.Menu;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.Button;

public class MainActivity extends Activity {
Button b;
AlarmManager am;

@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
b = (Button) findViewById(R.id.button1);
//step1 : create alarm manager
am = (AlarmManager) getSystemService(Context.ALARM_SERVICE);
b.setOnClickListener(new OnClickListener() {
@Override
public void onClick(View v) {
//a. create intent
Intent in = new Intent();
in.setAction("com.techpalle.action.ALARM_RECEIVER");
//b. create pending intent
PendingIntent pi = PendingIntent.getBroadcast(
getApplicationContext(),
0,
in,
0);
//c. set alarm for 5 seconds.
am.set(AlarmManager.RTC_WAKEUP,
System.currentTimeMillis()+5000,
pi);


}
});
}
}

Broadcast receiver 
File name : AlarmRecvr.java

package com.techpalle.b15_alarms;

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

public class AlarmRecvr extends BroadcastReceiver {
@Override
public void onReceive(Context context, Intent intent) {
Toast.makeText(context, "Got the alarm..", 0).show();
}
}

xml file for first activity 
File name : activity_main.xml
  xmlns:tools="http://schemas.android.com/tools" 
android:layout_width="match_parent"
android:layout_height="match_parent"
android:paddingBottom="@dimen/activity_vertical_margin"
android:paddingLeft="@dimen/activity_horizontal_margin"
android:paddingRight="@dimen/activity_horizontal_margin"
android:paddingTop="@dimen/activity_vertical_margin"
tools:context=".MainActivity" >

Manifest file
File name : AndroidManifest.xml
  
package="com.techpalle.b15_alarms"
android:versionCode="1"
android:versionName="1.0" >
android:minSdkVersion="8"
android:targetSdkVersion="17" />
android:allowBackup="true"
android:icon="@drawable/ic_launcher"
android:label="@string/app_name"
android:theme="@style/AppTheme" >
android:name="com.techpalle.b15_alarms.MainActivity"
android:label="@string/app_name" >













Download complete code : Click to download

Android interview questions on Power manager and wake locks:
What is sleep mode? What will happen to CPU when LCD is turned off?
What are the two components that runs in Sleep mode also?
Every day night at 12 o clock I need to post some images to Facebook, in that case I will set repeating alarm for every day night 12 am. But to upload images I want to start service, how should I do this ?
What is the difference between Intent, Sticky Intent, and Pending Intent?

Repeating alarms with irregular intervals : Android tutorial

Program description:

This program will demo how to create alarms which will repeat at irregular intervals.

This program has one activity with one button, and a broadcast receiver.
On clicking the button, we will set an alarm for next 1 second, which triggers broadcast receiver.
Our program aim is to repeat next alarm at 2 seconds, next at 4 seconds, next at 8 seconds and so on.. For this requirement we can't use setRepeating() function of alarm manager.
We have to set the alarm manually in the receiver.

Once the first alarm (which was set for 1 second) is triggered, it will call broadcast receiver. In the receiver set alarm for next 2 seconds from that time. Which will again call same broadcast receiver after 2 seconds. Again set one more alarm for next 4 seconds in that receiver. For this we have to write a generic logic, because alarm has to repeat for n number of times.

First Activity:


package com.techpalle.b15_alarm_asg2;

import android.os.Bundle;
import android.app.Activity;
import android.app.AlarmManager;
import android.app.PendingIntent;
import android.content.Context;
import android.content.Intent;
import android.view.Menu;
import android.view.MenuItem;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.Button;

public class MainActivity extends Activity {
AlarmManager am;
Button b;

@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
am = (AlarmManager) getSystemService(Context.ALARM_SERVICE);
b = (Button) findViewById(R.id.button1);
b.setOnClickListener(new OnClickListener() {
@Override
public void onClick(View v) {
// TODO Auto-generated method stub
Intent in = new Intent();
in.setAction("com.techpalle.action.ALARM_INDEF");
int i=1;
in.putExtra("val", i);
PendingIntent pi = PendingIntent.getBroadcast(
getApplicationContext(),
0,
in,
0);
am.set(AlarmManager.RTC_WAKEUP,
System.currentTimeMillis()+1000,
pi);

}
});
}

@Override
public boolean onCreateOptionsMenu(Menu menu) {
// Inflate the menu; this adds items to the action bar if it is present.
getMenuInflater().inflate(R.menu.main, menu);
return true;
}

@Override
public boolean onOptionsItemSelected(MenuItem item) {
// TODO Auto-generated method stub
return super.onOptionsItemSelected(item);
}

}

Broadcast receiver 
File name : AlarmRecvr.java


package com.techpalle.b15_alarm_asg2;

import android.app.AlarmManager;
import android.app.PendingIntent;
import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;
import android.view.ViewDebug.FlagToString;
import android.widget.Toast;

public class AlarmRecvr extends BroadcastReceiver {
//public static int i = 1;
@Override
public void onReceive(Context context, Intent intent) {
int i = intent.getExtras().getInt("val");
i = i*2;
Toast.makeText(context, "Got", 0).show();
Intent in = new Intent();
in.setAction("com.techpalle.action.ALARM_INDEF");
in.putExtra("val", i);
PendingIntent pi = PendingIntent.getBroadcast(
context, 0, in, PendingIntent.FLAG_UPDATE_CURRENT);
AlarmManager am = (AlarmManager) context.getSystemService(context.ALARM_SERVICE);
am.set(AlarmManager.RTC_WAKEUP,
System.currentTimeMillis()+(i*1000),
pi);
}
}

xml file for first activity 
File name : activity_main.xml
  xmlns:tools="http://schemas.android.com/tools" 
android:layout_width="match_parent"
android:layout_height="match_parent"
android:paddingBottom="@dimen/activity_vertical_margin"
android:paddingLeft="@dimen/activity_horizontal_margin"
android:paddingRight="@dimen/activity_horizontal_margin"
android:paddingTop="@dimen/activity_vertical_margin"
tools:context=".MainActivity" >
android:id="@+id/textView1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/hello_world" />

Manifest file
File name : AndroidManifest.xml

  
package="com.techpalle.b15_alarm_asg2"
android:versionCode="1"
android:versionName="1.0" >
android:minSdkVersion="8"
android:targetSdkVersion="17" />
android:allowBackup="true"
android:icon="@drawable/ic_launcher"
android:label="@string/app_name"
android:theme="@style/AppTheme" >
android:name="com.techpalle.b15_alarm_asg2.MainActivity"
android:label="@string/app_name" >













Download complete code : Click to download

Android interview questions on Power manager and wake locks:
What is sleep mode? What will happen to CPU when LCD is turned off?
What are the two components that runs in Sleep mode also?
Every day night at 12 o clock I need to post some images to Facebook, in that case I will set repeating alarm for every day night 12 am. But to upload images I want to start service, how should I do this ?
What is the difference between Intent, Sticky Intent, and Pending Intent?

Repeating alarms : Android tutorial

Program description:

This program will demo how to create repeating alarms, which will trigger broadcast receivers.


This program has one activity with one button, and a broadcast receiver.
On clicking the button we will set an alarm which will trigger after 5 seconds from now.
That alarm will keep repeating for every next 5 seconds. Every time it triggers it will send a broadcast receiver. Broadcast receiver will print "got" message for every 5 seconds.

Before using this program, you should know  how to create alarms with broadcast receiver.

First Activity


package com.techpalle.b15_alarm_asg1;

import java.util.List;

import android.os.Bundle;
import android.app.Activity;
import android.app.ActivityManager;
import android.app.AlarmManager;
import android.app.PendingIntent;
import android.app.ActivityManager.RunningTaskInfo;
import android.content.Context;
import android.content.Intent;
import android.view.Menu;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.Button;

public class MainActivity extends Activity {
AlarmManager am;
Button b;
ActivityManager acm;

@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
acm = (ActivityManager) getSystemService(Context.ACTIVITY_SERVICE);
List l = acm.getRunningTasks(10);

b = (Button) findViewById(R.id.button1);
am = (AlarmManager) getSystemService(Context.ALARM_SERVICE);
b.setOnClickListener(new OnClickListener() {
@Override
public void onClick(View v) {
Intent in = new Intent();
in.setAction("com.techpalle.action.ALARM_REPEAT");
PendingIntent pi = PendingIntent.getBroadcast(
getApplicationContext(),
0, in, 0);
am.setRepeating(AlarmManager.RTC_WAKEUP,
System.currentTimeMillis()+5000,
5000,
pi);
}
});
}

@Override
public boolean onCreateOptionsMenu(Menu menu) {
// Inflate the menu; this adds items to the action bar if it is present.
getMenuInflater().inflate(R.menu.main, menu);
return true;
}

}

Broadcast receiver 
File name : AlarmRecvr.java
package com.techpalle.b15_alarm_asg1;

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

public class AlarmRecvr extends BroadcastReceiver {

@Override
public void onReceive(Context context, Intent intent) {
// TODO Auto-generated method stub
Toast.makeText(context, "got", 0).show();
}

}

xml file for first activity 
File name : activity_main.xml

  xmlns:tools="http://schemas.android.com/tools" 
android:layout_width="match_parent"
android:layout_height="match_parent"
android:paddingBottom="@dimen/activity_vertical_margin"
android:paddingLeft="@dimen/activity_horizontal_margin"
android:paddingRight="@dimen/activity_horizontal_margin"
android:paddingTop="@dimen/activity_vertical_margin"
tools:context=".MainActivity" >
android:id="@+id/textView1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/hello_world" />

Manifest file
File name : AndroidManifest.xml
  
package="com.techpalle.b15_alarm_asg1"
android:versionCode="1"
android:versionName="1.0" >
android:minSdkVersion="8"
android:targetSdkVersion="17" />
android:allowBackup="true"
android:icon="@drawable/ic_launcher"
android:label="@string/app_name"
android:theme="@style/AppTheme" >
android:name="com.techpalle.b15_alarm_asg1.MainActivity"
android:label="@string/app_name">












hi

Download complete code : Click to download

Android interview questions on Power manager and wake locks:
What is sleep mode? What will happen to CPU when LCD is turned off?
What are the two components that runs in Sleep mode also?
Every day night at 12 o clock I need to post some images to Facebook, in that case I will set repeating alarm for every day night 12 am. But to upload images I want to start service, how should I do this ?
What is the difference between Intent, Sticky Intent, and Pending Intent?

Older Posts Home