what's going on everybody and welcome to
a very much waited tutorial and that is
packaging your TV application for
Android so obviously this is just a
really basic example and this is only
one example and there's like lots of
little stuff that's gonna get in your
way as you try to package things anytime
you're trying to convert something to an
executable or package it for a different
operating system you're gonna have
problems okay so I'm gonna show you at
least one example of us getting through
everything and hopefully show you how
you can sort of debug things along the
way but you're probably gonna have a
hard time I'm just letting you know when
you try to make your own application and
you just have to slowly debug through
the process but just know there is light
at the end of the tunnel the tunnel
might be long though so getting started
here let's see so the first thing you
need to do is for home on Linux I'm on
Ubuntu 1804 you have to be on Linux to
package this for Android you could use
like a virtual machine I think probably
on Windows I don't know anyway I just
wanted to eliminate all the variables
that I could so I'm using my laptop that
has a bhutesu on it
so the next thing is so first you have
to install key v on Linux okay so if you
go to kiva.org
and then just go to / hashtag download
and then come down to Linux install for
Linux just do whatever Linux operating
system you have so apparently it's gonna
take 20 years to go I think it's because
I'm recording OBS on here hopefully the
recording isn't terrible anyway I guess
I'll wait ten years for that to go so
the next thing is like once you're once
you've got things installed on Linux
which should be pretty basic like
there's really no hang-up that I had you
just simply add you just add this
repository yeah then you do an update
and then install key V I can't remember
if billdozer is using upsets for OBS I
can't remember if billdozer is using
Python two or three but just for the
record this machine has Python 2.7 point
five and then also for Python three it's
36.7 both of those just come with a boon
to 1804 so if you have a fresh install
it should be good at least I believe
they do
I might have installed two seven I can't
remember I don't think so though anyway
carrying on so go ahead and do those
things get keavy on the machine and
you're good to go now the next thing is
if you do a search for packaging TV
Android you should find yourself on a
page probably not like this but instead
you'll find a page like this and then
we're gonna go with the billdozer option
I'll try to put links to all this stuff
in the description if I forget someone
to remind me I'll do it
but yeah cool so we get here and you can
either get billdozer this way you can
also just do a pip install for billdozer
so if you come over here you can just
maybe you know pip three install
billdozer
or pip either one would be fine probably
it should say I already have Excel ready
done it on this machine will appear own
okay okay so now you've got billdozer
but then billdozer has like a bunch of
dependencies so here you'll see there's
a little link here that says hey install
build dozers dependencies so I open that
in a new tab and yeah so here they say
just pip install upgrade billdozer
fine then they have the this list of
things either if you're on 1804 Ubuntu
or 1604 a boon to do these four commands
that's great but it's actually not just
those four things I was having issues
and I guess it's on my desktop probably
let me pull up a notes file this over
this is our Obi whoops just minimize
this so hard I'm on a trackpad right now
it's really painful
open this up so whenever I after I did
all the things that they said to do and
then the billdozer in it which I'll show
you guys in a second I got these errors
and basically the main crux of this
error is basically this the auto recon
thought found this thing here so then I
was just kind of poking around and I saw
these are also some dependencies to
build dozer so suitor sudo apt-get
install auto make auto Kampf in Lib Ltd
l - dev so install those as well so once
you have those then you're ready to at
least build the application so the way
that that works is let's go to a key V
convert tutorial that's great I'm happy
that it's ready we'll open in terminal
and let me just make it
oops let me see thank you there we go so
the first thing that you would do is do
an init but also since in the tutorial
series I didn't call this like a main
dot PI that's gonna be a problem down
the line so go ahead and rename your
actual key V file main dot PI main dot
pi that was another issue I ran into
that I don't think was said anywhere and
I just had to figure that one out so
then billdozer in your you know
directory that you're in billdozer - -
in it or is it maybe no - - billdozer in
it don't make me go back to the docks
okay cool so now you've got that spec
file and there's lots of things in the
spec file you might want to take a peek
see at the spec file one thing we'll
talk about real quick is somewhere in
here there's a thing about internet I
can't find it so I'm just going to do a
ctrl F for Internet yeah
so for permissions right now the
permission to use the Internet is
comments it out we actually need that
because we want to use sockets and
communicate over the Internet
so I'm gonna uncomment that out and go
ahead and save that
that was one of the things that was
killing us the Apple is just crashing
immediately and it was dang near
impossible for us to figure out how the
heck do we debug this and so I'm gonna
I'm gonna post in the text-based version
of this tutorial how we actually debug
to the app because it just crashes
there's no console on your phone and so
it was a pain in the butt so thanks to
Daniel for figuring out a good way to
debug and yeah so I share that with you
guys so anyway that was the issue it
didn't have the rights it got like a
permission denied basically to access
the Internet so yeah fun now once you've
got that in it and you change other
things you can change like your apps
name and stuff like when I move this to
the phone it's just gonna be called like
Mikey V app or something stupid but
that's okay we just want it on our phone
for now and we can worry about
customizing and all that stuff later so
once you run the build those are init
command the next thing you're gonna run
is like if I go over to this yeah it
says after you've run that in it you can
run this like build the bug whatever run
and I might get away with running that
right now but it turns out that that
didn't work for me the first time and
I'm pretty sure won't work for any of
you guys the first time I gotta check my
notes to figure out where I put this
flag but anyway this was just hanging at
a certain spot for me when I went and
ran this this command here and I didn't
know why it was hanging it just was and
so I started looking around trying to
figure out well how do i do bug this
because again just like the app crashing
on my phone it's like impossible to
debug it because you're not getting any
errors so then someone mention there's a
verbose flag and so I ran that so I
could see the error and rather than air
it sacked it was actually a like an
agreement you have to agree to so I
probably won't get it anymore but I'll
just go ahead and build those or - be
here just to see if I get it but I've
already accepted it once so I'm not
really sure I'm gonna have to get it
again Oh before we run this command go
ahead and connect your Android device to
the machine
let me just plug mine in real quick cool
so okay cool so billdozer - V Android
debug deploy run so let's go ahead and
run that and yeah it looks like I want
to say I'm just gonna move this up if I
can yeah I'm pretty sure I'm trying to
think at which blue thing see we're
seeing like all these great X because of
the verbose flag it might have been like
it might have been here that I was
hanging or something I honestly can't
remember probably though cuz this is
like another agreement thing they
probably initially I had to say yes to
anyway make sure you use that verbose
flag the first time because you'll
probably run into that same issue I had
so then this will take a while um on
your phone you might get something like
you know do you want to allow access to
the data I'm gonna say yeah that that
may or may not be necessary I'm pretty
sure it will because that's like how
your phone will become visible to the
machine but anyway just watch out for
those notifications and then this goes
on for quite awhile after you've run
this one time if you make an edit to
your file you can run this step actually
really quickly I don't know why the
first time it takes so long but then you
can edit it really quickly but just know
you don't have to go through this
process like if you just change a few
lines of code in your Python file you
don't have to do this for like 20
minutes
so I think what I'm going to do is just
kind of pause for now and then once this
is done I'll pick back up and then you
guys can do the same because your
computer might do this quicker whatever
alright and finally after it has been a
long time it's done you can see it's
says it's the application has started
and sure enough it is already running on
my phone and now you can put in an IP
port and username obviously you can't do
localhost anymore because we're not
running the server on our phone so you
can run the server maybe on your line
you're like machine or something like
that and then rather than one 27001 run
it on port or run it on IP 0.0.0.0 and
then connect to your local IP do like
ifconfig or something like that figure
out what your IP address is connect to
that and yeah cool so let me just test
that real quick fill up my username hit
join and and awesome that works so
pretty cool hopefully it worked for you
guys probably the hardest thing will be
now you just need to make sure you're
running that server locally and then
connect to it but otherwise the app
should definitely be working on your
phone now at least this one now as you
continue trying to work with more just
different types of apps doing different
things running different python
libraries all kinds of stuff can start
going wrong so definitely check out the
text-based version of this tutorial I'll
put the link in the description as we
hear of issues from other people I'll
just continue to kind of append to that
page over time so hopefully we can help
you guys out if you have any questions
comments concerns whatever if we leave
those below also if you want help you
can join the discord discord dot GG
slash Centex otherwise that's it
so get to creating some cool TV apps on
your phone I've received many requests
for like OpenCV and maybe even like
tensorflow or tensorflow light object
detection or something with TV so I'll
definitely be looking into that maybe
we'll add a couple more videos with that
in mind but otherwise that's it check
out the key V API Docs and start making
some stuff check out the examples and
all that and otherwise I will see you
guys in another tutorial