Twenty-Four Hours with Twilio

Updated on Thursday, November 12, 2015

Twenty-Four Hours with Twilio

I've wanted to play with Twilio's voice and SMS service for a while and finally got the chance at an all night hackathon.

Twilio is almost perfect. Very easy to use, well documented and generous with a self service free trial. They give you enough rope to fully build out a client before you need to think about paying them.

I gave up on AT&T's platform after navigating a bazillion forms before discovering they wanted $99 before I could even get a taste.

The one hitch with Twilio is that the voice transcription they offer is appalling. Just absolute gibberish. Unless it's just my accent, or the hackathon whisky. Seems to be a common complaint though and so to take my IVR app further I'd need to bolt in another solution. A pity given how much Twilio gets right.

(Related: Got It; I Love Email; Twitter's API has got too painful for me)

(You might also like: Share a picture in MonoDroid; Bernal in Bloom; Drone School)

(All Code Posts)

City by the Bay

Updated on Thursday, November 12, 2015

City by the Bay

Photo (panorama) of the view from Bernal Hill in San Francisco, California.

(Related: Grand View of Fog; San Francisco; Bay Bridge Approach)

(You might also like: Another Butterfly at the California Academy of Sciences; Autumnal Equinox 2021; Cataract Creek)

(Recent Photos)

Share a picture in MonoDroid

Updated on Sunday, September 30, 2018

Here’s how to share a picture to Facebook, Twitter and so forth from MonoDroid:

A fun mix of Java and C#. The directory got me to start with so check to see if the ExternalCacheDir is available and if not fall back to the internal CacheDir. Frustratingly Facebook doesn’t pick up on the text associated with an image regardless of the intent ExtraWhatever specified.

(Related: How to backup Google Photos to Google Drive automatically after July 2019 with Apps Script; Get an email when your security camera sees something new (Apps Script + Cloud Vision); Capture DropCam (Nest Cam) frames to Google Drive)

(You might also like: Time Lapse Settings for GVM GR-80QD and GR-120QD Motorized Sliders; Bay View and Shoreline Trails at China Camp State Park; Golden Gate Bridge from Marshall's Beach)

(All Code Posts)

Catfood: WebCams for Android

Updated on Sunday, September 5, 2021

Catfood WebCams for Android

I’ve just released a WebCam app for Android. It’s based on WebCamSaver but allows you to control the webcam – you tap the edges of the screen to pan, pinch to zoom in and out. A fun little time waster.

This is the first app I’ve released using Xamarin’s MonoDroid framework. This integrates nicely into Visual Studio and allows you to program an Android app in C#. This is fantastic for productivity and code reuse and I enjoyed the process a lot more than previous work I’ve done in Java / Eclipse. The main drawback is that the framework adds around 5MB (significant for mobile) and the documentation isn’t always the best, especially when you search for something and find out you’ve been dumped into iOS reference material. Digging around the sample code and cross-referencing the official Android documentation helps a lot. I’m going to take a stab at something a little more ambitious next…

(Related: ESRI Shapefile Reader in .NET; Capture DropCam (Nest Cam) frames to Google Drive; The Secret Diary of a Xamarin Android Developer, Aged 48 1/3)

(You might also like: Sunset #9; How does the Nest Learning Thermostat work?; Treasure Island Perimeter)

(All Code Posts)

Not a Private Key

Updated on Thursday, April 29, 2021

When jarsigner says "Key Associated with [alias] not a private key" it almost certainly meant to say that you got your password wrong.

(Related: Is it safe to open securedoc.html (Cisco Registered Envelope)?; Reboot computer in C# / .NET; Air Gap)

(You might also like: Bangalore Timelapse; Wave Organ; Train of Lights)

(All Code Posts)

Sending email via GMail in C#/.NET using SmtpClient

Updated on Friday, September 13, 2019

Gmail Logo

Here’s a quick code snippet that configures SmtpClient to send email using Gmail’s SMTP server:

This can be frustratingly difficult to get right so I’ll run through each setting quickly.

DeliveryMethod: Set to SmtpDeliveryMethod.Network, the alternatives are copying the email to a directory for pickup by a different application. We want to connect directly to Gmail.

UseDefaultCredentials: False, as we’ll be providing our own credentials later. Setting properties in the right order is apparently important for SmtpClient, although the Microsoft documentation doesn’t mention this. Make sure you set UseDefaultCredentials to false before setting the Credentials property.

EnableSsl: True. SSL or TLS is required.

Host: smtp.gmail.com for this example. Note that this server restricts you to sending 2,000 emails per day. There is a less restrictive option for G Suite customers (smtp-relay.gmail.com) and a more restrictive server that can only send messages to Gmail or G Suite addresses (aspmx.l.google.com).

Port: Google says to use 465 for SSL and 587 for TLS. I’ve found that 587 with EnableSSL set to true works fine.

Credentials: Your Gmail address and password in a NetworkCredential. If your account has 2 step (multi factor) authentication then this won’t work. You can generate an app password easily and use this instead of your regular password. It’s also possible to use OAuth.

In the comments below Shika Helmy suggests also setting the Timeout property to 20000.

You can now use smtp.Send() to send the email.

Because it’s likely to be your personal account and there is a 2,000 message cap on sending I’d only recommend using this for small scale projects. You don’t want to get your Gmail account blocked. For higher volume I’d look at using SendGrid or similar.

One last note - while I’ve used SmtpClient for all sorts of trivial email needs over the years the latest Microsoft documentation marks it obsolete and warns:

SmtpClient and its network of types are poorly designed, we strongly recommend you use https://github.com/jstedfast/MailKit and https://github.com/jstedfast/MimeKit instead

Hope this expanded article helps. I still come back here periodically to cut and paste rather than mess up the property order again...

(Related: Get an email when your security camera sees something new (Apps Script + Cloud Vision); Using the Azure Monitor REST API from Google Apps Script; Automate Google PageSpeed Insights and Core Web Vitals Logging with Apps Script)

(You might also like: Bees; Response to GGNRA Draft Dog Management Plan; Drones and Gun Control)

(All Code Posts)

Support SHIELD–a small measure of patent sanity

Updated on Thursday, November 12, 2015

A friend pointed me at the SHIELD (PDF) act today. This bill would make unsuccessful patent trolls pay defendants’ legal bills. It’s not as good as my radical plan to fix patents, but it’s a step in the right direction. If you care, let your congressperson know. Here’s the note I just sent to mine:

Dear Rep. Pelosi,

I'm writing to let you know that I support the SHIELD act Introduced by Rep. Peter DeFazio (D-OR) and co-sponsored by Rep. Jason Chaffetz (R-UT). As an entrepreneur and professional software developer I have personally experienced the job destroying effects of ill founded patent litigation. Any step to reduce this drag on our industry is a welcome step.

Regards,

Rob Ellison
San Francisco 

(Related: HBR on the Wrong Patent Reform; How to fix software patents; California November 2020 Propositions)

(You might also like: Catfood: Earth, PdfScan and Weather; Go-arounds: LEGO and Legislative Service; Summer Solstice 2016 in Catfood Earth)

(All Politics Posts)

Thank you for choosing HSA Bank!

Updated on Thursday, November 12, 2015

Thank you for choosing HSA Bank!

No, thank you HSA Bank for not giving me a choice and then cheekily pinching $2 on every debit swipe.

(Related: Thinking about the UK referendum on AV; Think before you print?; Thank you Feedly)

(You might also like: Email Alerts for new Referers in Google Analytics using Apps Script; Real Time; Securing the Internet of Things)

(All Etc Posts)

etc, hsa

Reviews and Links for July 2012

Updated on Friday, February 24, 2017

The Sense of an Ending by Julian Barnes

4/5

A personal anti-adventure, gripping and poignant and pedestrian.

 

The Children of the Sky (Zones of Thought, #3) by Vernor Vinge

0/5

Solid, unexpected third installment. Don't read if you haven't read the first two.

 

Links

'robot revolution would end quickly, because the robots would all break down or get stuck against walls' - http://t.co/X4AFepMI

RT @GeoCollective: Daniel @RavenEllison speaking at National Geographic on the importance of #geography and #guerrillageography http://t ...

Aspam, Aomori, Japan - looks like Blade Runner. http://t.co/UePboKyJ

Cloud Atlas trailer http://t.co/etJealdX (on the plus side, lots of reasons for this to be great, on the minus side... Tom Hanks :( ) #fb

[text: “what the fuck, it worked the first time”,... http://t.co/chCeMv8M

Chow Down (at Chick-fil-A): http://t.co/cOuZViuC via @youtube

4 of 5 stars to The Sense of an Ending by Julian Barnes http://t.co/lV8ZrNHL

I side 90% with Jill Stein... http://t.co/zCNzugqD

Naples, Florida, USA snapshot from Catfood WebCams on Android. http://t.co/HACOmEhr

Testing a webcam share from Android... http://t.co/Ha94fZoW

Photo http://t.co/GnDGvPPZ

Rolling up social APIs: https://t.co/qrXnqX7T #todo @myEN

Thanks for the Cash Mr. Bubble Man: http://t.co/ZonD58yD

With More Original Programming On The Way, Netflix TV Viewing Is On The Rise http://t.co/Q8oCNZUv -- missing the point, lack of content

Hubble discovers new Pluto moon http://t.co/kRB95fLu -- Promote Pluto back to a planet immediately!

Amanda Palmer's awesome stop-motion music video [NSFW]: http://t.co/XfGBC9NY

ITHCWY: Hummingbird http://t.co/CHtA5fV3

Clegg: House of Lords is 'flawed' http://t.co/qp6MuKPO -- yes, do this: http://t.co/QNPyzu8X

ITHCWY: Twitter's API has got too painful for me: I've developed a bunch of stupid, niche and vaguely promising… http://t.co/J6Y0EZ62

IT class warfare — It’s not just IBM http://t.co/bK0Nr2lG

Naming Pets http://t.co/syC0kgWa

BBC News - Brian Cox: bank bailout costlier than UK science 'since Jesus' http://t.co/1RSN5g5Z -- amaaaaazzzziiiinnnnngg

"A conversation with my 12 year old self" (video) http://t.co/zYOEKDnN -- freaky

ITHCWY: Shrubbery: A missed opportunity to demand that violators shall provide... another shrubbery! (At the Old… http://t.co/lBSQaDmI

Probably the Higgs: http://t.co/yspWoQlv

Spring cleaning in summer http://t.co/269vRG1O - Google kills iGoogle. It was naff, but it drove a lot of @CatfoodSoftware business. Sad.

Cisco's cloud vision: Mandatory, monetized, and killed at their discretion http://t.co/OkBkKAsA via @extremetech @CiscoSystems

A better idea for House of Lords reform: http://t.co/WXhNgHF4 Agree? vote for http://t.co/svIg4nuG #lordsreform

ITHCWY: House of Lords - time for Legislative Service?: I've mulled the idea of having an upper chamber randomly… http://t.co/6C5cQjz2

You Might Be A Smanker If… http://t.co/L91rDvqV

Cisco locks customers out of their own routers, only lets them back in if they agree to being spied upon and monetized http://t.co/2QIdw42P

Bouncy, bouncy druids, not available outside the UK: http://t.co/mw7XcKth

Division http://t.co/2tIh8IXM via @RavenEllison

Patent troll http://t.co/AY3FIg8W

Operated by the knights who say NI! http://t.co/TkMndo7c

(Related: Go-arounds: LEGO and Legislative Service; Leaving the Nest; The Trust Project, Fake News and a Partial Facebook Uninstall)

(You might also like: I just want to get rid of Windows 10 Notifications with one click; Humpback Whales in Golden Gate; Coronavirus Hikes: April 2020)

(Recent Photos)

Hummingbird

Updated on Thursday, November 12, 2015
I Thought He Came With You is Robert Ellison's blog.

Newsletter