I'm making a widget who, among other things, displays the quantity of unread emails the user has in a given inbox.
Specifically, I'm asking how to:
-Obtain the list of email accounts on the device
-Make a call to one of the accounts such as
int newMailCount = accountInstance.getMailCount()
Any ideas?
Thanks
Obtain the list of email accounts on the device
This is not possible. You can use AccountManager to try to get at account information, but there is no "email" type that I am aware of, and email programs do not have to use AccountManager.
Make a call to one of the accounts
There is nothing in the Android SDK for email. There are dozens, perhaps hundreds, of email programs out there. None are part of the operating system. Email programs are welcome to create their own app widgets.
Related
I have currently integrated stock Google sign-in for my app. I now want it to restrict sign-in from only one specific Google domain. eg john.doe#xyz.com. I only want users from the xyz domain to be able to sign in. I'm guessing there is a better solution than regex matching. I have read about openid connect for sign-in but I'm only finding info related to web apps.
I would limit the user input to be only the e-mail address before the #. I would create a TextView(or something) to hold the domain I want people to use and place it on the side of the EditText. This would make people insert only what comes before the #. I would limit the use of certain characters as well (#, for example). And last, I would add the domain I want people to use when they pressed the login button.
String domain = "#xyz.com";
String login = editText.getText() + domain;
Yeah, something like this. But well done and well thought.
From user A's mailbox application, can an agent send reminder to another user B?
I coded a (Java) agent, which runs within user A's mailbox to create reminder for user A him/herself. This works.
If I replace
reminderDocument.save();
reminderDocument.putInFolder("$Alarms");
with
reminderDocument.replaceItemValue("SendTo", recipient);
reminderDocument.send();
then
the reminder is sent to User B. However, the alarm notification doesn't appear because this document is not part of User B's $Alarms folder. Is there a solution to this? Thanks.
"Sending" a reminder will always have the recipient do something with the reminder for it to become an alarm.
Please check the Calendaring and Scheduling Schema
for how to do it "right".
If you need to place an alarm in another users inbox, without him to interact, then you need to create the document there directly and put it in his "alarm"- folder, or you have to setup "automatic processing" in the recipients mailbox (what he probably does not want).
In short: There is no easy way to do this without following the "workflow" (see Page 3 of linked document
I tried finding current mobile no of my app user but in my country the mobile no is not present in SIM so the current API returns null.
As a work around i thought i would just access the outbox of the user to get both senders and receivers no but unfortunately i am getting only receivers no.
Say for example I am user X and I send an SMS to user Y, through telephony API i am only able to get phone no of user Y to whom i am sending the SMS but not of user X.
Can any one suggest any other way i can access the current mobile no of any user??
Thanks
Pranay
Do you think this is what you are looking for? TelephonyManager::getLine1Number
(please, notice you are going to need the "android.permission.READ_PHONE_STATE" permission set in your app manifest.)
Hi I am wondering is there a way of sending the user an email (from my Gmail address) with results of calculations that occurs within the app itself?
For example a form is filled out with values for electricity rates and these rates are then computed and processed into information on savings for a particular product.
What I have is a custom alert box popup with the results and a button saying email me the results and then a EditText becomes visible below asking for the email address of the user.
Is this possible or would a simple notification be easier to do?
You could do it via a form or by using the JavaMail API or you could use an existing email client from the phone.
I have a group that needs to send out announcements and current events via phone text message. I want to have a central phone number that when it receives a text message, it rebroadcasts that message to a growing list of subscribers. I'm hoping to use a Google Voice number to avoid buying an actual phone number.
Any ideas? I've thought about some type of Java/HTMLunit that continually parses the GVoice html inbox, but I just have that computer-gut feeling that there is a more intuitive way. I haven't been able to find a GVoice API, as I imagine that would be the trick.
Thanks
I've used a different approach. There's a number of E-mail to SMS services out there. So you send an e-mail (using standard JavaMail) to a specific address that is then associated with mobile phone numbers. I use TextMagic, but there are also other similar services out there. They also have API support, if thats what you'd prefer.