Monday, 19 January 2015

Developing iOS apps and Test with Ionic View For iOS - Apps Development

i'm Big Fan of Ionic Framework and services,Eagerly waiting for ionic Creator GUI interface to develop cross platform apps.Ionic Framework becomes powerful Day to Day and web developers prefer to use it because Cross Platform Supported and good and Responsive User interface unless like JQuery Mobile and Powerful Angular Javascript for Application Logic and Controller.I love to Work with the this framework due to rich UI like bootstrap.Recently They have launched the iOS ionic view to Lively test your apps on ios via ionic Cloud service.Develop your apps wherever ! upload with single command and Download it and use it within the ionic view iOS app.This is Similar idea as like intel app framework to deploy on real device on Android.However since i don't have any MAC Device for Developing ios apps,this helped me to deploy it on original device and test it.



Prerequisites :

1) Learn Here to Install and Work with Ionic apps CLI and to Deploy.
2) Create Account at ionic apps service

Now let us create a Simple Ionic App to work it out in iOS through ionic view.

Procedure :

Open your command prompt and start typing command mentioned below,

> ionic create <app name > blank

This Above command will create Simple Template app with Hello world.

Now just start creating the App from Scratch with HTML/JS/CSS may be cordova plugins for API Access.After just we have to upload the Project files to the ionic service.

>ionic upload

At the First moment it will prompt for Email and Password,Just give away the credentials and you application will be uploaded with success message.

Caution : I had Recently updated Ionic , Cordova npm packages in my System,So.i didn't get any Error messages,So please Check your version and work it out.

Confused State : 

We didn't even add iOS as platform then how could we run it on iOS device,Actually i too had this Starnge :D funny idea but the whole fact is simple,we are uploading the HTML/JS/CSS files and running it in webview of iOS app.so when your deploying standalone app then you should add iOS platform to build the app and release.

Work with your app on iOS :

Download the ionic view app from your iTunes Store.Login with your ionic app service credentials and your app will listed in the app.Just click to deploy within the Webview of that app to test it out.That's it.

My Experience : 

Recently i was working with +Mothi Venkatesh for apps development for Blogging platforms,We just Tested it with our Blog simple RSS feeds.





Thus We have Successfully Tested our app in iOS Device,but it may have numerous limitation i hope in future for advanced users and developers.

For bugs/Errors/Comments/Hugs just comment below using Disqus or mail me to s.shivasurya@gmail.com or connect with me in Facebook/twitter/G+ hangout chats for Discussions and Help.Share is care.



Sunday, 11 January 2015

Socket.io Twitter Streaming API - Node.js Deployed on Modulus.io

We Would be curious About Chat Applications Response on time and blaming it if makes struggle a lot to connect with servers and message keeps on Failing with lot of Notification that "Message Failed".Many Of my Friends have faced that and Trolled the Application.And here comes the Technology known As Sockets/AJAX polling to instantly chat with our Besties/Crush :D .However we could use the Socket/Ajax Long polling Technology for Streaming Videos,Files and Tweets from Twitter for Web/Mobile and Desktop Apps too and for Real time Updates.it can be also used for Collaborative works over online to maintain concurrency among the group members and real time!


Reference : Download | Live Demo

Ultimate Goal :

After Working/Reading this Post you can technically create and set up Node.js with Socket.io Server side and connect with Clients and Stream Media/Text Whatever may be!

Prerequisite : 

1) Twitter Account with Verified by Mobile Number(This is mandatory to create apps on Dev.twitter)
4) Node.js npm Commands /basics 

Procedure :

Create a Twitter App :
  • Start Creating Twitter App - Link [ Callback not Required ]
  • Copy Consumer Key / Consumer Secret

  Setting Up Server : 

Node.js Server Setup with Socket.io and Writing functions for events that Emit.Generally Node.js Event Driven Programming Language which has infinite loops to execute in single threaded.So just we are going to write some Routines for Functions which mean that they must Execute when corresponding event occurs.

 > npm install -g socket.io

>  npm install -g express

package.json :



 {
"name":"tweets",
"description":"Simple Streaming Twitter",
"version":"0.0.1",
"dependencies":
{
"express":"4.x.x",
"twit":"*",
"socket.io":"*"
}
 }


Install the package as per directed in package.json file.Additionally i have included twit which is also library acts for Twitter API.

server.js :


var express = require('express')
  , app = express()
  , http = require('http')
  , server = http.createServer(app)
  ,Twit = require('twit')
  , io = require('socket.io').listen(server);

   server.listen(8080);


  app.use(express.static(__dirname + '/public'));


 app.get('/', function (req, res) {

      res.sendFile(__dirname + '/index.html');
});

