AzureChatr: Building a Cross-Platform Talk App for Windows, iOS – Android, Age of Mobility – by Nick Landry
Age of Mobility – by Nick Landry
AzureChatr: Building a Cross-Platform Talk App for Windows, iOS & Android
by Nick Landry (last updated on Ten/7/2014)
Have you ever witnessed a big news announcement about some mobile app or website being acquired for millions (or billions!) of dollars, only to tell yourself:
“Wow, that’s a lot of money, and to think that I could have been the one to build that!”
This is exactly how I felt when WhatsApp was purchased by Facebook for a whopping nineteen BILLION dollars earlier this year. Why? Because like all of you, I have technical abilities and I know how to build apps, and I knew I could have built that app. It seems that talk/messaging apps are all the craze now. Microsoft got things going early when Skype was acquired back in two thousand eleven (tho’ Skype is so much more than just a talk app). Yahoo just acquired MessageMe, and now Google is evidently building their own too. So what am I to do here? Admit that it’s too late or challenge myself?
I determined I would prove it to myself. I determined to build a cross-platform talk app that lets people on Windows, iOS and Android talk with each other. I knew it wouldn’t be that hard because I have a (not so) secret weapon called Microsoft Azure. My objective is ultimately to showcase everyone how effortless it can be to build cloud-powered mobile apps, no matter if you are a Windows, iOS or Android developer using C#, Objective-C or Java. What better way to do this than to build a live app, and then share the source code with the community as I blog about the internal “how to’s”?
Introducing AzureChatr: A Talk App Powered by the Cloud
AzureChatr (pronounced “Azure Chatter”) is a cross-platform talk client that I now use to demonstrate mobile development technics with a cloud backend using Microsoft Azure. While AzureChatr can be used to talk about anything, the intent of the app is to bring users together to talk about cloud development. Last June I shipped the initial beta release of AzureChatr for Windows Phone 8.1. AzureChatr will soon be available on Windows 8.1, iOS and Android too. The cool thing is you do not have to wait until I publish AzureChatr on the other platforms. You can find the source code for Windows, iOS and Android below.
AzureChatr lets you talk live in real-time with other users in a global talk room. You do not need to invite anyone, it’s just a big central meeting place (for now). There is presently no support for private talk and all conversations should be considered public
PRIVACY NOTICE: All talk conversations are saved in the cloud for history purposes. Talk conversations should be considered public but will not be distributed to any third parties or used for any other purposes than displaying conversations in the app. Do not divulge any private or confidential information in AzureChatr.
AzureChatr Features
The current version of AzureChatr is certainly not as full-featured as WhatsApp or other popular talking apps. My objective is to keep adding features over time and document their implementation at the same time here on my blog.
Common Features: Windows, iOS, Android
- All talks are posted in a global public talk room. There is no private talk yet.
- Send talk lines to the cloud and save them in Azure Mobile Services.
- Receive talk lines from the cloud via shove notifications (i.e. WNS, APNS, GCM).
- Display fresh talk conversation items as toast notification / popup alerts when the app is not running. Tapping the toast / alert launches the app.
- Integration with the Act Center / Notification Centers on Windows Phone, iOS and Android.
- Support for Portrait or Landscape orientation.
It should be noted that there is presently no built-in way to mute or disable the notifications. This is obviously an upcoming feature. The only way to mute the notifications is either to disable them in your phone settings where permitted, or uninstall the app.
Extra Features in the Universal Windows version
Since the Windows Phone 8.1 version is already live in the store, there are extra features I’ve already added to grind the app a bit more for public use. Tho’ the Windows version is not live yet, some features have already been integrated should you play with the source code yourself. This is because the Windows and Windows Phone versions are built as a Universal Windows app that virtually shares 100% of its source code. The extra features already available in this version are:
- Integrated login with default Microsoft Account on the device.
- AutoScroll the talk window down after each fresh talk entry is posted.
- Multiline text entries with wrapping.
- Only retrieve the last twenty entries on app startup / refresh.
- Added an extra Send button when using the Windows version since the default send button in the app bar is not visible by default.
- Send talk line on Inject key in Windows for mouse & keyboard users.
Upcoming Features
Other than bringing the iOS and Android to parity with the Windows version, I already have a long shopping list of features that I plan to eventually add to AzureChatr across all versions.
- Display time stamps on individual talk items.
- Support for extra talk rooms by topic, and private talk rooms where you can invite your friends.
- Access the talk log history by scrolling back.
- Speech synthesis integration to hear what your friends are telling without looking at the app.
- Voice directive activation with Cortana (on Windows Phone).
- Display user profile photos and permit users to provide extra profile data in the app.
- Customize the UI such as font sizes, colors, etc.
- Support for hyperlinks and emojis in talk.
- Support for posting photos in talk.
- Muting notifications when you don’t want to be disturbed.
- Authentication via Twitter, Facebook and Google+.
- Permit users to “Like” someone else’s post.
And this is just a partial list. I have a lot more in my backlog. Feel free to post your own suggestions in the comments section below. Note that AzureChatr is not something I’m working on full-time. I’ll bang out some code and keep adding features when I find time, but do not expect this to because the be-all-end-all of all talk apps anytime soon.
Download the AzureChatr App
Wanna attempt the app? So far I have only published the Windows Phone 8.1 version of AzureChatr. The others will come soon enough.
- Download AzureChatr for Windows Phone 8.1 (Note that this is presently a BETA release only available to a few countries: USA, Canada, UK, Ireland, Australia, India and Finland).
- Download AzureChatr for Windows 8.1 (coming soon)
- Download AzureChatr for iPhone & iPad (coming soon)
- Download AzureChatr for Android tablets & phones (coming soon)
I’ll be sure to update this blog post as the other versions become available, and also when I add extra features to the app. Of course, the entire purpose here is to learn how to build this yourself or how to add similar features to your own apps, so keep on reading to detect what goes on under the bondage mask.
AzureChatr: Under the Spandex hood
AzureChatr has a lot of moving parts and this section will host links to several blog posts that dissect specific aspects of the AzureChatr components, including the following:
- AzureChatr client for Windows and Windows Phone
- AzureChatr client for Android
- AzureChatr client for iOS
- Cloud components, including Azure Mobile Services, Authentication Services and Notification Hubs
You can get commenced by watching this movie interview about AzureChatr from the Visual Studio Toolbox showcase on Channel 9. It features the demonstrate host – Robert Green – and myself geeking out over how AzureChatr was built, what it does, and how Azure powers it all.
Bookmark this page and stay tuned as blog more about AzureChatr. All the links will be added here.
Dive Into the Source Code & the Azure Services
Before you download the source code for any of the AzureChatr versions, you have to create a Microsoft Azure account and configure the adequate Azure services for table storage via Mobile Services, authentication via Microsoft Account, and shove notifications via Notification Hubs.
The following links will help guide you through this process, including several tutorials from the Azure documentation.
Obtaining a Microsoft Azure Account
- If you do not have a Microsoft Azure account, you can sign-up here for a 30-day trial (with up to $200 in credits to spend)
- If you’re a startup, entrepreneur or an independent app developer, you can get up to $150 / month in Azure credits for free (along with a boatload of other Microsoft software) via Microsoft BizSpark. You can sign-up for BizSpark here.
Setting-up the Required Azure Components
- Create a fresh Mobile Service for your version of AzureChatr. You can use the tutorial here to learn how to get commenced but all you need is to create the mobile service by picking a name, selecting/creating a SQL database, picking a region affinity, and selecting the desired backend (JavaScript/Knot or .NET). My version of AzureChatr uses JavaScript so if you want to use the same server-side code that I am sharing with you, you should pick JavaScript. Note that you do not have to repeat this step for the three clients. There is only one Mobile Service commonly used by the Windows, iOS and Android clients.
- Go after the same tutorial to create a fresh table called ChatItem.
- Authenticate your Windows app with Live Connect single sign-on: Go after the steps in this tutorial to register your app for the Windows Store, restrict permissions to authenticated users and install the Live SDK for Windows. Note that in the current implementation of the code, the iOS and Android versions do not yet support authentication. The authentication code has already been added to the Universal Windows app.
- Please refer to the README.MD file in GitHub. There is a version for each of the three client versions. It contains a block of code you need to edit the ChatItem table Insert script.
Source Code Links in GitHub
The source code for all three versions of AzureChatr is available in my GitHub repo under the following links:
- Source code: Windows Clients for a Cloud-based Cross-Platform Talk App for Windows Phone and Windows Tablets, Laptops and Desktops. Written in C# as a native Universal app using Visual Studio.
- Source code: Android Client for a Cloud-based Cross-Platform Talk App for Smartphones and Tablets. Written in Java as a native app using Eclipse. This is just a basic prototype for now and is not ready for publication to the Google Play Store.
Source code: iOS Client for a Cloud-based Cross-Platform Talk App for iPhone and iPad. Written in Objective-C as a native app using Xcode. This is just a basic prototype for now and is not ready for publication to the Apple App Store.
You’re most likely wondering why I chose the “silo approach” to build these three versions. After all, building the three versions with three different languages, three different SDKs and three different IDEs is basically the hardest way possible. Personally I would have preferred to use Xamarin to build a cross-platform app and share as much code as possible. But I felt it was significant to stick with the native implements already known by the developers indigenous to each mobile ecosystem.
Feel free to use the source code in your own apps. This is why I’m posting my source here, I want you all to learn how to use Azure for such online apps. You can use it to add talk capabilities to other domain-specific apps, or even to your own games. If you intend to simply create another “competing talk client”, that is fine too. All I ask is that you extend the code with your own ideas and features – make it your own (not just a clone) – and publish your talk apps under a different name of your own choosing (i.e. NOT AzureChatr).
If you have questions about AzureChatr, any of the mobile versions discussed here, the features, source code, design decisions or if you need help standing-up your own Azure services to support your own talk features, you can post them in the comments below, or you can ping me on Twitter at @ActiveNick.