As the tech / mobile age continues to advance forward, more entrepreneurs are hiring devs to push out the latest and greatest mobile app ideas. Anyone who releases a product wants to reach as many consumers as possible. For us developers, that often means developing the same app multiple times for different platform architectures. To make things as simple as possible I’ve written up three options that can drastically reduce multi-platform development time.
- AngularJS / Web App with Native Device Wrapper or PhoneGap
- Interface Component Design w/ Injection Framework
- Microsoft Azure / Active Directory For All Platforms
AngularJS is a brilliant new framework that Google is trying to push as a standard for Web devs. While working with different companies, I noticed that if they don’t have Mobile Developers they will use their web team to create multi-platform solutions. For example, one company I worked for had an AngularJS app published on the web and wanted a mobile solution with extra security protocols. By loading this website in a WebView on both Android and iOS I was able to use native device functionality such as Camera, TouchID, KeyChain account storage, and more to interface with this app via JavaScript. Each platform has some form of library or built in API to interface with web applications, so we might as well utilize these!
As you are exposed to more developers, you become exposed to different methodologies, design paradigms, and programming standards. One such game changing idea I’ve been introduced to is Injection frameworks. The concept is that you can abstract any sort of new object instantiations (ie: new object()) or constructor handling by defining a class that will pass the correct object to its proper interface via name protocol. Pseudo Code Example:
[box]
//Generic interface
public interface IConnectionHandler{
public void connect();
public void disconnect();
public String getIPAddress();
public void setConnectionsParams(String ip, String host, String etc etc etc);
}
//Versioned development test handler
public class DummyHandler{
public void connect(){
//connection implementation
}
public void disconnect(){
//disconnect implementation
}
public String getIPAddress(){
//return ip address implementation
}
public void setConnectionsParams(String ip, String host, String etc etc etc){
//set connection implementation
} }
public class SomeClassThatNeedsConnection{
public SomeClassThatNeedsConnection(IConnectionHandler handler){
//do handler things
} }
public class InjectionHandler{ //Basic example to demonstrate versioning with a Dummy Handler injector.bind(“IConnectionHandler”).to(“DummyHandler”);
}[/box]
You’ll notice that the injection handler calls a bind function to map our interface to the “DummyHandler.” Essentially the benefit to this is that you will never have to change any code that is dependant on your ConnectionHandler, rather you can simply modify your connection logic. This has many benefits not only in versioning but in development / production / post ship upkeep.
My third point for multi-platform development is one that a lot of new developers struggle with: A mobile backend. Often young developers will try and create their own with MySQL tables and use their own hosting, but this quite simply isn’t smart unless you have the experience to do so. Microsoft Azure will handle all of this and more for you. Azure can quickly and easily setup login authentication for you with all sorts of platforms like Facebook, Google, Yahoo, Microsoft Live, or Azure’s Active Directory. There are API’s for each mobile platform that can easily access Azure’s features like Table / Blob storage, Push notifications, data / user queries, and much much more. Having a robust, trustable platform like Azure can remove all the frustration of connecting your mobile applications to the same data on different platforms.
Conclusion: Multi-platform development can be an absolute pain at times, but with research and the proper infrastructure engineering it doesn’t have to be nearly as bad. There are a ton of tools out there. If there’s anything I missed feel free to give me a shout at zack@zackmatthews.com and I’ll add it to my writeup.