Showing posts from 2017

Deploy angular 5 app in Github pages

Hope you're doing well.

I'll show you how you can deploy your angular 5 app in github pages. Why? you know what? It's free. And you can add your custom domain to it. That's awesome, right? Yea of course.
1. Dependency So first we'll need to install a npm package called angular-cli-ghpages .You should install it globally as it has nothing to do with your project. It's just a command line tool.
npm i -g angular-cli-ghpages2. Build Project If you are using angular-cli you can just build your project for production by passing a --prod flag. use --base-href to pass a base url for your project.
ng build --prod --base-href "/REPOSITORY_NAME/" This will build your project into /dist folder. 3. Publish on github Pages Just use this command to publish your build files to github pages
ngh --no-silent
and then go to your github repository->Settings->Choose gh-pages branch as source.
This should do the trick. If you want to keep using github pages domain. But wait!…

iHealth Device Integration Android

1. Introduction Before working with iHealth devices SDK you need to learn android multithreading communication pattern with Handlers and Messages. You’ve to have complete understanding of those two classes and how they are used to communicate and pass data between two threads. 2. The way it worksYou need to register a callback (iHealthDevicesCallback) to receive connection state and perform operations on it. This callback will be triggered with startDiscovery() method within iHealthDevices singleton instance. This callback interface has several methods that needs to be overriden.onScanDevice(String mac, String deviceType, int rssi)onScanFinish()onDeviceConnectionStateChange(String mac, String deviceType, int status, int errorID)If any iHealth device is found onScanDevice() method will be called. To connect to that device send a command to the handler CONNECT_DEVICE myHandler.sendEmptyMessage(CONNECT_DEVICE);
Those command codes needs to be declared first as constants.
private static fin…