how can we get E-mail receiving notification in android
same with me also
can we get info by registering a content observer like this
ContentResolver contentResolver = getContentResolver();
m_EmailObserver = new EmailObserver(this);
contentResolver.registerContentObserver(ContactsContract.CommonDataKinds.Email.CONTENT_URI, true, m_EmailObserver);
in email observer we can read email recieved
is it not correct way to get email notifiactions
There is no such thing as "E-mail receiving notification in android", any more than there is "E-mail receiving notification" in Windows. Email is received by applications, not by the operating system. Individual email applications may or may not send out broadcast Intents advertising the receipt of email -- you would have to contact the developers of those applications to find out.
Related
In my Xamarin.Android app I send SMS using the following code :
send.Click += (s, e) =>
{
SmsManager.Default.SendTextMessage(number.Text, null, message.Text, null, null);
}
And in another button, I want to check which messages are delivered and which are not, to send undelivered message again.
How can I :
Find messages? Is there an ID (a unique one for each sms) or I should find messages by Number and Text?
Check the status of each message?
Please try the parameters sentIntent and deliveryIntent. Both are PendingIntents that will be broadcasted upon successful sending and delivery to the recipient. Upon building your intent you can add some id from your app that helps you identify which sms was sent/not sent.
To see how to query the SMSProvider, take a look at
this StackOverflow anwer.
The answer above uses Telephony.Sms.Inbox. I suggest trying to access Telephony.Sms.Conversations, which according to the doc contains all sent text-based SMS messages. As the class extends android.provider.Telephony.TextBasedSmsColumns, you should be able to query several error codes and status.
Have working code that 1) opens an email client on an android device and 2) successfully populates all the fields needed to send a message. This includes the to, from, subject and message body.
e String mailMsg = "mailto:elmer#gmail.com" +
"?cc="+"" + //needed to fill out email properly
"&subject=" + Uri.encode(subject) +
"&body=" + Uri.encode(emailBody);
Intent emailIntent = new Intent(Intent.ACTION_SENDTO);
emailIntent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
emailIntent.setData(Uri.parse(mailMsg));
try{
context.startActivity(emailIntent);
}catch (ActivityNotFoundException ae){
Log.d("TEST100 ","Error sending email");
}
Again the code works fine in terms of opening the email client, creating an populating the email message but, it does not send the email. Could it be because I have multiple email providers? The code always manages to connect to and work with my mai based provider.
Have read the google documentation and most relevant posts in stackoverflow, is it possible to:
1. trigger the sending of the email message without user involvement?
2. mask the display/process of creating the email?
Any information appreciated
is it possible to: trigger the sending of the email message without user involvement?
Fortunately, no.
mask the display/process of creating the email?
Fortunately, no.
Malware authors, spammers, and the like would love to have the ability to send an email, without user involvement, using the user's own email account. Most users would find this behavior to be inappropriate.
If you want to send an email without user involvement, have your Web service send the email on your behalf, using your own email account and your own mail server.
I'm just wondering is it possible to send a Message from the app without using actionView or actionSend ( meaning no asking for chooser to send via google or hotmail etc.. ) from the Intent ?
what I want to make is like a TextView and a Button
the user will enter a text in the textview and then click the Button to send the message, then the message will be automiatlly sent to the developer ( me )
I hope what I'm thinking of is possible.
I'm not sure what kind of message you are trying to send, but you can use the SMS feature of the phone to send not only a SMS, but an email, too.
SmsManager sms = SmsManager.getDefault();
sms.sendTextMessage("1"+yourPhoneNumber, userPhoneNumber, message, null, null);
You can replace phone numbers with emails and it will work without user interaction (unlike sending an email through an email client which cannot be done automatically). You can try it out by texting your own email. For your specific situation, you could set up a developer email that handles all of these messages that you are trying to send. The only issue with this is that you may not know who you are receiving messages from. For example, if you send a SMS -> email, it might show up as from something#vz.com or something. However, you can mitigate this by including addition info in the message payload itself.
Yes, it is possible. You can use the internet connection to have the message saved to some cloud storage or something. Personally, I prefer using Parse.com because they have an amazing API that saves you a lot of hassle.
Just add the message from the EditText to a ParseObject and call the saveEventually() method. As soon as the internet is back on, the message will be sent to your cloud storage.
Is there a way to programmatically send sms messages without them showing in the Messaging app?
I am using the following code to send SMS:
SmsManager sms = SmsManager.getDefault();
sms.sendTextMessage("number", null, "message", null, null);
And the messages are showing in the default Messaging app aswell as Google Hangouts. For my application it would be ideal for the messages not to show up, as they are simply sending code to a GSM module, and they just fill up the users Messaging app.
If you aren't sending real texts, you should probably send a port based SMS which won't be added to the messaging DB. But if you can't, you need to delete it from the sms content resolver.
ctx.getContentResolver().delete(Uri.parse("content://sms/inbox"), {"body"}, messageBodyToDelete);
I am new to android. I configured the email address in the android emulator.I want to get the email content,if the configured email receives the mail from other mailid.which notification shall i use and how to get the email content when the notification raises the alert. how can i achieve this.
Thanks in advance.....
It sounds to me like you're trying to say that you signed-in to the mail app on the Android device. From my understanding of the question you've raise, signing-in to an email account on the Android device doesn't mean any application can just grab emails from it. The closest solution I can think of is creating an IMAP connection to a mail server to grab mail content.