Office Hours — Today, September 17

Tuesday, September 15

Mark M.
has entered the room
Mark M.
turned on guest access
Sep 17
8:15 PM
EGHDK
has entered the room
Mark M.
hello, EGHDK!
how can I help you today?
EGHDK
Hey Mark, I've got just 2 questions today. First, I want my app to have a record video button, but it will take you to an app chooser for taking the video. Do you know if I'm guaranteed any kind of format or formats? I want to make sure the format I get is playable on ios.
Mark M.
well, if you are using ACTION_VIDEO_CAPTURE, you will provide a path to where you want the video to be stored in EXTRA_OUTPUT
in theory, apps would pay attention to that
in practice, some will, some won't
only rely upon third-party camera apps if "not working" is an acceptable outcome, because the picture/video is not essential
EGHDK
Not really asking about path. More video format or codec or whatever.
Mark M.
I understand that
the only way you can convey any information about what you want is via a file extension on the filename in the path that you supply
that is it
there is nothing else
8:20 PM
EGHDK
So you mentioned path... Do you mean file name and extension also
Mark M.
yes
EGHDK
Oh. Okay. Cool
Mark M.
as to whether you'll get something iOS-compatible, probably, but there are no guarantees
OTOH, assuming you'll be uploading the video to a server, you can always transcode the video up there if need be
EGHDK
So technically they can give back any format. Most likely one of the Android supported format, but they can do whatever they want?
Mark M.
absolutely
those apps are written by programmers, and programmers can do whatever they want
EGHDK
Okay that makes sense to me. Thanks
Mark M.
you mentioned two questions -- do you have another question?
EGHDK
Last question of the night. I created a library with a class named Awesome. I used this library in my app, and then in my app I made a class named Awesome. Can ya guess what happened when I tried to compile the app?
8:25 PM
Mark M.
it should have been fine, assuming they were in separate Java packages
though you always run the risk of importing the wrong one
EGHDK
Hahah. I got some dex error. I couldn't believe it though. II thought that's what package names were for.
Mark M.
Java package names, yes
so if the library has com.eghdk.library.Awesome, and the app has com.eghdk.app.Awesome, those would not conflict
EGHDK
See... They were different package names though.
Mark M.
then there should not be an error from that
are you sure you didn't accidentally add the library twice as a dependency or something?
EGHDK
And I still got a dex error. Damnit. I thought that should be the case. I changed the name of the class and it worked.
Mark M.
off the cuff, I cannot explain that
EGHDK
Maybe I'll try again. Maybe it's an issue with what I called the library package in my build. Gradle but the file maybe had the same package name declared in the class? It's a possibility I guess. Don't have code in front of me. On a train =(
Hmm. Well you confirmed that you should be able to have two classes named the same. Which is good. Because that's what I thought the case was.
Mark M.
the package name/application ID from a Gradle standpoint won't have an impact here, for classes that you create yourself
so long as they are in separate Java packages, there should be no problem
heck, Android has this itself (e.g., two classes named Process)
EGHDK
So I need to change it in the class file?
Mark M.
in the Java code, and where the file is located
EGHDK
Okay cool. That's what I thought. Perfect.
8:30 PM
EGHDK
Anything else for today... I think not. Besides gcm 3.0. Did you do anything in your book recently in that section?
Mark M.
nope
EGHDK
Thanks for answering my questions as always. Have a good one!
Mark M.
you too! tell the train I said "hi!" :-)
EGHDK
has left the room
Mark M.
turned off guest access

Tuesday, September 15

 

Office Hours

People in this transcript

  • EGHDK
  • Mark Murphy