At Magnet, we want developers to build the best mobile apps so we’ve decided to offer some tools and products for them to do just that.
The first one we are releasing is called rest2mobile. It solves the challenges around APIs consumption in mobile apps.
Mobile apps are becoming more and more ‘connected apps’. Partly because Internet connectivity is now cheaper, almost ubiquitous, and because apps are getting more sophisticated. On average, a mobile application integrates with 5 to 6 remote services (Ex.: Facebook, Twitter, LinkedIn, etc.). The protocol of choice for apps to consume remote services is HTTP/REST with JSON-encoded payloads, i.e. REST/JSON APIs.
Mobile developers are spending a lot of their time writing code that deals with APIs. Each exchange with a remote API requires to invariably follow the same steps:
- build REST requests,
- serialize objects to JSON payloads,
- connect to the server,
- map JSON payloads to entities,
- manage exceptions,
Some mobile developers, not very familiar with remote connection management or serialization/deserialization, may see that part of the app development as challenging. Even experienced developers would rather spend their time writing code that adds value to their app rather than focusing on mundane code.
Comes rest2mobile, an open source (Apache License, Version 2.0) tool for the mobile developer community. rest2mobile generates native multi-platform code (Android, iOS & JS) for the REST/JSON APIs you want to include in your mobile apps. More details are available on Magnet’s developer site, and the following posts will help you understand how it works and will guide you step-by-step to use it in your own mobile apps.