Monday, October 17, 2016

Pizza App

Pizza App is finally out!

Developing this app has been a great achievement for me. It contains very exciting features that were really rewarding to learn and implement.

I started developing this app back in March, it started as a simple pizza locator using the now deprecated Yelp V2 api.

I forgot about it for several months until I learned about the existence of Firebase. I thought that it could be a good idea to revisit the app and implement some cool features to it.

I have to confess that I regularly scout freelancer portals and see what is trending so I can learn what features people are asking for.

It is no surprise that real time chat applications are on the rising, everyone wants their own WhatsApp, SnapChat, etc.

Firebase offers its database services in realtime, to read data in realtime you only need to set up an URLStream and its ProgressEvent.PROGRESS handler. Every time a message is pushed to the database you instantly get notified by it.

People also often ask for users to be able to upload images, comment and vote on them. For this I used the Firebase Storage with the Firebase Database.

Using the CameraUI and CameraRoll is certainly challenging, there is a lot to consider, starting with how you get the picture data.

You can get it sync or async depending on the device and OS and each method has its own workflow. Thankfully I found a very detailed doc on Adobe's site explaining how all of it works.

Now that you have the picture data you need to convert it to BitmapData in order to be previewed inside an Starling app, but you also need to make the image no larger than 2048x2048 pixels.

That part was tough, it took me several hours to figure out an algorithm that allowed me to scale pictures while maintaining their aspect ratio.

Once that was sorted out, everything else was a walk in the park.

Yelp recently updated their API and it has been very easy to work with it, you no longer need to create complex requests just to get a list of businesses.

Now you only request an access_token and then use that token to access the api, both of those can be done with very simple URLRequest+URLLoader combo.

While I was developing this app I was learning more about how Firebase works only with a REST approach (in a future post I will elaborate my insights on this), at the same time I made some guides and examples that have been quite popular and hopefully have helped a lot of developers.

To wrap things up,  I'm glad that this app is finally out and I really hope it helps our community in showcasing what's possible to do with the Flash platform.

Now I will continue my plan to write a book on how to develop a simple business app with FeathersUI and Starling.

No comments:

Post a Comment