Tuesday, January 05, 2016

emulator: ERROR: unknown skin name 'nexus_5'

while playing with ionic everything worked fine with the ios emulator, but i got this error when starting the android emulator:
emulator: ERROR: unknown skin name 'nexus_5'
all articles on stackoverflow advised to remove the default created avd image and create a new one. this is fine, but how do i find and run the avd manager on mac?
well there is a quick tip for this too:
go to where android is installed, for me it was
/Users/username/Library/Android/sdk
i cound't find anything named 'avd' there though, but it turned out the correct way to invoke this is
./android avd
now, the avd manager should run and you can create a new virtual device.
but why did we receive the error in the first place?
i my setup there was a default created device for nexus_5, so i decided to run it and...got the same error. so the virtual device itself was bad? turned out an easy fix - avd itself tells you if there is a problem with the device and it was easy to just set the skin to a valid one - probably on osx the android sdk somehow doesn't provide the nexus_5 skin?

after this running
ionic emulate android
ran flawlessly and the sample app appeared.

i'm very excited about ionic, let's see if something will come out of this too. one point of bother for me is that i only yesterday found that that the current ionic is ionic framework 1, and there is a v2 in the works, to be released around Q3. so should i even start with v1, will it not be obsolete to invest in it, when v2 finally arrives?

just realised this is my first post for 2016 :) Happy New Year everyone!

Saturday, January 02, 2016

fall in love with meteorjs + deploy an app to heroku

yes, fall in love indeed - because for me, a mostly c++ person, the recent developments in web, specifically the rise of javascript as a powerful tool to build apps, went past too quickly to observe and have time to play with. but meteor provides an excellent fundament, a basis, to build javascript/nodejs apps with really not that much frontend knowledge. and i could see this pretty much the first few hours after i started playing with meteor.

why? i had some basic knowledge about javascript, and the knowledge that nodejs is a huge callbacks mess which i don't want to have anything to do with. but here came meteor, and it wraps nodejs so nicely, that i never need to bother about it - and instead with the help of familiar paradigms - RPC, client/server - allows to easily jump and play with things like bootstrap, jquery etc without worrying about servers setup etc

not surprisingly i started with meteor tutorial at http://meteortips.com/first-meteor-tutorial and i must say it is great in laying out the basic principles of building apps with meteor - Spacebars, publications, methods etc. the tempo is well paced and examples quite nice too.

actually i wanted this post to document the steps for deploying the app i built to heroku.com. heroku uses something called buildpacks, to help deploying apps requiring certain development tools in the hosting enviroment. so once you find out that the recommended build pack for meteor is meteor-buildpack-horse the rest is easy, because the github page has detailed info how to deploy. except for one step - if you're using some configuration, provided in a (json) file - e.g. settings.json - in this case the tip provided by geekforbrains at https://gist.github.com/geekforbrains/c8a11d128f13d038b119 is invaluable:
heroku config:add METEOR_SETTINGS="$(cat settings.json)"
mmm...it is good (actually priceless) to have good logging for your app, otherwise it would be quite head-breaking discovering deployment errors - the case "but it works fine on my machine, why doesn't it run on the server? :(", so a simple logging message, 'handling' the situation with the missing settings file, helped me resolve the problem within minutes, instead of, potentially, hours - and that trying to find the error remotely, with potentially multiple deployments and code changes..blah, blah,,,you get the idea

the work on the app is till under progress - it is deployed and available at http://instaplaylist.co. the idea is to drag and drop youtube-hosted videos from various sites and view later on this site (instead of on youtube, which also provides this, and better, and nicer - but hey :)) still under progress - misses a landing page with info etc, but it is fully functional, but lots of ideas to expand it, given time. i'll do my best to post the source to github as well - maybe in a different blog i'll also make a more elaborate post on my experience with the awesome meteorjs

update 18.09.2016: for a new app i had a problem with deploying to  heroku:
- first deploy works fine, logs display meteor 1.2.1
- next day a new deploy - fails, logs display meteor 1.4.1

the solution was to run
heroku config:set BUILDPACK_CLEAR_CACHE=1
(as mentioned here: http://stackoverflow.com/questions/38672782/heroku-rejecting-push-of-a-meteor-app)