Create a service on android with phonegap application

This is a repost of an old post I wrote in July 2013 (pardon my English from back then, and the poor layout). It got a lot of traction and got people requesting for a repost. This is unfortunately not an updated post, but I’d be happy to answer questions if I can. Hopefully there are still some fair advice to learn from. Happy coding! —

Installing your application as a background service using phonegap is not easy and intuitive. This article will show you the easiest way to install your application as a service so that whatever the user will be doing with its phone, your app will always be running and execute the code you want even if your application is not in the foreground anymore. I’ll also give you more tips about keeping your phone awake (no sleep mode) and prevent the Android garbage collector from stopping your service.

Native or Javascript?

Before we start, let me tell you that the code executed as a service must be written in JAVA. You can still pass information (as a JSON object) from JavaScript to Java before the execution of your service. You’ll realize pretty quickly that it’s going to be really useful so I’ll show you how to do that in my article as well.

Continue Reading

Send authenticated email from a subdomain

Trying to improve your deliverability and send emails from a subdomain? Verifying SPF and DKIM can quickly turn into a nightmare. Your DNS host and your transactional email platform might share different information and lead you to do the wrong things.

This short post will explain how to send emails using a subdomain and how to update your DNS zone with GoDaddy in order to send verified emails.

Why using subdomains to send emails?

Deliverability and reputation are a big thing in regards to email. Say you’re sending order confirmations by email, you want these to arrive directly in your customers’ mailbox instead of spam folder.
Sending all your emails (sales, customer service, employee accounts…) from the same domain can be hurtful, especially if your own email are not received anymore by the people you’re trying to contact. It could quickly hurt your business and the response rate you’d get from cold leads to existing customers/partners you want to talk to.
Also a high amount of bounced email could cause your domain reputation to go down, including your SEO rank.

Subdomains are seen as separated entities on the web. If you have a high bounce rate with “mail.mydomain.com”, you will keep “domain.com” reputation intact and therefore, protect your deliverability. If you pay a close look to all your favorite apps that keep sending you emails, you’ll notice that their sender emails is usually a subdomain.

Continue Reading