 So to start off about myself I am Kashi Vishwanath I am a technical architect at Mindtree I have about 11 years of experience 6 years in android and close to 1 year on the wearable side. So that is about my myself and let us move on okay before I go here I want to just take account of people between 2 to 8 years of experience okay about 30-40% 8 plus okay others 2 to 0 to 2 is it okay okay so there is a mix okay fine thank you okay just to give you overview about Mindtree we are globally present I will not take a lot of time here and we were awarded the business leaders award last year and 3 days before our CEO was given the best CEO of the year for mid-tier companies it was Krishna KK he is called KK actually and this is our high-tech business which we work on I will just move across quickly and these are the clients which we serve again I am moving it quickly and mobility at Mindtree what do we do so we have about 700 place employees working on mobility and some of our customers have been listed out here okay I will just cut for regarding Mindtree here and let us go on to the actual thing so this is my agenda for the PPT so I will be talking about the emergence of wearables why wearables make sense and how wearables are used today and what are the sensors what are the various sensors that go into wearables today and we will show you a demo and we will have a hands on the surprise continues okay okay so this is about this is small slide about emergence of wearables so we are in this slide what we are trying to tell you is where are we going see if you take the middle portion where in the technology we are seeing that 72% of the people are having mobile phones and the other figures have been mentioned here and that is where we are seeing that people are moving slowly into the digital space so wearables make good sense here actually so that is that key takeaway should be this from this particular slide so whatever we do it is basically only when we have profits revenues money right so even when wearables are coming into picture companies adopt wearable technology only if they say see money in it right so as per one of the researchers it says about by 2018 the revenues from wearable devices will be about 30 billion dollars is it good enough to take wearables do we think okay see currently there might be only limited number of wearables so in this you can see a smart watch a glass and Fitbits or a health kits but more wearables will be coming in for sure and we have a counter on the top right when Epson is one of the wearable devices which have been there okay now every time we talk of something new we need to understand how can it continue to grow right so the triangle here depicts exactly what should be done to make the wearable successful okay so it says it should be a device if a device is said to be to have connected intimacy then it can be a successful wearable device then it must be tailor made ecosystem for example social networking was a huge hit why because they had the underlying ecosystem and people got connected very easily to it so if the wearables can connect personally to a human being then I am sure wearables would be a very huge hit and the third reason it says it's a co evolved possibility that means a person is becoming a computer by himself because he's wearing a lot of gadgets on him and he's it's he itself is a smart person now not in terms of brain but in terms of gadgets he's wearing okay okay why wearables are preferred or why wearables can be preferred over the other digital mediums we're saying wearables are mostly hands free for example you take Google glasses they're totally hands free you have a smartwatches you can just communicate it through voices itself you know you need to interact it through your fingers so basically we are saying it is hands free and accessibility to biometric information becomes easier then augmented reality becomes possible in terms of wearables and when you have something wearing on you it is very personalized to one right so these are some of the advantages of wearables over traditional channels okay the next important thing we'll have to ask is where wearables are used today right we might have heard about the wearables but where are these used that's a very important question to answer it might be used in a various places but what I have chosen is I have choosing a banking area so big because everything is related to money and I thought let's take a banking use case so it will be easier to tell where wearables fit into banking use case okay to start off with these are all existing applications in the market okay this is not some fantasy or saying it will come down the line but these are the existing things that are already in the market okay so in the Spain we have one company which through smartwatches they have their stocks and equity sharing then Westpac has a balance availability on their smartwatches and there's a US bank which does fraud receive alerts and other types of information on smartwatches actually moving on on the glass we have a private bank in Ukraine which does glass banking and that is one of the snapshots of that and we have a MJ bail in Japan they have a contactless chip on their collars in their shirts and it's a contactless payment system so that is one of the Japan moving on again will be financial has a glass app wherein they can do payments using their app which is a glass app and Buckley's back and something to do with fitness moving on we have Caxia Bank which will show you 24% video conferences as well as you have a ATM locations using a glass and this is a very interesting use case Virgin Atlantic so what they do with the glasses you can do a face recognition of a person they say it's working I'm not very sure of this very when a high-profile customer comes in or a first-class customer walks into the airport they just scan the person through their face and they're able to recognize the person and meet him by name for example he walks into me and I am your rep I am the airport authorities or a airport person I just say hello how are you I say him by name so that is what has been developed by Virgin Atlantica that's what they say okay another one more interesting use cases how about your belts the belts which are varying will control your credit limits so the in Blanco what it does is they have something called as a smart bike okay what with this mail if you tighten your bike that means your credit limited is reduced if you lose on your bike your credit limits is increased so this is one of the variable use case that they brought out and physics you have something to do with gesturing in terms of card readers and all okay so that's about some existing use cases which we have so generally variables with variables there is fitness also coming into picture nowadays they don't treat separately fitness kits and variable separately now they are getting combined into one space so it's very important to understand what are the various sensors that are available in variables okay the first thing everybody knows is pedometer accelerometer which we regularly use in our android code itself and we have the optical ray heart rate monitors and gyroscopes then magnetometers and the barotometer barotometers and barometers and ambient temperature sensors so all this are the ones which can go into a into into a variable device actually so they give us intelligence actually okay so that's about what can be doing so let's I think we are complete a 15 minutes time so let's start showing you a demo exact demo just give me a moment so before I show you the actual glass this is a pictorial representation of the glass so what it says it has a camera it has a CPU which is on the side it has a prism which is nothing but a display it has a speaker and it has a boat conduction headset a bone conduction headset is nothing but it directly triggers into your brain the frequency waves directly triggers into your bone and you will be able to hear it so that is what it has so this is about some features about the glass however I would like to show you the exact working of the glass like this with one of the use cases okay so this is the glass I have so what I am doing is I am screen casting I am screen casting my Google glass onto my mobile and my mobile has been displayed there so this feature is by default available in the my glass app which is a part of your play store app okay so this is completely hands-free and I will I will just operate it by voice commands and I will show you a use case here okay glass start internet banking okay glass okay glass show account balance sorry okay glass start internet banking okay glass login okay glass show account balance okay glass show last transaction okay glass log out so this is one use case which is a banking use case which can be developed on a glass so this is just a prototype but at my entry we are working on two with two customers to develop a banking application on a glass okay the other best thing use case could be on something like this I have a QR code scanner here QR code here so you can use your glass to do a QR code scanning so this can be applicable to a variety of industries name whichever you want it can be used in the airport can be originally airport it can be used in your manufacturing industries or you want to scan a barcode or a QR code this can be used very easily so I am just launching the barcode scanner so that is my barcode sorry QR code and I am able to get the scanning of the QR code done so this use case can work in any industry you want and it goes to this I tap on it and it goes it takes me to wherever the QR code points to okay that's okay thing we have a low bandwidth of internet anyhow it's just going to the YouTube URL we'll just continue okay the next use case I would like to show you is on a watch so before he sets it up any particular questions at this point of time before we show you a demo on a watch my glass was not available until about one and a half months time but now it's available yes because in eBay also they're selling it for 1.3 lakhs the device actual device is being sold for 1.3 lakhs right no glass is available on India play store also yes currently they do not have much sensors they just have a swipe sensor currently and when I talk about glasses the glasses is still in what you call as explorer program they're not even into a developer program right now they just into an explorer mode so they are just given out the devices for people to explore to identify what are the various problems that can occur in the society because of a glass and after that they may go into production phase the next thing once they take into inputs all of these see right now what I understand is with respect to glasses especially this is only particular to glasses there is a relate something related to security issue because it has only a one-time authentication at installation after that if anybody steals your device it's easy to do but you can do a remote uninstallation of your apps also so that security is also there but still there's a little bit hesitancy because Google has to come out with the right login procedures and some other authentication mechanisms in terms of glass since it's an explorer version I think it is fine as of now but when they get into a real commercial use case I think all these things have to be addressed action no not required good question he asked he's asking how is remote uninstallation possible see most of the apps on the glass are installed through your mobile phone only it's it's we who know we don't install the apps onto the glass we say I want this app and Google pushes it onto your glasses and if I say switch off the app on my on my glass Google uninstalls it for you Wi-Fi you have a Wi-Fi connectivity directly on the glass and you can have a you can pair it with your phones and it still works and the internet connectivity of the phone translates to your glass also it has a device ID it's just Bluetooth pairing there's no Wi-Fi direct at all you can pair your glass using a Bluetooth to your phone and the internet of your phone can be utilized on the glass also or your wife your glass can directly connect to a Wi-Fi network also that is also possible okay the next use case I would like to show you is about a smart watch sorry yes a glass can work as a standalone device right okay so whatever you're seeing now is a screen of this smart watch okay so we have developed a banking use case for an Indian customer and we have asked the customer permission to show this and so we are showing you this here so I just tap on the device or better is like this I would not even touch the device okay I'll just say okay Google start balance sorry again start balance so I'm just using my voice command here if the internet connectivity is fine I should this is a live balance which we are fetching for you actually yeah and this is a live balance of one of the account and this is on a smart watch and it was developed by mind tree in conjunction with ING so I can use it only through my voice commands and nothing else is required there are lot of other use cases also because of paucity of time I would stop here and we can continue with the workshop then we can if we time permits we can see them later just a moment yeah on a glass it's almost 95% accurate but a watch is little bit lacking about 75% I can say but on a glass it's very good voice recognition is very nice okay so we have we are done with this okay what was the next topic some surprise was there right okay let's see what is it and so on okay fine I have a smart watch okay I have a phone okay so what fine okay okay I have a smart watch here and my phone is connected there this is a surprise what was this so I'm generating a fake call by triggering a message from my watch to the phone there so how many of you are faced in uncomfortable situation where you thought okay I should have a call and it should run away from here right so this is the app for them so just do it like this where it just do it like this you get a fake call you can go away so you want to do a hands-on for this yes so if you just have the prerequisites and one Android phone with 4.3 we can do this use case want to try you want to do it again yes this is the app which we have built especially for droid call okay let's see what the PPT says okay I have the app the user clicks on it and there's some magic which is happening and you have the phone call this is what you saw on live so are we ready to do this shall we do a hands-on on this okay so the magic part is what we have to work so before we start off what I want to tell you is if you're just a Android developer that's enough you need not learn anything new if you're just worked on Android phones that's enough but you have some additional classes which will have to work with with variables that's it apart from that there's nothing else which is required Android developer who knows how to work with eclipse is more than sufficient to develop this app okay shall we go ahead okay so for whoever has the resources folder which was shared across to the USB there's a step-by-step instruction so I will also follow that because it'll be easier to explain more rather than typing and coding so I'll copy and paste code and I'll start explaining you more that'll be easier actually so I'm opening the eclipse fresh eclipse there's nothing in it so you can do the same I would request you guys to follow me and please do it as I'm doing because in case you go wrong it'll be easier for my teammates to help you guys if you do something different then we'll have to sit with and debug but please follow the instructions whatever we give you so that it'll be easier for us to help you out and two persons from my my colleagues one is Amit there and one is Kavya here will be assisting you during the workshop in case you're stuck somewhere okay are we good to start coding or do you want only demos shall we do some coding okay okay so there's a step-by-step guide also which we have created for you and it has been put in the resources folder so this is exactly the same steps I'll follow you for you so I'm saying open eclipse and create a new workspace create a new project and name the project as fake call mobile and create the package name as com example fake call okay so this is what I'll exactly do now so I'm right clicking on my properties saying new Android application project and I'm saying fake call mobile and I said the package name should be fake call I would like to stress something very important here is the package name is very very important when you have to work with variables when you create an app for a mobile phone okay before that I'll tell you something else I forgot to tell you guys okay so this is what we have right this is what we are trying to build now correct so what all we need to build one app on the mobile side okay point number one one app on the mobile side right and there's one app on the variable side to and this magic part three so we have to do three things totally one is a mobile application which will which will run on your mobile second will be a app for the variable and when you shake or when you click on the app you should get a communication right so that is one third portion so we have to do three three things here and we'll do the same here okay the first thing we are doing is developing the mobile application okay I was talking about the package name see when you when you have to send a message from your variable to your phone only if they are built with the same package names Google will be able to transport the messages from your variable to your phone otherwise it will not be able to do so this is a very important learning it's not documented anywhere this we are saying you by experience okay so if you want to develop apps which is consists of variables make sure that the project which you built for variable and the project which you use for your mobile app should have the same package name this is very very important okay I have it and I'm saying I'll all select 4.4 because that's the only SDK I have right now and I'll say next I'll go ahead because this is nothing new to all of us so I'm just going quickly here I'll just rename this to fake call activity and I say finish yeah please yeah yes with Android studio when you create a project you get a workspace within the project itself for the variable as well as the mobile part so if you use a studio you need not worry about the package name at all because studio takes care of itself okay so what was my next step so under the XML file under layouts have this thing make the background as 0 okay so I'll do the same thing I'll go to this particular file which is my XML file and I'll make Android colon background as 0 I'm just making it as a black nothing else the reason you'll know why shortly okay so what was there on my mobile app a fake call screen right so in the resources folder which I've given it to you there's a PNG file which we have given it to you so you can use a PNG file and set the and set the background as a PNG file here so what do I do here let's see the steps also so we are saying add full screen option will do this okay before that in the drawable folder copy the call dot PNG and add a image view to the XML file and get the image file with call dot PNG file that's what I'm doing right now so this file is there and in my resources folder I have this call dot PNG I'll just copy this from here and I'll place it one of my drawable folders fine and the next thing I said in my document was take a image view drop it here and set this are we good until here are we good no response no response is not good for me yeah that's how your fake call should be right it should not do anything should not be visible to you at all okay we'll guess continue the next step so what I've said is add a full screen option to this activity because we don't want the action bar or the some default title bar to be there so this is a code for that I'm just copying this code and this is nothing new to Android developers I'll just go into my class file and I'll just put it before set content view which is very important and you organize your imports and solve all the compilation errors and we are done correct right so have we done the application site mobile application is done okay let's see if it is done very good okay let's continue so we are saying when this fake call is activated you need a ringtone also right and we should not be giving a default we should not give some ringtone which is there in my mobile whatever has been said as a default ringtone in your system that's what we want to try right so for that this is the steps which we have written for you so we are saying declare a class variable as below so I'm just doing the same so I'm just putting this class variable here and solve your sorry solve your builders I'm just importing it and I'm going to the next step which says override the on resume and on pause to the activity and add this particular code do we understand why we are putting it into on resume and on pause since we are on all Android developers I don't think we need to tell you this so we'll just take this at but if anybody has a doubt I can clarify okay so we say override the on resume and on pause so I'm overriding on resume on pause and I'll take this code which is related to on resume and I'll put it in here organize your imports so what is basically doing here is whenever the screen becomes active pick up the default ringtone that is a part of your Android system and start playing it that is what this code is doing nothing else okay and if somebody presses a back button we should respond to it right so we should stop the ringtone also so for that we have an X piece of code which says ringtone dot stop and where should I put it on resume so we sorry on pause we all know why we should put it in on pause activity life cycle okay okay so with this are we done with the mobile side application are we done anything pending do you guys think okay we should be listening to some watch from the message from the watch right okay we'll just keep that for a moment a little more okay is it good this is fine okay so we'll continue to follow the steps here so what we'll do here is we have arrived at a logical point here a mobile app is ready at a logical point considering the point number one point number two and point number three point number one is done here right so let's go on to the point number two which we said we need to have a variable app correct okay these are the steps for developing a variable application what I've written is create a new project by name fake call where I have the same package name as a mobile app this is a very important step let's do that so I'm just minimizing this and I'll close all of these so that I'm not confused and I'll say new Android application project fake call where okay and we said we need to keep the same package name and we remember we used com example fake call so I'm using the same here very very important step this is if you're working with eclipse okay so and especially here you have to select your minimum SDK target SDK compile version SDK with Android 4.4W only because this is a app which will directly run on your smartwatch and the smartwatch is built with Android 4.4W so this especially you'll have to work with 4.4W only so I'm selecting 4.4W all the way and I'm selecting the theme as none I'll just go ahead create the activity I'll just say okay and I say finish I've just created a project with the variable okay and my next step says remove the theme in a manifest file why so there's a app theme this theme is not applicable to devices actually so there's a small bug in their SDK also so we're just removing this let's just solve that problem okay okay our sample application for or if I say a hello world application for where is ready right do we test it now is it time to test let's to see a hello world working or not that's a later we're just checking if my hello world application on a where is working or not that's what we do always right because this is our first application on a variable device right okay does everybody have smartwatches please take it out and start testing do we have no right so Google has helped us here we have a emulator so let's see how to create emulator you all know but it's only that our target will be 4.4W here there's nothing new about that so if I say Windows Android Virtual Device Manager and I create a new AVD with 4.4W2 as a emulator version right so you can create an emulator and you can start your emulators okay I'll give us give you about 30 to 45 seconds to do this job and I've already done this am I going fast yeah please very good question okay so the question is from one of our friends is you showed a banking app and we had a balance on a smartwatch suppose in case it is lost what happens okay first in the foremost question is answer is like this a smart watch is a companion app to your phone only when they are paid together and where where in the Bluetooth range they work if you go out of your Bluetooth range your smartwatch is has nothing to do it's not smart at all it's just a watch that time that is one point second point what we have done is when the user wants to access a balance he has to authorize the device first that's the first step we have created in this app so only if it has been authorized the balance will be shown into that particular app otherwise it will not be shown correct device device mobile app need not be in the login state at all but for the first time it should have just authorized this watch that's it saying this watch is applicable to be shown the balance no see just showing a balance will not affect you much right if you have some transaction and all what we are trying to do is you can have a OTP coming into picture suppose we develop this continue this developing this app and we want to have a fund transfer using a smartwatch at that time in the fund transfer is initiated what we can do is we can generate a OTP from the bank servers and which lands on the mobile and use a mobile use the OTP to type in the password and then only authorize the request that's how security can be taken care with variables okay if anybody wants to run this app which we created please go ahead and do it okay so what our friend is asking us is we have developed this fake call app you just move like this so you keep getting lot of fake calls every time because you are done this is done just for entertainment and learning you can calibrate or you can write code such that only by particular gestures or only by some particular hand movements you should be able to generate a fake call this was done just as a fun element in the droid con that answers did everybody hear that okay secret okay so we have the app ready or a hello world app ready on the variable right okay now when I tap on this app a message has to be communicated to the mobile side correct then only the mobile will be able to activate the fake screen and then it will be able to do right okay now the question is how does the mobile variable app communicate to the mobile app it's possible by only one base by Google play services Google play services is an intermediary library which communicates whatever message you want from the wearable device to a mobile device so yeah see Bluetooth you'll have to work with the hardware or you'll have to work with the pairing and everything because of that there's already predefined libraries which are given you and predefined APIs which are there for you to for your app benefit only it's been given no fake Android Google play services is a library which resides on your mobile and your wearable platform by default it doesn't require internet connectivity correct they would do all the hard hard work for us the final transfer is only to Bluetooth but all the hard work will be done by them we just have an API I am our arms I'll just use an API and I'm done why should I worry about working at the Bluetooth level okay so now we need if you want to communicate something from the wearable to the mobile I need a Google play services so to have access to the Google play services I need to import their libraries and have a handle to Google play services so that is what I'll do right now and the next step says the same thing it says we'll just ignore this for the moment we'll come back to this we'll just ignore this we say import Google play services library project and associated with the library in the where application right okay so I'm importing my Android Google Google play project I'm saying browse I'll just point to the place where I have the library it's in Google play services is here and my library project is here right this is nothing new to any of us so I'm just doing it quickly okay and I just say copy projects into workspace because referencing will become easy and I'll say finish right okay my project is imported and I said my project wearable project should have access to this so what do I do I say properties Android and added to my project again this is something new to us right now I have the library reference in my project next step create a class variable in the activity because we need to access their client so I'm taking this so I'm putting this here because this is my class variable and solve all your import problems and the next thing is we have to connect to Google play services actually before you transfer any message from the wearable to a phone you have to connect to their services and only when you are connect you can able to transfer the images actually or transfer the message so this is a small function to do a connection for me so I'll just take this copy and paste there so if you have you have the code you can do the same and solve all your compilation errors so I will say let a main activity implement collection callbacks I think I have few more errors I'll solve them still more errors and I implemented methods and all my errors are done right okay next step so we solved all the compilation errors then we are saying overwrite the start method and call the connect to play services from on start so what I'll do here is I'll say on start and I'll call this particular method from the on start okay moving on next step the next step is something very important it says declare a class variable which indicate the shared path between the mobile and the where I'll tell you what exactly is this before that I'll just quote this in your mobile phone there might be a lot of applications which is accessing Google play services right so how does the platform know from where I should transfer to whom right so what they have what Google has done is they were given as something called as a shared path you can declare it like this as a variable name and whoever has this access to this variable or who knows how to access this variable will only be able to read that message okay so we will see how we can use it further so I just declared it right now here yeah that syntax is exactly as it is you have to follow the same okay I have connected to Google play services now now my role is to send a message right so I written a small course to send a message this code is directly picked up from developer.google.com android where it's there directly in the examples the same code I'm using here actually okay so I'm using this method solve all your compilation errors and I'm done okay so what actually this is doing is since we are copying and pasting code I thought if I copy and paste I can give you more explanation that is why I'm copying and pasting code so what exactly this is doing is it is identifying what are the different nodes or the other devices which are connected to you okay then it will send messages to all of them so that's what this code is doing see currently it's only one a smart watch can connect only to one of the one of the phones but going down the line you have android auto coming into picture android TVs coming into picture so these are all external nodes for an android platform so keeping into mind that they have done this correct one device at a time so this what this code is doing is in a background thread to all the connected nodes it is just sending a message it is not doing anything else okay did we call this method it no okay where should we call this method we are saying call this method from on connected when I have access to when I try to do a Google play services dot connect I get a kind of on connected call back so that means I have access to Google play now so only in the on connect I should be able to send a message to it right so this is what we say here so I'll say send message to node I'll call it exactly from on connected so where is my on connected my on connected is here I'll just copy and paste this code which is sending my message a message can be anything it can be a string or you want to send anything it's left to you I have given it as fake call okay okay next step now we are saying if this is executes properly the message has been sent from the where from the mobile app to the mobile app that's what we say okay and when you one more important thing is when you are using a variable app this metadata tag becomes very important that's what Google says it's a predefined things sort of things so they say use this method I take this exactly this is also from the documentation from developer side this is nothing which I have done so I take this and put it in the manifest file but within the application tag this is also very important okay so we are saying we are this app uses Google play services that is what we are trying to tell by this tag nothing else okay so now this app is ready right part number 2 is ready we had 3 parts on connected we'll get when you when you resolved all your errors when you resolved all your compilation errors on connected came out automatically shared path is just a variable but when I do a connection callbacks okay in the code where I am sending my message when I am sending my message to all the nodes which are connected to me that is where I use the shared path okay next step we say run the app and it should be working fine now we'll do it later okay part number 1 was done part number 2 was done what was pending now the magic portion right where we said you should be listening the mobile app should be listening for the message that is being sent okay now how can the mobile app get the message should it be connected to Google play services again yes right okay and none of the app will be in the active state right so what should I do should I use a service should I make a service and make it do this right should I do that okay for this what Android has done with respect to this they have created a new service which is called as wearable business service okay so it's a built-in functionality but it's exactly a service but it is somewhat it is compatible with your wearable things so they have something already a class which is called as wearable business service and we'll use that yes it's a it's it's from the play Google play services actually right it's a Android service so Android takes care of the performance I am not bothered if I write my service I should be bothered it's an Android service because I'm extending their class they take care of that okay so we are going back to mobile application now so this is again the steps for mobile application I'll just close all these so that we are not confused we said we need access to Google play services here also right so this is the step I'm saying create a Google play reference to the mobile application also and create a new class called fake call service so first step I'll do is even for the mobile application I will create a reference as Google play as a reference and I'll add this and the second step that was mentioned in the document was create a new class which is called as fake call service and finish this and the next step we have it says have the class extend wearable business service so there's a service that is coming by default and we are using this so I'll do the same I'll say extends wearable business service fine next step again we have to have access to Google play right this is nothing new so from the mobile application also I need to have access to Google play so I'll just follow the same step which we did earlier so I will overwrite the on create method okay then the next step will be have this variable declared to access the Google play services solve all your compilation errors and write this function it's the same function to connect to Google play services I'm doing this fast because we have already done this earlier and solve all your compilation errors okay I solved all of them do I have more yes and I'll say do add unimplemented methods and I'm done okay and the next step says solve all your compilation use which are done then it says connect to play services should be called from on create yes I'm doing it okay the next steps talks about having the shared variable so the wearable sent a message through a shared variable right so if I have to access it also it's good to access through only that variable I should not be listening to for any other variable so we'll use the same path name to get that variable actually you will see how we'll use it so I'll declare this here and my next step is this this is again very important so what happens is whenever a message has to be delivered from a variable lab to a mobile app there's a callback function which is there as a part of your variable business service which is called on message receive so if you implement this call back in your class then if you have a message it will be delivered to this particular function so I'm just overriding the on message received here okay I overwrite this method then this is the function which I want to do what I want to do on receiving the message if I receive a message from a variable device what should I do I should activate my app right I should activate the fake call app so that is what this code is doing and solve all your compilation errors right I'm just activating that fake call app nothing else I receive a message from a variable a callback will be called to me and what I do in that callback is just instantiate the activity nothing else I do right any questions it's left to you it's a design issue which you are talking right now you're asking me a design issue it's left to you how do you want to transfer data from your variable to your thing you want to have the same variable and have a identifier and then do it or because you know the sequence in which you will send on from the variable to the mobile we can follow the same sequence on your phone also otherwise if you think I need different different variables it's left to you okay and the next step is we have added a new service so add the service into your manifest file very very important and there's one more important thing in this I'll talk about it in a while okay I've just added the service and in my intent filter you can see something called as a bind listener so this answers your question of asking why will the service be running always so what exactly this is doing is only when you watch and a phone are paired this service will be active otherwise it will not be active so whenever there's a pairing between a phone as well as a variable there's a broadcast that is being sent to the Android system that is a broadcast com google android gms variable bind listener and since it's a broadcast this intent filter understands that broadcast and then the service becomes active and you disconnect your service is also one you disconnect meaning if you unpair your watch from the mobile device then this service also doesn't do anything else it will get killed by itself so only when your phone and the wearable device have been paired this service will become active okay and the next step we are saying if you are using google play services you should have this in your manifest file and I'm doing the same done okay now our app is completely ready you can test it out and it should work straight up okay and the next part of the code what we have written is most of the time your mobile device will be in the inactive state and the screen will not be on right so and when a message is received from a wearable device you should activate your screen also so this is the code which helps you do that so that is what we are adding at the end so we are saying at the following code in the on-resume of the mobile app this is required to wake up the device in case the screen is off so if I take this code and put it in my mobile app mobile app in the fake call activity in my on-resume and solve all my compilation errors and put it for window so now your entire app is ready your mobile will be in this state most of the time right your mobile will be in this time this state most of the time right this is the state it will be there so when the variable you do it like this and you send a message if this is not active it's not a call which is coming in right it's a fake call which we are generating only when you have an incoming call then the processor boots then the processor gets takes the power then the your CPU lights up and everything happens fake if a call activity has to be invoked you have to unlock your screen and then do it then your activity will run but if you want by default to happen you have to keep the screens on so only when you receive a message activate the screen by using this code and then your fake call comes up by default okay and you test this I'll just show you again okay so this is the state of my screen right if I didn't add that window related code if I do this I'll not get this at all we have a they put the build okay it's not bad this is not bad I'll repair it and we can do it how this is with a device I'm doing and one more thing we are not doing this portion in the activity because yeah now it's fine right this is your orientation handling that's it nothing else if you do this it's a orientation change you need to keep listening to your orientation in your mobile or in your mobile phone sorry on the variable you should keep listening to the orientation changes and in case there some orientation changes you then send a message that's what I've done but currently in what we have done is just on the click of the app it goes but you have to build in this feature you have to use the orientation thing orientation I'm sure most of us would work on and we can do it as an exercise for you okay okay so that's it from my side which I had to show you a hands-on demo with some demo on use cases now I'm open for questions okay now I'll tell you this if you don't use the shared path where exactly did I use the shared path we'll see where did the shared path get used if a message has been delivered to to the call back okay and I'm checking in my code if it is my shared path only then I need to activate so what what does this mean is irrespective of whether whosoever message it is all the messages which are broadcasted in the system will land into on message received so you have to filter it out and do it for your action that is why this is there same shared path is the same that's the same variable name see this is a string variable name which we have see here that's just just that message it was not required at all nothing required this is the only important thing if you have a shared path that's more than enough which one okay when you have to communicate from a variable to your thing it's like having a shared memory across these two devices so let's consider this as a shared memory this is a shared memory between your devices in terms of Google play services no that was just a message passing mechanism since you're a fake call see it might be a fake call here I would write another function and name it as send SMS so then in my code when I receive a message I can check if it is a fake call get the fake call screen otherwise if it is a send message send SMS so I could use that variable there okay I'll put it again this shared path is for the Android platform to share messages between you both that message which we are given fake underscore call was a message from your application from your where application to your mobile application to differentiate the use cases sorry correct you can have several such messages you can say send message to device using fake call one more can be sent you a message using call SMS then in your function you can decide what you have to do based on these two functions any question yeah currently I think it's about there's no limit yeah so you have the answer sorry you want to communicate between two variable apps yes yes any number of variable apps can be communicated no he's saying apps he's talking of apps he's saying if in a variable device I have two apps can the two apps communicate to a mobile phone yes possible that is why the shared path is there the shared path helps you there no it's a shared path like this you need to send a message it's not intent call correct it's like a global namespace in Google Play services to have access from the variable side as well as the mobile side it will not be transmitting your messages no see it's like internally it is ideal your package let's think your package name as your process if both of them are running in your same process you'll be able to transmit or exchange data between each other if your package names are different on the mobile side and the variable side they are two different processes and we have a Linux sandboxing here so these cannot exchange the messages that is why we are saying if you're developing the variable applications and a mobile application have the same package exposed meaning it see this is a shared path variable name which we are telling Google Play services to resolve to us no that's not possible I think there's a blob also you can do there's a blob messages also you can send across variables from variables to mobile phones so you take pictures and you can transfer everything perfect correct package name guarantees that this process which is sending and the receiving it be the same which we're running in the same process on and only they'll be able to share data between each other the if statement which we are mentioned in on receive is to differentiate between the various use cases which you want to develop you have to give a variable to a shared path right you're saying to Google Play services telling that this is my shared path variable name you reserve space for it and you have to refer to that variable path right okay you say in to see is equal to 10 why not in take int is equal to 10 you need a variable name to reference 10 right so that is what this is it's a variable name to access your shared location we can we can we can talk to you again okay any other further questions that's what I said we didn't do the gesture in this particular tutorial if you want to do a gesture you just have to listen for orientations on your variables and you'll have to write code for that which will take a long time again for us now that's why I'm not doing it we'll have to leave by 345 right so again yes yeah we can test with our emulators also actually so this is there's a procedure to test the emulator and rather than me showing you I'll show you a developer documentation so this is your steps to do working at the emulator and a mobile phone these are your steps start your emulator then in your command prompt execute that adb forward and on your mobile phone you should have a android where app and you should have you should say connect with emulator and both the emulator and the mobile phone will be connected so these are the exact steps for that so I'm referring to the developer documentation itself so that you can always go and refer this anytime any other questions any other questions okay thanks thanks for being nice audience and hope I you guys enjoy this session thank you