Friday, November 29, 2013
Wednesday, November 20, 2013
Useful Information
தேவை இல்லாத விசயங்களையும், ஜோக்குகளையும் பகிர்வோர் , உயிரை காக்கும் இது போன்ற விசயங்களையும் பகிருங்கள் நண்பர்களே...! தனியாக இருக்கும் போது மாரடைப்பு வந்தால் உங்களை நீங்களே எப்படி காப்பாற்றிக்கொள்வது ? துரதிஷ்ட வசமாக மாரடைப்பு ஏற்படும் போதெல்லாம் இறப்பவர்கள் அதிகமாக தனியாக இருந்திருப்பவராக உள்ளனர் உங்கள் இதயம் தாறுமாறாக துடிக்கிறது..நீங்கள் சுயநினைவை இழக்க வெறும் 10 நொடிகள் தான் உள்ளது. இப்போது நீங்கள் செய்ய வேண்டியது தொடர்ச்சியாக மிக ஆக்ரோஷமாக இரும்ப வேண்டும், ஒவ்வொரு முறை இரும்புவதர்க்கு முன்னரும் மூச்சை இழுத்து விட வேண்டும் , இருமல் மிக ஆழமானதாக இருக்க வேண்டும். இருதயம் இயல்பு நிலை திரும்பும் வரையிலோ அல்லது வேறொருவர் உதவிக்கு வரும் வரையிலோ ஒவ்வொரு இரண்டு நொடிக்கும் மூச்சை இழுத்து விட்டு இரும்முக்கொண்டே இருக்க வேண்டும். மூச்சை இழுத்து விடுவதினால் நுரை ஈரலுக்கு ஆச்சிஜன் சீராக செல்ல வழி வகுக்கிறது , இருமுவதால் இருதயம் நிற்பதில் இருந்து தொடர்ச்சியாக துடித்துக்கொண்டே இருக்க உதவும், இதனால் ரத்தஓட்டம் சீரடையும். இருமுவதால் ஏற்படும் அதிர்வினால் இதயம் சீராக துடிக்கும்..பின்னர் இருதயம் சீரடைந்ததும் அருகில் உள்ள மருத்துவமனைக்கு செல்லலாம்..இந்த தகவலை குறைந்தது உங்களின் பத்து நண்பர்களுக்காவது பகிருங்கள்.தேவை இல்லாத விசயங்களையும், ஜோக்குகளையும் பகிர்வோர் , உயிரை காக்கும் இது போன்ற விசயங்களையும் பகிருங்கள் நண்பர்களே...!
Tuesday, November 19, 2013
Useful Information
Thomas Suarez, like many 12 year olds, spends a lot of time at his computer. But Suarez isn't just playing games or chatting with friends. More often than not, he's developing iPhone apps. When he was 9, Suarez found himself downloading the iOS Developer ToolKit and simulation tool onto his computer, and teaching himself Python, Java and C. Within a few months he had created his first app, Earth Fortune, and convinced his parents, Ralph and Margaret, to shell out $99 to get his wares into Apple's App Store. He even started his own company, CarrotCorp. "After Earth Fortune launched, I had eventually saved enough money to buy an iPod Touch," Suarez told ABC News. And with that he was off and running. He has since designed other apps, including "Bustin Jieber," a game that lets users, well, whack Justin Bieber when he moves to a different location on the screen. CarrotCorp now sells four mobile applications for the iOS platform; two are free and the other two cost 99 cents each. "I've made a lot of money for a kid," says Suarez, now 12 and a sixth grader in Manhattan Beach, Calif. In November, he bought an iPhone with his earnings and also attended the Consumer Electronics Show in January. Since that time, Suarez started an app club at his school, helping other kids build and share their creations, and also gave a Ted-X Talk, which was seen by nearly 2 million viewers on You Tube. In his talk, Suarez said that kids needed to learn these kinds of skills and be given the technology and resources to do so, because they're the foundation for future jobs. He also talked about role reversal, in that the young must teach their elders about new technology. That talk caught the attention of Craig Hatkoff, the co-founder of the Tribeca Film Festival. "It touched a chord in virtually anybody who saw it," said Hatkoff, who began mentoring Suarez through email and Skype. "He talks about the idea that kids don't necessarily want to play games, they want to learn how to make games. The whole notion that kids will take ownership if you give them something interesting that they want to do. To me, that was a revelation." And Hatkoff had given Suarez even more tools to build. A couple of months ago, he bought Suarez one of his favorite gadgets in the world – a MakerBot 3D "desktop replicatior" (or a 3-D printer) that allows one to design and print objects. Within four weeks, Suarez had taught himself how to use it. On Friday, Suarez, along with folks like Twitter's co-founder Jack Dorsey, filmmaker Edward Burns, MakerBot founder, and -- ahem -- the real Justin Bieber were honored at Tribeca Disruptive Innovation Awards. At the event, Hatkoff gave Suarez a Disruptive Innovation award in the shape of a hammer, and Suarez gave Hatkoff his MakerBot creation. But that's not enough for the ambitious 12-year-old. There's more to build, he told us, as he preps to start developing his next iPhone game and learning how to develop for Android. "I started off thinking Thomas would become my protege," Hatkoff said, when he presented Suarez with this award. "I have now learned, I am his protege."
Fascinating Facts You Might Not Know About Phone Numbers
You may have heard some interesting and already common facts about mobile phones on occasion. But what about the phone numbers that give you that unique mobile identity and make using your phone possible. Here’s ten great facts that you may have never heard before:
Invention of Phone numbers
Before their invention, phone calls were made by dialing the phone service first and requesting a phone operator sitting on the other end with various lines used to connect us to the person we wanted to contact. This was all fine and dandy until the process was questioned by Alexander Bell’s (the inventor of the phone himself) friend Dr. Moses. Because the town was infected with an epidemic of measles, the doctor advised initiating a new system without involving these operators for if any one of them fell ill, the others would find it difficult to understand the system and keep it running. Hence, the system of names was replaced by numbers dialed directly by the callers themselves.
The very first Area code
The very first area code to be established was in New Jersey in 1951, which was labeled 201. The area codes in use now are an advanced and evolved version of the “North American Numbering” plan, in which th
e areas were numbered according to the ratio of their population. The one having the largest was given the simplest dial code for a rotary phone and it started with codes for 90 areas. Urban areas like New York, Los Angeles and Chicago got the codes 212, 213, and 312, respectively, and whereas more rural areas were given codes like 915, 913, etc.
The Most Expensive phone number
666-6666 holds the record for most expensive number after being sold in Qatar for $207 million to raise money for charity. This number blows away the previous record held by 888-8888 sold in China for $280,000.
Apple related to 888-8888
It is said that Apple co-founder, Steve Wozniak, had a thing for repetitive digits. It was because of his fondness for such numbers that he sold the Apple I for $666.66. This fondness, as legend has it, also led him to buy the second most expensive number in the world. The only drawback to the fantastic phone number was the hundreds of prank calls it received every day. While most of them were not of a malicious nature, there some particularly spiteful ones that may taken a toll on any man.
Emergency Numbers
Different countries have various emergency numbers, for example 911 is the standard emergency number used in U.S. It was first pronounced as “nine eleven”, however the confusion of many users who searched for the “11” key on the dialer, led to it being changed to “nine one one”. In U.K, the number is “nine nine nine”; whereas Europe, you would dial 112 in emergency.
Before the system of a single number for emergency calls was introduced, people used to call the operators to direct them to the relevant emergency service. There are still some fire services in the U.S which can also be reached by dialing “3 4 7 3”, which spells “F-I-R-E”.
A Generous Business Partner.
One day, a very wealthy man was walking on the road. Along the way, he saw a beggar on the sidewalk.
The rich man looks kindly on the beggar and asked, "How did you become a beggar?
The beggar said, "Sir, I've been applying for a job for a year now but haven't found any. You look like a rich man.
Sir, if you'll give me a job, I'll stop begging."
The rich man smiled and said, "I want to help you. But I won't give you a job. I'll do something better.
I want you to be my business partner. Let's start a business together.
The beggar blinked hard. He didn't understand what the older man was saying. "What do you mean, Sir?
"I own a rice plantation. You could sell my rice in the market. I'll provide you the sacks of rice.
I'll pay the rent for the market stall..
All you'll have to do is sell my rice. And at the end of the month, as Business Partners, we'll share in the profits.
Tears of joy rolled down his cheeks. "Oh Sir," he said, "you're a gift from Heaven. You're the answer to my prayers.
Thank you, thank you, thank you!" He then paused and said, Sir, how will we divide the profits?
Do I keep 10% and you get the 90%? Do I keep 5% and you get the 95%? I'll be happy with any arrangement.
The rich man shook his head and chuckled. "No, I want you to give me the 10%. And you keep the 90%.
For a moment, the beggar couldn't speak. When he tried to speak, it was gibberish. Uh, gee, uh, wow, I mean, huh?
He couldn't believe his ears. The deal was too preposterous.
The rich man laughed more loudly. He explained, I don't need the money, my friend.
I'm already wealthy beyond what you can ever imagine.
I want you to give me 10% of your profits so you grow in gratitude
The beggar knelt down before his benefactor and said, Yes Sir, I will do as you say.
Even now, I'm so grateful for what you've done for me!
And so that was what happened. He forgets where the blessings came from.
Each day, the beggar now dressed a little bit better operated a store selling rice in the market. He worked very hard.
He woke up early in the morning and slept late at night. And sales were brisk, also because the rice was of good quality.
And after 30 days, the profits were astounding.
At the end of the month, as the ex-beggar was counting the money, and liking very much the feeling of money in his hands, an idea grew in his mind.
He told himself, Gee, why should I give 10% to my Business Partner? I didn't see him the whole month!
I was the one who was working day and night for this business. I did all this work! I deserve the 100% profits!
A few minutes later, the rich man was knocking on the door to collect his 10% of the profits.
The ex-beggar opened the door and said, "You don't deserve the 10%. I worked hard for this.
I deserve all of it!" And he slammed the door.
If you were his Business Partner, how would you feel?
Friend, this is exactly what happens to us
God is Our Business Partner.
God gave us life-every single moment, every single breath, every single second. God gave us talents-ability to talk, to create, to earn money God gave us a body-eyes, ears, mouth, hands, feet, heart. God gave us mind- imagination, emotions, reasoning, language. So do we need to give back Our Business Partner something in return?
Saturday, November 16, 2013
Useful Information
When two people are in love, their heartbeats and breathing become synchronised when they're together.
Thursday, November 14, 2013
Java - Inheritance
Inheritance can be defined as the process where one object acquires the properties of another. With the use of inheritance the information is made manageable in a hierarchical order.
When we talk about inheritance, the most commonly used keyword would be extends and implements. These words would determine whether one object IS-A type of another. By using these keywords we can make one object acquire the properties of another object.
IS-A Relationship:
IS-A is a way of saying : This object is a type of that object. Let us see how the extends keyword is used to achieve inheritance.
public class Animal{ } public class Mammal extends Animal{ } public class Reptile extends Animal{ } public class Dog extends Mammal{ }
Now, based on the above example, In Object Oriented terms, the following are true:
- Animal is the superclass of Mammal class.
- Animal is the superclass of Reptile class.
- Mammal and Reptile are subclasses of Animal class.
- Dog is the subclass of both Mammal and Animal classes.
Now, if we consider the IS-A relationship, we can say:
- Mammal IS-A Animal
- Reptile IS-A Animal
- Dog IS-A Mammal
- Hence : Dog IS-A Animal as well
With use of the extends keyword the subclasses will be able to inherit all the properties of the superclass except for the private properties of the superclass.
We can assure that Mammal is actually an Animal with the use of the instance operator.
Example:
public class Dog extends Mammal{ public static void main(String args[]){ Animal a = new Animal(); Mammal m = new Mammal(); Dog d = new Dog(); System.out.println(m instanceof Animal); System.out.println(d instanceof Mammal); System.out.println(d instanceof Animal); } }
This would produce the following result:
true true true
Since we have a good understanding of the extends keyword let us look into how the implements keyword is used to get the IS-A relationship.
The implements keyword is used by classes by inherit from interfaces. Interfaces can never be extended by the classes.
Example:
public interface Animal {} public class Mammal implements Animal{ } public class Dog extends Mammal{ }
The instanceof Keyword:
Let us use the instanceof operator to check determine whether Mammal is actually an Animal, and dog is actually an Animal
interface Animal{} class Mammal implements Animal{} public class Dog extends Mammal{ public static void main(String args[]){ Mammal m = new Mammal(); Dog d = new Dog(); System.out.println(m instanceof Animal); System.out.println(d instanceof Mammal); System.out.println(d instanceof Animal); } }
This would produce the following result:
true true true
HAS-A relationship:
These relationships are mainly based on the usage. This determines whether a certain class HAS-A certain thing. This relationship helps to reduce duplication of code as well as bugs.
Lets us look into an example:
public class Vehicle{} public class Speed{} public class Van extends Vehicle{ private Speed sp; }
This shows that class Van HAS-A Speed. By having a separate class for Speed, we do not have to put the entire code that belongs to speed inside the Van class., which makes it possible to reuse the Speed class in multiple applications.
In Object-Oriented feature, the users do not need to bother about which object is doing the real work. To achieve this, the Van class hides the implementation details from the users of the Van class. So basically what happens is the users would ask the Van class to do a certain action and the Van class will either do the work by itself or ask another class to perform the action.
A very important fact to remember is that Java only supports only single inheritance. This means that a class cannot extend more than one class. Therefore following is illegal:
public class extends Animal, Mammal{}
However, a class can implement one or more interfaces. This has made Java get rid of the impossibility of multiple inheritance.
Monday, November 11, 2013
Useful Information
Namma natpu oru vengayam madhiri yean?
Cut panni paaru, kannu kalangum!!
Mudiyala la, ennalayum than. Dont feel.!! Forward it to other vengayams.!
Cut panni paaru, kannu kalangum!!
Mudiyala la, ennalayum than. Dont feel.!! Forward it to other vengayams.!
Useful Information
Excuse me, could you pls show me
this address,
sara gates,
d/o bill gates.
Newyork,
usa.
She said come to my home to take me to your home nu. Which bus will go
this address,
sara gates,
d/o bill gates.
Newyork,
usa.
She said come to my home to take me to your home nu. Which bus will go
Useful Information
joke...
Aval enaku illai endru, uruthiyaga Therindha piragum, Uyirodu irukiren.!
Avalukaga alla, Avalodaya thangachikaga..!
Thrisha illana divya.
Aval enaku illai endru, uruthiyaga Therindha piragum, Uyirodu irukiren.!
Avalukaga alla, Avalodaya thangachikaga..!
Thrisha illana divya.
Useful Information
Don't stand too much in front of MIRROR.
Even d mirror vl fal in lov wit u,
Cuz ur so cute
& lovly .
For more JOKES recharge r pay Rs.50/month to my number. :)
Even d mirror vl fal in lov wit u,
Cuz ur so cute
& lovly .
For more JOKES recharge r pay Rs.50/month to my number. :)
Useful Information
Reply must..
Yelarkumay yelarkitayum oru vishayam pidikum antha mari ungaluku enkita yena pidikum?
fwd to ur frnds and get cute replies..... Reply me too:)
Yelarkumay yelarkitayum oru vishayam pidikum antha mari ungaluku enkita yena pidikum?
fwd to ur frnds and get cute replies..... Reply me too:)
Useful Information
WIFE: Ungala parthukitey irukanum pola irukkunga..
HUSBAND: Appave josiyar sonnaru kalyanathuku appuram "Sani Parvai" unga melaye irukumnu...
HUSBAND: Appave josiyar sonnaru kalyanathuku appuram "Sani Parvai" unga melaye irukumnu...
Useful Information
Marriage time la ayyar casual'a solradhu evalo poruthama iruku..
Ayyar: ponna koopidungo, nalla neram mudia pogudhu! (mapillaiku)...!
Ayyar: ponna koopidungo, nalla neram mudia pogudhu! (mapillaiku)...!
Sunday, November 10, 2013
Useful Information
Police arrested a drunkard at midnight on the streets and asked: Where are you going? Man: I’m going to listen to a lecture on the ill effects of drinking.
Cop: Who’ll lecture at midnight?
Man: My wife…
——————————————————————————————– Law Professor: Which is the most important LAW of Finance for Starting a New Business?
Student: Father-in-Law!
——————————————————————————————– What’s the biggest pressure for Pak captain when Pak needs 1 run to win in 8 ovrs, with 5 wickets in hand?
Ya Allah! How to speak English in presentation ceremony?
——————————————————————————————– What’s the difference between Complete and Finished?
If you find a good wife, you are complete, otherwise you are finished.
——————————————————————————————– So many options: Poison, sleeping pills, hanging, jumping from a building, lying on train tracks, but we choose Marriage, slow and sure!
——————————————————————————————– Have you heard about the man who threw his wife into a pond of crocodiles? He’s now being harassed by the animal rights for being cruel to the crocodiles.
——————————————————————————————– Two men are talking. 1st: I got married because I was tired of eating out, cleaning the house, doing the laundry and wearing shabby clothes.
2nd: Amazing, I just got divorced for the very same reasons
——————————————————————————————– Wife: If I dismiss the cook and make the food myself for a month, what will you pay me?
Husband: I won’t have to pay you, you’ll get my entire insurance amount.
Cop: Who’ll lecture at midnight?
Man: My wife…
——————————————————————————————– Law Professor: Which is the most important LAW of Finance for Starting a New Business?
Student: Father-in-Law!
——————————————————————————————– What’s the biggest pressure for Pak captain when Pak needs 1 run to win in 8 ovrs, with 5 wickets in hand?
Ya Allah! How to speak English in presentation ceremony?
——————————————————————————————– What’s the difference between Complete and Finished?
If you find a good wife, you are complete, otherwise you are finished.
——————————————————————————————– So many options: Poison, sleeping pills, hanging, jumping from a building, lying on train tracks, but we choose Marriage, slow and sure!
——————————————————————————————– Have you heard about the man who threw his wife into a pond of crocodiles? He’s now being harassed by the animal rights for being cruel to the crocodiles.
——————————————————————————————– Two men are talking. 1st: I got married because I was tired of eating out, cleaning the house, doing the laundry and wearing shabby clothes.
2nd: Amazing, I just got divorced for the very same reasons
——————————————————————————————– Wife: If I dismiss the cook and make the food myself for a month, what will you pay me?
Husband: I won’t have to pay you, you’ll get my entire insurance amount.
Thursday, November 7, 2013
Useful Information
Visit to the Barber A man and a little boy entered a barbershop together. After the man received the full treatment - shave, shampoo, manicure, haircut, etc. - he placed the boy in the chair. "I'm goin' to buy a green tie to wear for the parade," he said. "I'll be back in a few minutes." When the boy's haircut was completed and the man still hadn't returned, the barber said, "Looks like your daddy's forgotten all about you." "That wasn't my daddy," said the boy. "He just walked up, took me by the hand and said, 'Come on, son, we're gonna get a free haircut!'"
oDesk Alternatives
1) Elance:
According to me, this is the best oDesk alternative. Elance is appropriate for the employers who are interested to get their project works done whether on hourly basis or on completed project basis. It is a virtual marketplace some employers count on to get instant access to expert professionals to outsource any job online.
Withdrawal of money: Elance made the payment available to the freelancers’ Elance accounts after deducting the one time account activation fee ($10) and percentage of project budget (ranges from 6.75% to 8.75% based on the project) from the payment.
Withdrawal options:
Outside of U.S.:
- Paypal
- Moneybooker
- Payoneer
- Wire transfer
2) GetACoder:
An oDesk alternative is GetACoder which aims to provide the employers with proficient services at low labor cost. You can work on the
basis of fixed price project or on hourly payment. You can withdraw money from your GetACoder account only if the account balance is equal or greater than $100. Bangladeshifreelancers can have a go at this website as they offer withdrawals using debit cards, MoneyBookers and direct wire transfer.
basis of fixed price project or on hourly payment. You can withdraw money from your GetACoder account only if the account balance is equal or greater than $100. Bangladeshifreelancers can have a go at this website as they offer withdrawals using debit cards, MoneyBookers and direct wire transfer.
They offer the following withdrawal options:
- GetACoder Debit Card
- PayPal
- MoneyBookers
- Pecunix
- Wire Transfer
3) Guru.com:
Many contractors and employers count Guru.com as a website like oDesk. Though there are differences in many operational facts, the basic function is same: to be a marketplace for thefreelancers and job providers. Guru.com opts to support businesses those are locally based as well as attracting international businesses. If you want to withdraw money from Guru.com you can do so using SafePay if your balance is atleast $200 or you can use direct deposit or paypal if the balance is less than that.
They offer the following withdrawal options:
- Check
- Prepaid MasterCard
- PayPal
- Direct Deposit(US bank accounts only)
- Wire Transfer(Non-U.S. bank accounts only)
4) Vworker:
Vworker, previously named as Rent-a-coder, is another oDesk alternative. Here, employers pay the contractors on the basis of “pay-for-deliverables” (project based work, most protected option), or “pay-for-time” (hourly job, cheapest and flexible option). In both types of works, Vworker uses AccuTime Card system which takes screenshots of the workers screens and webcams (if available).
Vworker has a lot of options that you can use to withdraw money. Contractor can choose the credit cutoff date and the minimum payout amount, according to which his or her payment is credited into his or her account and made available to withdraw.
Withdrawal options:
- Payoneer: pre-paid debit/credit card option
- Payoneer: ACH option
- Payoneer: direct bank transfer option
- Snail Mail Check
- Western Union
- International Priority Mail
- Bank to Bank Wire Transfer
- PayPal
5) Scriptlance:
For website programming, design and writing jobs, Scriptlance is an alternative to oDesk. Because this site is cheaper than other sites, freelancers of lower rates work here. Workers from India, Bangladesh, and Philippines are examples.
Scriptlance charges the programmers $5 or 5% fee (whichever is greater) for winning any project. And withdrawal charge is applied according to the withdrawal options chosen by thefreelancers.
Withdrawal options:
- PayPal
- Moneybookers
- Payoneer debit card
- Bank Wire Transfer
- Check (including FedEx delivery)
6) iFreelance:
iFreelance is the website offering the opportunity to meet together for workers and the job providers on the basis of three membership levels (Basic, Silver, Gold) rather than commissions, unlike some other similar sites like oDesk. I would not recommend this website to those who are just starting the freelance business, as registering on this website is not free. But if you are an experienced freelancer with lots of skills, you can go for it!
As iFreelance takes no commission on any project work, they charge only the membership fee for each active freelance profile. And payment from the employers can be made in any method or currency, if both freelancer and the employer are agreed upon that method or currency.
Withdrawal options:
- PayPal
- Check/Money Order
- Provider’s payment system
7) Peopleperhour:
Peopleperhour is a site quite similar to oDesk, except the payment method and some other terms. Like iFreelance, there are three types of accounts (Gold Subscription account, Standard account, Platinum Subscription account) for the freelancers; any one of which is must to be used by them. Though creating any profile is free here, but Gold and Platinum subscription accounts are charged by Peopleperhour to be set up.
Peopleperhour charge service fees on success of the freelancers’ profiles as well as on the profiles’ usage plan.
Withdrawal options:
- Within the UK: PayPal and Bank Transfer
- Non-UK: Bank Transfer
Which oDesk alternative or which site like oDesk do you use? Please let us know if you think that we have missed any important websites which are similar to odesk.
Overview of New Features in Android 4.4 KitKat
Now that Android 4.4 KitKat has been officially announced, you may be wondering what new features are in store. The best resource for catching up on new features is obviously Android's Developers site, which has assembled a complete overview of the new OS, highlighting key features such as:
- Optimization for a broader range of devices
- Support for NFC-based transactions through Host Card Emulation
- Support for printing
- Sensor batching to increase efficiency
And a lot more. The stand-out theme of the new features seems to be accessibility by older devices;Android fragmentation may soon be a thing of the past.
If you're not in a reading mood, though, you can lean back and get an overview of Android 4.4 (this one focusing on new tools for memory optimization) from the folks at DevBytes
Sending SMS in Android
There are following two ways to send SMS using Android device:
- Using SmsManager to send SMS
- Using Built-in Intent to send SMS
Using SmsManager to send SMS
The SmsManager manages SMS operations such as sending data to the given mobile device. You can create this object by calling the static method SmsManager.getDefault() as follows:
SmsManager smsManager = SmsManager.getDefault();
Once you have SmsManager object, you can use sendDataMessage() method to send SMS at the specified mobile number as below:
smsManager.sendTextMessage("phoneNo", null, "SMS text", null, null);
Apart from the above method, there are few other important functions available in SmsManager class. These methods are listed below:
S.N. | Method & Description |
---|---|
1 | ArrayList This method divides a message text into several fragments, none bigger than the maximum SMS message size. |
2 | static SmsManager getDefault() This method is used to get the default instance of the SmsManager |
3 | void sendDataMessage(String destinationAddress, String scAddress, short destinationPort, byte[] data, PendingIntent sentIntent, PendingIntent deliveryIntent) This method is used to send a data based SMS to a specific application port. |
4 | void sendMultipartTextMessage(String destinationAddress, String scAddress, ArrayList Send a multi-part text based SMS. |
5 | void sendTextMessage(String destinationAddress, String scAddress, String text, PendingIntent sentIntent, PendingIntent deliveryIntent) Send a text based SMS. |
Example
Following example shows you in practical how to use SmsManager object to send an SMS to the given mobile number.
To experiment with this example, you will need actual Mobile device equipped with latest Android OS, otherwise you will have to struggle with emulator which may not work.
Step | Description |
---|---|
1 | You will use Eclipse IDE to create an Android application and name it as SendSMSDemounder a package com.example.sendsmsdemo. While creating this project, make sure youTarget SDK and Compile With at the latest version of Android SDK to use higher levels of APIs. |
2 | Modify src/MainActivity.java file and add required code to take care of sending email. |
3 | Modify layout XML file res/layout/activity_main.xml add any GUI component if required. I'm adding a simple GUI to take mobile number and SMS text to be sent and a simple button to send SMS. |
4 | Modify res/values/strings.xml to define required constant values |
5 | Modify AndroidManifest.xml as shown below |
6 | Run the application to launch Android emulator and verify the result of the changes done in the aplication. |
Following is the content of the modified main activity filesrc/com.example.sendsmsdemo/MainActivity.java.
package com.example.sendsmsdemo; import android.os.Bundle; import android.app.Activity; import android.telephony.SmsManager; import android.util.Log; import android.view.Menu; import android.view.View; import android.widget.Button; import android.widget.EditText; import android.widget.Toast; public class MainActivity extends Activity { Button sendBtn; EditText txtphoneNo; EditText txtMessage; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); sendBtn = (Button) findViewById(R.id.btnSendSMS); txtphoneNo = (EditText) findViewById(R.id.editTextPhoneNo); txtMessage = (EditText) findViewById(R.id.editTextSMS); sendBtn.setOnClickListener(new View.OnClickListener() { public void onClick(View view) { sendSMSMessage(); } }); } protected void sendSMSMessage() { Log.i("Send SMS", ""); String phoneNo = txtphoneNo.getText().toString(); String message = txtMessage.getText().toString(); try { SmsManager smsManager = SmsManager.getDefault(); smsManager.sendTextMessage(phoneNo, null, message, null, null); Toast.makeText(getApplicationContext(), "SMS sent.", Toast.LENGTH_LONG).show(); } catch (Exception e) { Toast.makeText(getApplicationContext(), "SMS faild, please try again.", Toast.LENGTH_LONG).show(); e.printStackTrace(); } } @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; } }
Following will be the content of res/layout/activity_main.xml file:
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:orientation="vertical" >
android:id="@+id/textViewPhoneNo"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/phone_label" />
android:id="@+id/editTextPhoneNo"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:inputType="phone"/>
android:id="@+id/textViewMessage"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/sms_label" />
android:id="@+id/editTextSMS"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:inputType="textMultiLine"/>
Following will be the content of res/values/strings.xml to define two new constants:
xml version="1.0" encoding="utf-8"?>
name="app_name">SendSMSDemo
name="action_settings">Settings
name="hello_world">Hello world!
name="phone_label">Enter Phone Number:
name="sms_label">Enter SMS Message:
name="send_sms_label">Send SMS
Following is the default content of AndroidManifest.xml:
xml version="1.0" encoding="utf-8"?>
xmlns:android="http://schemas.android.com/apk/res/android"
package="com.example.sendsmsdemo"
android:versionCode="1"
android:versionName="1.0" >
android:minSdkVersion="8"
android:targetSdkVersion="17" />
android:name="android.permission.SEND_SMS" />
android:allowBackup="true"
android:icon="@drawable/ic_launcher"
android:label="@string/app_name"
android:theme="@style/AppTheme" >
android:name="com.example.sendsmsdemo.MainActivity"
android:label="@string/app_name" >
android:name="android.intent.action.MAIN" />
android:name="android.intent.category.LAUNCHER" />
Let's try to run your SendSMSDemo application. I assume you have connected your actual Android Mobile device with your computer. To run the app from Eclipse, open one of your project's activity files and click Run icon from the toolbar. Before starting your application, Eclipse will display following window to select an option where you want to run your Android application.
Select your mobile device as an option and then check your mobile device which will display following screen:
Now you can enter a desired mobile number and a text message to be sent on that number. Finally click on Send SMS button to send your SMS. Make sure your GSM connection is working fine to deliver your SMS to its recipient.
You can take a number of SMS separated by comma and then inside your program you will have to parse them into an array string and finally you can use a loop to send message to all the given numbers. That's how you can write your own SMS client. Next section will show you how to use existing SMS client to send SMS.
Using Built-in Intent to send SMS
You can use Android Intent to send SMS by calling built-in SMS functionality of the Android. Following section explains different parts of our Intent object required to send an SMS.
Intent Object - Action to send SMS
You will use ACTION_VIEW action to launch an SMS client installed on your Android device. Following is simple syntax to create an intent with ACTION_VIEW action
Intent smsIntent = new Intent(Intent.ACTION_VIEW);
Intent Object - Data/Type to send SMS
To send an SMS you need to specify smsto: as URI using setData() method and data type will be tovnd.android-dir/mms-sms using setType() method as follows:
smsIntent.setData(Uri.parse("smsto:")); smsIntent.setType("vnd.android-dir/mms-sms");
Intent Object - Extra to send SMS
Android has built-in support to add phone number and text message to send an SMS as follows:
smsIntent.putExtra("address" , new String("0123456789;3393993300")); smsIntent.putExtra("sms_body" , "Test SMS to Angilla");
Here address and sms_body are case sensitive and should be specified in small characters only. You can specify more than one number in single string but separated by semi-colon (;).
Example
Following example shows you in practical how to use Intent object to launch SMS client to send an SMS to the given recipients.
To experiment with this example, you will need actual Mobile device equipped with latest Android OS, otherwise you will have to struggle with emulator which may not work.
Step | Description |
---|---|
1 | You will use Eclipse IDE to create an Android application and name it as SendSMSDemounder a package com.example.sendsmsdemo. While creating this project, make sure youTarget SDK and Compile With at the latest version of Android SDK to use higher levels of APIs. |
2 | Modify src/MainActivity.java file and add required code to take care of sending SMS. |
3 | Modify layout XML file res/layout/activity_main.xml add any GUI component if required. I'm adding a simple button to launch SMS Client. |
4 | Modify res/values/strings.xml to define required constant values |
5 | Modify AndroidManifest.xml as shown below |
6 | Run the application to launch Android emulator and verify the result of the changes done in the aplication. |
Following is the content of the modified main activity filesrc/com.example.sendsmsdemo/MainActivity.java.
package com.example.sendsmsdemo; import android.net.Uri; import android.os.Bundle; import android.app.Activity; import android.content.Intent; import android.util.Log; import android.view.Menu; import android.view.View; import android.widget.Button; import android.widget.Toast; public class MainActivity extends Activity { @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); Button startBtn = (Button) findViewById(R.id.sendSMS); startBtn.setOnClickListener(new View.OnClickListener() { public void onClick(View view) { sendSMS(); } }); } protected void sendSMS() { Log.i("Send SMS", ""); Intent smsIntent = new Intent(Intent.ACTION_VIEW); smsIntent.setData(Uri.parse("smsto:")); smsIntent.setType("vnd.android-dir/mms-sms"); smsIntent.putExtra("address" , new String ("0123456789")); smsIntent.putExtra("sms_body" , "Test SMS to Angilla"); try { startActivity(smsIntent); finish(); Log.i("Finished sending SMS...", ""); } catch (android.content.ActivityNotFoundException ex) { Toast.makeText(MainActivity.this, "SMS faild, please try again later.", Toast.LENGTH_SHORT).show(); } } @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; } }
Following will be the content of res/layout/activity_main.xml file:
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:orientation="vertical" >
Following will be the content of res/values/strings.xml to define two new constants:
xml version="1.0" encoding="utf-8"?>
name="app_name">SendSMSDemo
name="hello_world">Hello world!
name="action_settings">Settings
name="compose_sms">Compose SMS
Following is the default content of AndroidManifest.xml:
xml version="1.0" encoding="utf-8"?>
xmlns:android="http://schemas.android.com/apk/res/android"
package="com.example.sendsmsdemo"
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.example.sendsmsdemo.MainActivity"
android:label="@string/app_name" >
android:name="android.intent.action.MAIN" />
android:name="android.intent.category.LAUNCHER" />
Let's try to run your SendSMSDemo application. I assume you have connected your actual Android Mobile device with your computer. To run the app from Eclipse, open one of your project's activity files and click Run icon from the toolbar. Before starting your application, Eclipse will display following window to select an option where you want to run your Android application.
Select your mobile device as an option and then check your mobile device which will display following screen:
Now use Compose SMS button to launch Android built-in SMS clients which is shown below:
You can modify either of the given default fields and finally use send SMS button (marked with red rectangle) to send your SMS to the mentioned recipient.
Subscribe to:
Posts (Atom)