Mark M. | has entered the room |
Mark M. | turned on guest access |
Steve S. | has entered the room |
Joshua C. | has entered the room |
Mark M. |
hello, Steve!
|
Steve S. |
Hi Mark, how are you!
|
Mark M. |
and, hello, Joshua!
|
Joshua C. |
Hello Mark, and hello Steve. :)
|
Steve S. |
Hi Joshua!
|
Mark M. |
Steve: you got in *just* ahead of Joshua, so you are first up -- how can I help you today?
|
Steve S. |
I have a question about logging remote data. I'll paste it in.
|
Steve S. |
View paste
|
Mark M. |
um, well, I suppose that's a question of what your end goal is
|
Mark M. |
if your goal is just to be able to putter through some entries, what you describe may work
|
Mark M. |
bearing in mind that I haven't used Crashlytics
|
May 12 | 7:30 PM |
Steve S. |
Ok. That might be adequate. Have you used Timber?
|
Mark M. |
if your goal is to actually do something with the data, scraping it out of Crashlytics would seem like it would be a pain
|
Mark M. |
I have used a logging wrapper; I forget if it is Timber or something else
|
Steve S. |
That's true. However, for now we're looking to do something fast that could be implemented in a non-invasive way.
|
Steve S. |
Ok. Are there other logging wrappers we should look at?
|
Mark M. |
there's a whole category of 'em out on the Android Arsenal
|
Mark M. |
I am using co.trikita:log
|
Steve S. |
Great. I'll check it out.
|
Mark M. |
but, for unstructured log-like data that you just want to eyeball, your approach is reasonable
|
Steve S. |
We do want analyze the data, so what you said about the difficulty of getting the data out of Crashlytics could be an issue.
|
Mark M. |
right
|
Steve S. |
Ok. We do want to do more than eyeball it -- we'd like to get it in e.g. Excel.
|
Steve S. |
Are there approaches you're aware of that would facilitate doing that?
|
Mark M. |
then, it's a question of whether you can shoehorn your needs into some sort of analytics API, or whether you should just make Web service calls of your own server
|
Mark M. |
well, I'm a control freak, so I'd write the code to send the data to my server
|
Mark M. |
I'm not a huge fan of handing data over to third parties any more than is absolutely necessary
|
Steve S. |
Right. That goes back to the other thing I said: for now, the priority is do something that we can get up and running very quickly.
|
Steve S. |
We will be analyzing it ourselves.
|
Mark M. |
well, you can't have everything :-)
|
May 12 | 7:35 PM |
Steve S. |
Ok. Based on what you've said so far, it sounds like there are two choices: use Crashlytics/Timber to do something quickly that won't have the optimum format, or do something more involved that would give us the appropriate format.
|
Mark M. |
I'm sure that there are other options, but those are the two big ones
|
Mark M. |
let me take a question from Joshua, and I'll be back with you in a bit
|
Steve S. |
Great. You've pretty much answered my question then. I'll let you get on to Joshua. Thank you so much!
|
Mark M. |
Joshua: your turn! do you have a question?
|
Joshua C. |
Yes, though at this point... it's more of a problem that has me stumped than it is a question...
|
Joshua C. |
Here'
|
Joshua C. |
Here's what I've got... I've got a custom ViewGroup (a layout)...
|
Joshua C. |
Which is called "OneHandLayout"...
|
Joshua C. |
and inside that, I have another ViewGroup... and I am trying to access my custom attributes from inside the class and it just isn't working.
|
Mark M. |
this doesn't really give me much to go on
|
Joshua C. |
Yes, code coming right up...
|
Joshua C. |
Am straddling two computers and need to open this window in the other one to paste...
|
May 12 | 7:40 PM |
Mark M. |
you could post the code on the other computer to a GitHub gist, or a pastebin, or something, then put the link in here
|
Mark M. |
or, perhaps, just explain a bit more what "just isn't working" means in this context
|
Joshua C. |
Yes...
|
Joshua C. | has left the room |
Joshua C. | has entered the room |
Joshua C. |
Okay, better. Now I am on a single machine...
|
Joshua C. |
So, I have the attributes defined as an enum....
|
Joshua C. |
View paste
|
Joshua C. |
in the values/attrs.xml file
|
Joshua C. |
View paste
|
Joshua C. | |
Joshua C. |
app:handed="left"
|
Joshua C. |
Which it seems to like... and then in my class, I try to simply access this data in the constructor.
|
Joshua C. |
View paste
|
May 12 | 7:45 PM |
Joshua C. |
And yet the only value I ever get is the one that I understood as the default value if there wasn't one, that 0 in the last paste....
|
Joshua C. |
I think I must be doing someone wrong in the constructor trying to access the attributes...
|
Joshua C. |
I can step through this in the debugger... and I should get the value 1 for handed... but I don't.
|
Mark M. |
um, off the cuff, this seems OK
|
Joshua C. |
Right, well, the other way.
|
Mark M. |
have you tried calling hasValue(R.styleable.OneHandLayout_handed) to see what it returns?
|
Mark M. |
(called on the TypedArray)
|
Joshua C. |
Ooh, good question... trying now....
|
Joshua C. |
I'm also trying to do the SAME thing with another LayoutView subclass, called Edge, which is nested inside of the OneHandLayout.
|
Joshua C. |
I change the xml to app:handed="right" and I still get that same 0 value!
|
Mark M. |
personally, I haven't used an enum custom attribute
|
Mark M. |
but I thought those just turned into integers
|
Joshua C. |
Yes, exactly... they should just turn into an int... which I am trying to extract as such...
|
Joshua C. |
What do I call the hasValue on?
|
Mark M. |
the TypedArray
|
Joshua C. |
the TypedArray I've extracted?
|
Mark M. |
yes
|
May 12 | 7:50 PM |
Joshua C. |
View paste
|
Joshua C. |
I'm getting false.
|
Joshua C. |
So the value isn't reaching the TypedArray.
|
Mark M. |
either that, or it's not liking R.styleable.OneHandLayout_handed for some reason
|
Mark M. |
I haven't inspected the innards of a TypedArray in ages, but if the debugger lets you, you might try poking around in there and see if you can find a sign of your value
|
Joshua C. |
Well, it likes it enough to autocomplete it in Android Studio...
|
Mark M. |
you might temporarily change the integers from 0/1 to 666/1337 or something
|
Mark M. |
to make it easier to see
|
Joshua C. |
I did.
|
Joshua C. |
I searched and searched and that value doesn't appear to be in there anywhere.
|
Mark M. |
OK, that implies that somewhere in the layout inflation process things are going awry
|
Mark M. |
you do have the app namespace set to the .../res-auto URL, right?
|
Mark M. |
let me swing back to Steve for a bit, and I'll return to you shortly
|
Mark M. |
Steve: back to you! do you have another question?
|
Steve S. |
There's nothing further unless you've thought of other fast, non-invasive approaches to remote logging.
|
May 12 | 7:55 PM |
Mark M. |
well, I did offer up a third avenue, though it might be the same as what you were thinking: analytics
|
Mark M. |
Timber to me means "logging"
|
Joshua C. |
View paste
|
Mark M. |
analytics APIs can be a bit more fine grained, with counts and such
|
Mark M. |
(Joshua: that's the wrong xmlns:app, I think)
|
Steve S. |
Right, but we're doing that ourselves. I think we've covered it then. I'll let you get back to Joshua. Thank you, and have a good evening!
|
Mark M. |
Steve: OK
|
Mark M. |
Joshua: back to you!
|
Steve S. | has left the room |
Mark M. |
try changing your xmlns:app to be xmlns:app="http://schemas.android.com/apk/res-auto"
|
Joshua C. |
Great... well, that would be a nice easy place for the problem to be. :)
|
Joshua C. |
Okay, rerunning... I had it like that earlier, and then changed it trying to get things working... we'll see in a sec. :)
|
Joshua C. |
AHA!
|
Joshua C. |
That did it.
|
Mark M. |
the form you had been using was replaced a few years ago
|
Joshua C. |
Fantastic.
|
Joshua C. |
Very good! Well, that had been driving me crazy... and that's just the EASY part of what I'm trying to write.
|
May 12 | 8:00 PM |
Joshua C. |
So, now that we've got the easy one out of the way, I'm struggling with something else...
|
Mark M. |
yeah, creating the cephalopod interface, supporting up to 8 hands, could get icky :-)
|
Joshua C. |
grin
|
Joshua C. |
Well, now that I've got the basic structure in place... I have another ViewGroup I'm trying to create... so the keyboard itself (that I'm still trying to write) will have keys along each edge of the screen (So, OneHandLayout contains 4 Edge objects), and then will also have a Curve.
|
Joshua C. |
Now, it seems that Views can really only be defined as a rectangle... and I want to make views that are curved... so my plan was to do the work in the ViewGroup (Curve) and figure out the curve... and then the View object (a Key, inherited from View) needs to populate along the curve.
|
Joshua C. | |
Joshua C. | |
Joshua C. |
So to start I was just trying to define the curve and draw it... though that's not exactly my end game... at this point, I'm interested in your thoughts on the best way to accomplish a layout like this... though I want to do as much of the actual layout in XML as possible, since I'll want to fiddle with it a lot to get the layout right.
|
Joshua C. |
Ideally I want the keys to actually be SHAPED with rounded tops and bottoms, kinda like as shows (but perhaps more curved).
|
May 12 | 8:05 PM |
Mark M. |
well, as I think I have tried to point out in previous chats, this is well outside the scope of my custom view work
|
Mark M. |
in the end, your statement that "Views can really only be defined as a rectangle" is somewhat off-kilter
|
Mark M. |
a View *has* a rectangle
|
Mark M. |
what it does in that rectangle is up to the View
|
Mark M. |
it needs to render pixels, and it needs to support touch events
|
Mark M. |
so your curved buttons are merely rectangular views that happen to render and respect touch input in a curved area of their rectangles
|
Joshua C. |
Ah, good point... so I'm looking at how to render shapes... have you worked with these classes like Shape, Path, etc?
|
Mark M. |
I know of them
|
Mark M. |
I have not used them
|
Joshua C. |
I found this post...
|
Joshua C. | |
Mark M. |
as that's lower-level than I usually get in the View system
|
Joshua C. |
Which seems very relevant to what I'm trying to do.
|
Mark M. |
possibly, if your curves are definable as arcs
|
Joshua C. |
Right... and then there's this more generic Path class.
|
Mark M. |
is this only for a single piece of hardware, or is this supposed to be for arbitrary Android devices?
|
Joshua C. |
I'd like it to run on various newish android devices.
|
Joshua C. | |
Joshua C. |
seems to be there from the beginning.
|
Joshua C. |
API level 1
|
Mark M. |
that's not what I'm worried about
|
Mark M. |
different screen sizes would need to be taken into account in your setup
|
May 12 | 8:10 PM |
Mark M. |
you might need somewhat different "patterns", if you will, for different screen aspect ratios
|
Joshua C. |
Oh yes... and in fact I'll have different configurations for bigger tablets compared to smaller screens like phones.
|
Mark M. |
(and, of course, Android N multi-window is going to make your work that much harder)
|
Joshua C. |
I'm quite aware of that need... right now I'm just trying to get to know the tools I'm going to use... which means low level drawing.
|
Joshua C. |
I haven't heard of "N multi-window"
|
Mark M. |
Android N is the next version of Android
|
Mark M. |
we have the N Developer Preview 2 now
|
Joshua C. |
Ooh.
|
Mark M. |
it supports split-screen modes on phones and tablets, akin to what Samsung and others have had on their devices for a few years
|
Mark M. |
and, there's a "freeform multi-window" option for manufacturers, which gives you a desktop OS feel, with resizeable windows
|
Joshua C. |
Interesting... though possibly not quite relevant to this particular app... and I'm more concerned about various devices out there now and and can cross the bridge of new features when I come to it... Right now, the device I'm testing it on is android 4.4.4
|
Joshua C. |
And I'll install various emulators as I get further into development.
|
Mark M. |
just making sure that you understand what you're getting into
|
Joshua C. |
I do realize that this program is going to be very difficult to write... and is clearly a crazy one to write as my first android program. ;)
|
May 12 | 8:15 PM |
Joshua C. |
One more specific question I have related to this... is about the context... when I look in the debugger... the context of all the Views in my app seem to be the Activity...
|
Joshua C. |
How can I access the parent ViewGroup to the ViewGroup (or View) I'm in now?
|
Mark M. |
getParent(), if I recall correctly
|
Joshua C. |
Okay, good... a silly question...
|
Mark M. |
yes, getParent(): http://developer.android.com/reference/android/...
|
Joshua C. |
Well, I guess if you haven't worked with the Path and other low level drawing, I may be barking up the wrong tree for advice on how to proceed with this one....
|
Mark M. |
yeah, I'm not going to be any good at those questions, sorry
|
Joshua C. |
Well, that's okay... at least the code I do have works now, and I'll keep plugging away at trying to figure out low level drawing. I downloaded a million tutorials, though this subject seems a bit under represented in the books (such as yours) and tutorials. ;)
|
May 12 | 8:20 PM |
Mark M. |
it's a niche topic, and not a niche that I have natural skills in
|
Joshua C. |
I must say, I really like this format, as in the book, and offering office hours, etc. :)
|
Mark M. |
I am glad that it is working out for you
|
Joshua C. |
Even if you don't have an answer for me, it's a good way to operate, and it helps me feel supported, to have this way to ask a question outside of the often difficult stackoverflow and forums, etc.
|
Joshua C. |
And now I'll get back to it... I know this is possible, so I will get it to work... ;)
|
Joshua C. |
Thanks for your time.
|
Mark M. |
you are very welcome
|
May 12 | 8:30 PM |
Mark M. |
well, that's a wrap for today's chat
|
Mark M. |
the transcript will show up on https://commonsware.com/office-hours/ shortly
|
Mark M. |
the next chat is Saturday at 4pm US Eastern
|
Mark M. |
have a pleasant day!
|
Joshua C. | has left the room |
Mark M. | turned off guest access |