I am using ijetty and I have a war deployed on it. One service it provides it to send emails out from the phone remotely. The recipients/subject/body are all POSTed to the server and I want to send them out of the phone.
I am using this method and it send the mail fine but I need the users credentials. Even if I could just get the email and then the user posted the password that would be fine but to do this I need to use
AccountManager accountManager = AccountManager.get(context);
The problem is that I do not know how to get ijetty's context so that I can get the accounts.
If anyone can help or provide some other direction I would greatly appreciate it.
Ok so I got an awnser from the ijetty mailing list and here it is,
android.content.ContentResolver resolver =
(android.content.ContentResolver)getServletContext().getAttribute("org.mortbay.ijetty.contentResolver");
android.content.Context androidContext =
(android.content.Context)getServletContext().getAttribute("org.mortbay.ijetty.context");
With these 2 objects you should be able to do what you want. Alternatively,
you could always subclass i-jetty to provide access to more android objects.
Related
I want to create user at Mesibo but i am facing some issues :
Sorry, we can't find that page It seems the page you’re looking for doesn’t exist. Maybe you’re on the wrong track, maybe you found a broken link. Who knows?
Please anyone here to help related to these issues and also help to complete my this task and I am using following URL for creating a user at "Mesibo".
"https://mesibo.com/api/api.php?token=cn9cvk6gnm15e7lrjb2k7ggggax5h90n5x7dp4sam6kwitl2hmg4cmwabet4zgdw&op=useradd&appid=com.mesibo.demoapp&addr=18005550001"
token = Application Token
appid = Android or iOS app id (for example, com.mesibo.xxx). In case of web, just pass, ‘web’ as appid. Note that, for security reasons, the token generated for a particular appid will only be usable on app matching that appid.
addr = end point address, for example, a user phone number.
Thanks
Instead of "https://mesibo.com/api/api.php?..." use "https://api.mesibo.com/api.php?token=..."
I need to verify the spam score of mobile numbers using Truecaller API .I found documentation here . In the API URL , I need to send a APPKEY , But how to get that ? there is no registration page for Truecaller API .
https://api.truecaller.com/v1.0/search.json?userKey=APPKEY&phone=NUMBER
Any help will be appreciated...
You should Read this Document for Name Search API
it Says that....
The one thing to keep in mind is that all requests to our API require
authentication. For that, you will need to use a User Key (userKey)
along with your requests. These access details basically associate,
your server, script or program with a specific application. All
requests to the API must be made over SSL (https:// not http://).
It means you have registered Truecaller developer account then Do Login and get your Access Key(USER KEY) and pass it everytime you request to access API..
But I Think Truecaller API is not accessible for public users...
Read This Article for More Details : http://www.3scale.net/2013/05/truecaller-api-search-among-over-600-million-phone-numbers-worldwide/
Why don't you try this?
callerpy
Here is the explanation from the developer:
Truecaller Name Retriever.
Since my request for the API was rejected, I commenced using python parsing libraries.
Callerpy emulates the process one would encounter if using a web-browser.
I tried it, and it works like a charm from the command line.
In my project I need to access the Exchange accounts on the device, to change them.
I need to do it programatically , inside my application.
I have searched around but it does not seem that there is a way of doing such a thing.
Please any help or suggestion?
EDIT EDIT
To be more specific i need to:
lists all email accounts on the device and allows the user to change settings for Exchange accounts:
*server address
*server port number
*SSL (on/off)
*accept all SSL certificates (on/off)
*account password
You can't modify the permissions/settings of an another exchange account (it gives you a security error). You only can create your own exchange account witch it will be included in your exchange accounts as yourAppName..
Take a look at AccountManager (http://developer.android.com/reference/android/accounts/AccountManager.html)
You should be able to do something like this:
AccountManager accountManager = AccountManager.get(context);
Account[] accountList = accountManager.getAccounts();
for(Account account : accountList){
accountManager.getUserData(account, AccountManager.KEY_USERDATA);
accountManager.setUserData(account, AccountManager.KEY_USERDATA, "data");
}
Powershell is probably the tool that I would want to use to do this, but from devices it is tricky. Tools like AccountManager should assit with this as under the hood they are probably using Remote Powershell scripting. Alternatives that I can think of are:
Create your own web service that you can execute powershell commands from, and have your app connect to that. This is a good primer that works for Exchange 2010 and 2013: http://forums.asp.net/t/1683553.aspx?Mailbox+creation+in+Exchange+Server+2010+using+ASP+Net+3+5+application
Find a tool to execute remote powershell requests from the device direct. I have not tried this but this looks like a good thread to follow: http://social.technet.microsoft.com/Forums/windowsserver/en-US/bc1b417d-0388-486b-8742-305a48224a92/android-client-for-powershell-remote-scripting?forum=winserverpowershell
I personally already had web services hosted inside the domain that my app was using anyway (data source was in the domain), so I put my mailbox and AD user management service along side those, then the mobile apps made simple calls like CreateUser, EnableMailbox, CreateMailEnabledUser...
I should send email trough app but I want send it from another mail account (no gmail). I've coded a class Mail and I set host="mail#xxxxxx.xx" but in debug mode I've seen that variable host is = "smtp.gmail.com". How is possible? There is a trick?
You're using the JavaMail API to send the mail, right?
Check the JavaMail FAQ, there's several ways to specify the host you want to connect to, including setting a property or passing it explicitly in the call to the connect method. Without more detail on what exactly you're doing, it's hard to say where you went wrong.
I have an application that authenticates users through the LinkedIn API. My questions:
is it possible for an application to like messages to all users who authorized it?
is it possible to get like list of a message to a subset of the application users?
I've been looking for a while, and can't find anything.
Via the Groups API of the LinkedIn APIs, you can like a post in a particular group using the following JavaScript code (XXXX is the particular post id):
IN.API.Raw('/posts/XXXX/relation-to-viewer/is-liked')
.method('PUT')
.body("true")
.result(function(result) {
alert(JSON.stringify(result));
})
.error(function(result) {
alert(JSON.stringify(result));
});
However, keep in mind that likes should not be automated but user initiated - only users who have authenticated your app should be liking posts, and only when they manually choose to do so. Writing a script that automatically likes all posts from any user that posts a message from your app is against the LinkedIn API terms of service.
Can't confirm for sure but maybe this link about likes can help u and give a clues about possible options.. Reported example you can find here or here. However I have no guaranty that this works cause I am not author of those posts.. Maybe u will find better and more accurate answer at LinkedIn API forum..
Hope it helped a bit.. Cheers