How to Take a photo and attach the photo in an e-mail and send - android-camera

I want to achieve the following
In my app, there will be a screen which allows you to take a picture
Once user has taken the picture, he will get an option to send the picture to the predefined email Id as an attachment.
Can someone throw some light or give me direction on how to achieve this?

For info on how to take a photo in your app, take a look at the Android Developer documentation. It is detailed and it has a sample project that you can use.
To send emails, you could use the code snippet from this SO Answer, shown below:
Intent i = new Intent(Intent.ACTION_SEND);
i.setType("message/rfc822");
i.putExtra(Intent.EXTRA_EMAIL , new String[]{"recipient#example.com"});
i.putExtra(Intent.EXTRA_SUBJECT, "subject of email");
i.putExtra(Intent.EXTRA_TEXT , "body of email");
try {
startActivity(Intent.createChooser(i, "Send mail..."));
} catch (android.content.ActivityNotFoundException ex) {
Toast.makeText(MyActivity.this, "There are no email clients installed.", Toast.LENGTH_SHORT).show();
}
I hope this helps.

Related

IOS cordova-sms-plugin issue

We have a problem with the cordova sms plugin. When you send an sms from ionic v1 app for the first time. Everything works perfect but as soon as you send a second sms the recipient has a comma after it. I'm not sure how this works but now a user will have to manually remove the separator.
var number = 48802;
$cordovaSms.send(number.toString(),message).then(
function (results) {
console.log("SMS sent! ",results);
$ionicLoading.hide();
$scope.job.paymentConfirmed = true;
submit();
},function (e) {
$ionicLoading.hide();
window.localStorage.job = JSON.stringify($scope.job);
$ionicPopup.alert({
title: 'Posting Job Failed',
template: 'Please check your airtime credit if insufficient please top up'
});
console.log("Adding a job error ",e);
}
);
I just tested your code and can see this is not an error with the plugin, this is simply how the messaging app in iOS is designed.
When a number is entered into the recipient list, iOS will automatically put a comma there to allow you to add additional recipients.
The user does not have to manually remove the comment - all they have to do is click in the message textbox and the comma automatically goes away when they start typing their message.
To be clear: I don't think there is much you can do about this, unfortunately :-(

Can I customize the alert emails sent from Azure Application Insights ?

I have a couple apps using ONE and when there is an exception it is not shown in the email specifically which app is causing the problem. Is there some way to add info to the email ? I have the info in the exception . I just need it to appear in the email
public void TrackNonFatalExceptions(Exception ex)
{
var dictExceptionProperties = new Dictionary<string, string> { { "App", "EncompassRequestDocs" } };
_telemetryClient.TrackException(ex, dictExceptionProperties, null);
}
There's no way to customize the mails right now.
There's a uservoice suggestion here:
https://visualstudio.uservoice.com/forums/357324-application-insights/suggestions/5894710-application-insights-daily-weekly-monthly-digest
which might cover what you want.
more likely what you want/need is a way to query your own data programatically and generate the data however you want, in mail/dashboard/etc, which would be covered by a separate planned suggestion here:
https://visualstudio.uservoice.com/forums/357324-application-insights/suggestions/4999529

Facebook gifting send plural form of object type in Unity3d

I am sending apprequest to send "Gift" to friends.
Code which i am using to send gift is as below :
FB.AppRequest (Send_Gift_Message, OGActionType.SEND, GIFT_10_COINS, toFriends, null, "Send Gift", delegate(IAppRequestResult result) {
});
This is sending gift request perfectly but i just want to change message which is shown while sending gift.
I am attaching image which shows message :
I want to change "sent you a coin:". I want to use "sent you coins:".
Is it possible to change ?
If it is possible then plaese guide me steps.
Thanks.

Opening mailto: links from webview

Just want to start off by saying I'm not a much of a Java dev or anything of an Android dev. The links I've found on SO for solving my issue aren't specific to WL, and I'm not sure where to place the 'solutions' in the build.
I've got simple email link to start this:
In Android (4.0.4) the app will crash saying it's not a supported protocol. That much is expected.
One of the solutions I have (below, from SO, lost the link) seems like the right way to go, but I'm not sure where this is supposed to go.
#Override
public boolean shouldOverrideUrlLoading(WebViewClient view, String url) {
if( url.startsWith("http:") || url.startsWith("https:") ) {
return false;
}
// Otherwise allow the OS to handle it
else if (url.startsWith("tel:")) {
Intent tel = new Intent(Intent.ACTION_DIAL, Uri.parse(url));
startActivity(tel);
return true;
}
else if (url.startsWith("mailto:")) {
String body = "Enter your Question, Enquiry or Feedback below:\n\n";
Intent mail = new Intent(Intent.ACTION_SEND);
mail.setType("application/octet-stream");
mail.putExtra(Intent.EXTRA_EMAIL, new String[]{"email address"});
mail.putExtra(Intent.EXTRA_SUBJECT, "Subject");
mail.putExtra(Intent.EXTRA_TEXT, body);
startActivity(mail);
return true;
}
return true;
}
Any help is obviously greatly appreciated!
In a Worklight hybrid application, you are not required to use native code in order to use features such as mailto:.
To get it working, i.e: to click a link that will open the email screen for the user to fill in the subject and message, you can follow the below. If you need greater functionality, elaborate on it in your question:
Make sure you are using the latest iFix available for the version of Worklight that you are using (due to recently fixed Cordova security bugs that affect this functionality). This can be obtained from either the Eclipse Marketplace or IBM Fix Central.
Follow these steps:
In native\res\xml\config.xml, remove and add the following lines:
- <access origin="*"/>
+ <access origin="mailto://*" launch-external="true" />
In common\index.html I then tried with:
Send email
The result was (depending on your phone setup): either to get an option to set up an email account, select from which account to send the mail to, or get the email compose screen.

sending an email in android ...

I am trying to send an email from my app.
the code goes lik this :
Intent i = new Intent(Intent.ACTION_SEND);
i.setType("text/plain");
i.putExtra(Intent.EXTRA_EMAIL , new String[]{"recipient#gmail.com"});
i.putExtra(Intent.EXTRA_SUBJECT, "subject of email");
i.putExtra(Intent.EXTRA_TEXT , "body of email");
startActivity(Intent.createChooser(i, "Send mail..."));
in the emulator it shows the email client again i have to enter the recipient address, when i click send button it doesnt send .
and it is showing the messaging(MMS) context.
any help is highly appreciated ...
here the problem was the email client was not configured in the emulator,,,
It works fine in the device ...