Android Accelerometer Tutorial 2: Live Accelerometer Data in TextView

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
Helga's welcome back we new tutorial in this tutorial we will take a head our previous tutorial so in that tutorial we have tested our accelerometer and we have lost those value into android monitor now we are going to add a text view into our XML files so that text be you can add into the resource layout files you can come into an source folder and then the layout folder into the activity mean now let me explain you think so let's read we get rid of this Android monitor and you can get here a preview and you may get like this preview so if you press here the so designs which will just come here and if it is not coming you can just leave it all right so you can go with the design also and you can drag in the drop text me or you can directly go with the text me but personally I would like to go with the directly text version so first of all that lets get rid of this text me okay and also we need to be here linear layout so linear layout if you give linear layout that upper end it will automatically change here the next one right fine now this is the linear layout and in this linear layout we need accelerometer data into here our screen so I think let's go the linear layout and let's put it it's orientation linear layout orientation a vertical orientation right so we increase an edge what perfect okay so now let us give it next week so come with the text view so the first text way let's wrap the content okay and here read content okay I think for the waves we can go for math content math I'm sorry we can go for the mascara and then type content okay and after that what make it work we need to also we can live some fighting we have so at the parent let's keep adding our 4:30 SP perfect we have the Perry the 30 SP and now after this you need to get the ID this next week so let's give the ID to the touch screen so this will be ideal for expected ok now let's add another text field so then another text we must match parent I want content wet and let's give the ID for expect with this is why below let's at the end of the text week so let's is the width on the crappy content to be high and then let's get the ID to this one that's done so it check perfect ok so the orientation is your vertical linear layout it's linear layout so I think how we can also give me there balloony out so I think so let's put it on let me check so it's an orientation default it would enter okay so so what we need to do here our orientation we need to make the vertical orientation that's what I am trying to make but unfortunately we are not able to make that vertical orientation yeses now it's right the vertical I think earlier I may have written it there mrs. field okay so now let's give some margin okay from the top so we can give me the margins they are margin top yourselves the Tuck ESP and for this one we can also give some margin talk lives for ESP perfect now we have bought of XY and Z plane and now we need to come here the main activity and let's initialize those steps to live here okay so we need to come here a text wheel the first one is x value is equal to four x value and the y value and then check right here right now let's initially this text get here so we can reverse text me so by calling x value is equal to-- next we find we've y ID r dot IP dot X now we are getting the XYZ differences from XML file now Y value is equal to a text week and then find V by our IP that all of our V dot I detour why right now and then you need share value equal to actually find we are not a lead or generate perfect okay so X why did we have got only the defenses for XYZ and finally here we can set by Lu to those XY jet right so what we can do we can do x value dot set text okay so we can do over here x value oops thanks value since that event dot ready Geo okay so we have got x value here and I'm going to copy and paste it here to you know the expedited typing things okay now XY and jet now we need to put it to so we hear God almost everything let's test it with my mobile so I'm gonna test it so I'm gonna test it great so let's run it Oh somehow I by mistake I remove my mobile phone okay click on OK and let's again know build it okay so if you taste it here into web Explorer so you can see my mobile phone is showing something here it's serving but only the GW somehow there is a problem with the layout let me see what is the problem with the lair so if you encounter if you are ever encounter a problem like this Oh keep it your all waves are just don't know going one above another what you can do you can change your layout from here so let's make it a little bit out I can make it really easy here relative layout and and then what I can do I can put it to below of I D of X value right and then I can put it a be know of idea why better all right so now you save it and don't take this particle is remove it unless fill it okay I'm see here Nova okay let me open it wait for it it's installing apk it's installing apk now it still only the Jade value is coming something is wrong something is wrong let me see further I think the wait I read everything is fine here so I'm gonna stop this video and I'll check it offline then I'll come back to you oh I have my card the problem I made a baby in the silly mistake he I am sitting only my x value I did not sit and worry and the children so I need to sit here the Y value as well as the generator okay Lisa V oh my god um I did sometimes you know the blenders so let's check it now installing the applications let me open my eyes Oh perfect now you can see I'm perfectly getting my X Y and Jade bio right so let me move it so so it's almost everything me changing and in the meantime you can see these values into the also your you know Android monitor so here you are having it to option right so you can see a value in the Hawaiian and if you want to diversify that if something went wrong you can also get what went wrong you go and drive ah layout all rights on Android monitor and one motif in the last I would like to give you suppose that if you want to change this hair color you can do it pretty easily you can come into divide oh man every color right so there is a primary color and the primary dark colors you can change it will be easily I would love to make it you know something like this color that still is one awesome okay now let's check it see the color has been changed and if I applaud this to move Arion and then let's check it into the visor will open open installing the application okay just wait for few yeah see the color has been changed very easy that's all for this tutorial into the next tutorial I'll be taking few more sensors such as pressure sensors life and the magnetometer all those things into the next career and also I will be serving to thank you into our mobile is screen so thanks for watching this tutorial and is to tuned for more you can subscribe this channel so that you can directly get update into your in buh-bye have a nice day
Info
Channel: KGP Talkie
Views: 34,129
Rating: undefined out of 5
Keywords: android accelerometer code example, android accelerometer tutorial pdf, android programming tutorial accelerometer, android accelerometer programming, android accelerometer calibration code, android accelerometer graph code, android accelerometer gyroscope tutorial, android accelerometer graph tutorial, android accelerometer sample code, android accelerometer source code, android studio show sensor data, accelerometer, android, raw data test android, 2 accelerometer
Id: Rda_5s4rObQ
Channel Id: undefined
Length: 13min 33sec (813 seconds)
Published: Mon Aug 28 2017
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.