web stats analysis

Archive for August 5th, 2013

Find records from one table which doesn’t exist in another in SQL.

Here I make a two tables.it’s following.

Information:

ID NAME ADDRESS
1 aaa Palanpur
2 bbb Deesa

Information_book

ID NAME ADDRESS
1 aaa Palanpur
2 bbb Deesa
3 ccc Ahmedabad
Now,you want to find out the record in information_book table
but this record doesn’t exist in the information table.

This time you fire following query…

This query is easily find the record and easy to understand.

Query:-
SELECT * FROM information_book WHERE
address NOT IN (SELECT address FROM information_book);

You want to find alternet record So,fire this query.

Query:-
SELECT * FROM information_book WHERE NOT EXISTS

(SELECT * FROM information WHERE information.address = information.address)

Your output is bellow.

Information_book

ID NAME ADDRESS
3 ccc Ahmedabad

Problem of double click event on this event(DataGridView.CellContentClick)

Problem of double click event on this event(DataGridView.CellContentClick) in ASP.NET.When this type of problem occure..Than you just create your event..Like this below..
private void dataGridView1_CellMouseUp(object sender, DataGridViewCellMouseEventArgs e)

{

//Write your code here.:

}

How to set text of TextView in android?

I had to solved the problem of How to set text of TextView..

The solution is below…

 

private TextView demoTextView;

private String demoString;

demoTextView = (TextView) findViewById(R.id.tv);

demoString = “hello friends ! wht’s up?”;

mTextView.setText(mString);

How to resume an App from a Notification?

Note:In this solution you have to set your flags… 

notification.flags = Notification.FLAG_ONGOING_EVENT | Notification.FLAG_NO_CLEAR;

notification.setFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP | Intent.FLAG_ACTIVITY_SINGLE_TOP);

How to handle multiple notification in android?

Many time we would send multiple notification to users in a short time,
and you can handle “more than one” unread notification at a time in your Android application.

Here I explian you the simple tips to handle multiple notifications in your Android application.

I solved this problem in Android version 3.0.

The demo code when generate notification :

NotificationManager demonotification = (NotificationManager)

context.getSystemService(Context.NOTIFICATION_SERVICE);

Notification notification = new Notification(icon, message, when);

String title = context.getString(R.string.app_name);//The notification title

Date now = new Date();

long uniqueId = now.getTime();

Note:-Fill the information whatever you pass in your notification to the intent.
Change the HomeActivity and class name what you wish to start when user click on the notificaiton..

Intent notificationIntent = new Intent(context, HomeActivity.class);

notificationIntent.putExtra(“IS_NOTIFICATION”, true);
notificationIntent.putExtra(“NOTIFICATION_MSG”, message);

Note:-if u dosen’t need to strat new activity must set Intent.

notificationIntent.setFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP |
Intent.FLAG_ACTIVITY_SINGLE_TOP);

Note:-if you want to represent your notification so you cought use unique string.
But remember that tha each and every notification have difference action name..

notificationIntent.setAction(“com.sample.myapp” + uniqueId);

PendingIntent intent =PendingIntent.getActivity(context, 0, notificationIntent, PendingIntent.FLAG_ONE_SHOT);
notification.setLatestEventInfo(context, title, message, intent);
notification.flags |= Notification.FLAG_AUTO_CANCEL;

Note:- How to Play default notification sound?
notification.defaults |= Notification.DEFAULT_SOUND;
notification.sound = Uri.parse(“android.resource://” + context.getPackageName() +
“your_sound_file_name.mp3″);
Note:- When vibrate is enabled.and you want a vibrate
notification.defaults |= Notification.DEFAULT_VIBRATE;
Note:-If you use the same uniqueId for each notification, the Notification Manager will assume that is same notification and would replace the previous notification. **/
notificationManager.notify((int) uniqueId, notification);
I hope you are easily understand this code and enjoy android development.
Thank you…