var target = ['cricket'];

 var api = new Twit({
    consumer_key:         'YYYYYYYYY'
  , consumer_secret:      'YYYYYYYYY'
  , access_token:         'YYYYYYYYYY'
  , access_token_secret:  'YYYYYYYYYY'
})

io.sockets.on('connection', function (socket) {


 var stream = api.stream('statuses/filter', { track: target })


  stream.on('tweet', function (tweet) {

    console.log(tweet);
    io.sockets.emit('stream',tweet);

  });

 });


The above code contains the twit,Http and Express and then we written function to be triggered when connection to client is successfully established.here we are giving our required consumer key,Consumer Secret ,Access Token and Access Token Secret.with that we have added the streaming Watch list and then made API call to Twitter to get the Right Status and we are Emitting the Tweet as Data to our connected Clients via Sockets/Ajax Long Polling Approach.

Read here about How Does Socket.io Works / Does Socket.io uses Websockets ?

Client Setup :

The Basic Rule is simple Javascript event is triggered to connect to the server and Long Polling is done on Server to ensure they are connected and either Data gets Transmitted/Received using the Events by Javascript Socket.io.


A simple Client Example : 



<script src="/socket.io/socket.io.js"></script>
   <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.js"></script>
  <script>
        var socket = io.connect(); 
        socket.on('stream', function(tweet){
          $("#data").append(tweet.text);
       });
</script>


Resultant :


Final Word :

Thus We had Successfully created a simple Streaming from Twitter Real Time Updates with Node.js and Socket.io.If you're Downloading the Code replace the Keys and Work it out in Localhost and test the Streaming API from twitter.However this is the basic part of Socket.io.you could perform a lot when you go through the Documentation from Twitter!.

We will see how to Deploy Socket chat apps/Real time Data Sharing apps on Cloud in Next post.

hope you have Enjoyed!For bugs/comments/hugs/report/issue/help just drop me a mail s.shivasurya@gmail.com.or connect with me in Facebook/Twitter or Chat with me In G+.share is care.

Monday, 5 January 2015

Introduction To Internet Of Things - IOT with Frugal Labs at IIT Madras

By last Decade the Internet came up with boom of several technology with popular Programming languages to run at server side and and delivering the clients machine.And by 2007 came up with Mobile Phones with Internet Access and by now it has matured and grown a lot.by the same side Internet usage is also growing and device connected to the internet is also growing heavily.So,some interesting thing came up know as Internet Of Things.Even many more popular company starts supporting it because it's scope in future is really needed when you deeply apply the science and Facts.


I had attended Workshop Recently on Internet Of Things at +IIT Madras with my CollegeMates +SRIRAMAMOORTHY+Puviyarasu , +venkatraman,RamKumar, +sivasakthi,naveen,Senthil.Really it was Awesome to Work with them on IOT hands on Session by Frugal Labs!


















So,What is Internet Of Things ?

Internet Of Things is Nothing but simple technique which Machine-Machine Interaction and Decisions,Predictions made by machines programmed and Sensed by sensors and Assisting the Humans Digitally for Day to Day life.

A Fast Video on Internet Of Things :


Some Day to Day IOT Ideas :

IOT comes here to help you to Take Selfie with no Pain :p to monitor the Traffic in a Area and Notify you!Assume you have to take tablets in right time,IOT helps to notify and monitor you assisting digitally.It can Track,Sense and interconnect many Device and Share data and Respond to the Particular Situations.here is Small Video on Real Life Application on Internet Of Things in Day to Day Life!



My Experience @ IIT Madras with Frugal Labs :

We Got small arduino UNO board for Working out and connecting with Cloud and Mobile apps.We have Actually followed Python programming Language to Connect With IOT device and pushing data in to Cloud and KiWi App module from Python for Desktop Apps development and Simple Android App to control Device Via Bluetooth low Energy Device Module.My Small Snaps On Workshop Below!



Arduino Board Connected With USB
A Simple Program to Control LED and Check Temperature using Sensor
Bluetooth Module to communicate between Device and Arduino board


Hello World App :

When We try New Thing we Always perform Hello World ! :D and we too done it successfully using arduino board and some LED lights on Board! 

Temperature Sensor App :

Then Comes Temperature Sensor module where we just coded for getting Room Temperature and Display in our Console.and We took the Data to Parse Cloud with the Help of Parse API and python Coding.

Bluetooth Communication App:

Finally we connected Remotely with Bluetooth to fetch Data from The arduino Board and Displaying in Either Computer Console/Android App console.

Final Word:

And The Above is just Beginner Level of IOT with Arduino programming and supported by INTEL and even more popular companies.hope you have got some Ideas about Internet Of Things Rite now.Visit the Frugal Labs site for more Workshop details and Assistance details.


for more suggestions/Bugs/Hugs/help just mail me to s.shivasurya@gmail.com or start commenting below or chat with me in Facebook/G+ chat.share is care.