I am trying to develop an app, where one of the requirement is to send email or SMS to the contact which the user picks. When the user needs to send message, they can pick the contact from the contact list. If the user selects the "phone number" of the contact, I need to start SMS application and insert my message contact. If the user selects the contact email address from the contact list, I need to open the EMail application with my content in Subject and body.
How do the application know about the user input??
I am not an expert on this topic but it is interesting to me so I have done some reading about it.
You have the action of selecting a phone number or email address right? So if the user selects a phone number you can use SmsManager for that (here is an article about it http://mobiforge.com/developing/story/sms-messaging-android ). And a related Stack Overflow article discusses sending emails on the Android platform and one user gives a very nice Java example of doing this. Here is the article: Sending Email in Android using JavaMail API without using the default/built-in app
I hope these might be of some help!
Related
so I have an edit text that will be used as a view to get phone number from user, say if the phone number is +6123456789 , I want to check if this number has whatsapp number or not,i want to avoid the user to input fake whatsapp number, how to do that ?
Update (Nov 2022):
Whatsapp are repurposing the contacts node starting in v2.43 to no longer provide status information about a phone number. Regardless of whether a user has WhatsApp, it will always return valid for status in the response. For more information see official docs
original answer:
You must have: Facebook Whatsapp Business Api for contacts check
Once you have a valid business account you could then query the Contact. You will get all the details in the documentation.
Hope it works for you!
You can try this service https://watverifyapi.live
It allows you to verify multiple whatsapp number at a time.
I'm working on an security application in which my application will send a mail to the server automatically without the phone user disturbance. What I need is
Colletct user phone number and imei number
Send a email with the information, but user don't know about the process.
When a user insert a new sim again a new email will be send with the above mentioned process
What I done till is :
Colletct user phone number and imei number using telephony manager
Save the information locally
But I need an instruction or tutorial for doing rest of my work. Can anyone help?
You can do this in Version below M but above M you need to ask permission from the user so i suggest you to make a database and send data to server using background async task.
Here is tutorial to send email without intent http://www.oodlestechnologies.com/blogs/Send-Mail-in-Android-without-Using-Intent
I need "Contact Us" functionality which is generally used in website.How to send emails to mail id's provided by user. I know that using Intent we can send email. Using intent we can open default mail app in phone and able to send mail, But how to send mail without opening mail app.
You could do it server-side: You make an HTTP-POST Request with all the data which you want to send in it.
Use WebView.
your "mailto:" tag will not be picked by any app as they will not have access to your webview.
I think the user needs to open the mail app, as you can't assure from which email he wants to send you a contact message. If the user has an already configured account or not, is something you may not know. Maybe he just wants to send you info without using his email.
If you still want to create a contact us going through email, I'd go for this solution.
Otherwise, something like what #niklas said would be ok, but maybe encrypting the content, and probably not sending it as an email, but storing it into a database (so they can just fill the database with trash, instead of exploiting your service to send spam)
Use JavaMail API ... See this below link.
Sending emails without user intervention
I have developed an android application which now I want to extend so as it can send text messages.
Most probably I will be able to find documentation on how to send a text message, but what I am looking for is something I don't know how to do a research on it.
There are two types of text messages you can receive.
One type is from a contact you already know, hence you will see the contact name.
Second type is from a contact you don't know. And, depending on the contact, you will either see a mobile number or a name (eg Google).
My goal is to extend my android application to send a text message in a way that the recipient will see a name as sender (eg Google) and not a mobile number.
I cannot extend my application to use 3G to communicate with a server and send the sms through the server nor I can use an online service which is going to send the sms.
I have to either send the text message from the android application directly or send an sms to an sms service to forward the text message to the recipient.
Is this possible to do?
How to get the Gmail contacts data includes like first Name,Last-name B Day Email address Phone Number and the User Photo.How to send Email to a gmail contact from the android Phone.Using the Face Book SDK we can able to get the user contacts details but the Gmail is not come up with a SDK how to get these details.
The class you're looking for is the ContactsContract. The documentation is here.
Nested within ContactContract is a table of common data types, for instance, the contact photo:
java.lang.Object
↳ android.provider.ContactsContract.CommonDataKinds.Photo
Once you have the contact information you need, this question covers using an intent to send an email.