Jul 21 | 3:55 PM |
Mark M. | has entered the room |
Mark M. | turned on guest access |
Jul 21 | 4:00 PM |
ndrocchietto_ivano | has entered the room |
Mark M. |
hello, Ivano!
|
ndrocchietto_ivano |
Good afternoon Mark!
|
Mark M. |
Version 7.5 of the book was released about 20 minutes ago, so be sure to grab your copy
|
Mark M. |
beyond that, how can I help you today?
|
ndrocchietto_ivano |
yesssss
|
Jul 21 | 4:05 PM |
ndrocchietto_ivano |
well,I had an existential trouble over db. I updated the db mysqlite adding a fifth column, it works pretty coolish. Just I choiced the way easy, that is just adding one column with ALTER SET. Now my concern is, in terms of performance, would have not be better to use a different table instead of a fifth column? So I would have use an Inner Join linking the primary keys.
|
Mark M. |
eeek
|
Mark M. |
on the whole, I would expect an inner join to be worse, not better
|
ndrocchietto_ivano |
eek
|
ndrocchietto_ivano |
i am surprised
|
Mark M. |
now, if the cost of the ALTER TABLE is such that you can't afford the upgrade time, then perhaps going with the inner join is the lesser of two evils
|
Jul 21 | 4:10 PM |
ndrocchietto_ivano |
why then there is all this fuss in making different table if the performance become worse?
|
ndrocchietto_ivano |
tables*
|
Mark M. |
I don't know why you would make a separate table versus just adding a column to an existing table, so I do not know what "all this fuss" is
|
ndrocchietto_ivano |
( i can afford upgrade time really well)
|
ndrocchietto_ivano |
lol
|
ndrocchietto_ivano |
OK fine with me
|
ndrocchietto_ivano |
glad to have discovered that easy is better
|
ndrocchietto_ivano |
OK thanks
|
ndrocchietto_ivano |
I am going to follow a movie, but leave the chat to observe if somebody will come
|
Mark M. |
OK
|
Jul 21 | 4:15 PM |
Lawrence K. | has entered the room |
Lawrence K. |
Hello!
|
Mark M. |
hello, Lawrence!
|
Lawrence K. |
Hi Mark, thanks for the wonderful book!
|
Mark M. |
thanks!
|
Mark M. |
Version 7.5 of the book was released less than an hour ago, so be sure to download your copy
|
Mark M. |
Ivano is lurking, so if you have a question, go right ahead!
|
Lawrence K. |
I just did. I wanted to ask about Wear and whether you were planning to add material on that, other than notifications.
|
Mark M. |
(BTW, Ivano, if you come up with another question, chime in)
|
Mark M. |
I do not plan on covering Wear apps at this time
|
ndrocchietto_ivano |
(i am not a pokemon to catch although)
|
Jul 21 | 4:20 PM |
ndrocchietto_ivano |
(not Mark one per day is more than enough thanks)
|
Lawrence K. |
Okay. It's a bit tricky and Google's docs on it are sparse, so I was hoping to find more thorough stuff in this book.
|
Mark M. |
sorry
|
Mark M. |
you'll see that I tend toward stuff that is pure Android, versus things with proprietary ties (Play Services, Wear, etc.)
|
Lawrence K. |
Oh okay. What fraction of Android users are on non-Google platforms, do you know?
|
Mark M. |
well, pretty much all Chinese users have non-Google devices
|
Mark M. |
the one survey I saw a couple of years ago indicated that the Play ecosystem was less than half of the world's Android devices
|
Mark M. |
but I haven't seen anything much recently on the topic
|
Lawrence K. |
Oh interesting. I only sell on Play, mostly because I figure that the rest of the ecosystem has poor ad revenue.
|
Mark M. |
not surprisingly, Google doesn't comment :-)
|
Mark M. |
the rest of the ecosystem is fairly fragmented
|
Mark M. |
there's probably 100+ markets in China alone
|
Mark M. |
I had a conversation with a large Chinese device manufacturer, and the representative I was talking to was stunned that many Western developers would ship only through the Play Store
|
Jul 21 | 4:25 PM |
Mark M. |
it's pretty much par for the course in China that you ship through lots of stores
|
Mark M. |
and I presume that there are services that help developers do that
|
Lawrence K. |
Yeah, like I said my impression is that ad revenue is poor in developing countries, but I could be totally wrong about that. Many of the deals I make only make me money for U.S. users.
|
ndrocchietto_ivano |
(interesting- thumb up)
|
Mark M. |
I only have a high-level view of the situation, so I can't make any recommendations on ad networks, specific non-Play markets, etc. that would be worth considering
|
ndrocchietto_ivano |
(:) positive)
|
Mark M. |
but, with regards to Wear, while I won't rule out writing about Wear apps, it's not on my to-do list
|
Lawrence K. |
I get a decent number of requests for Wear support -- more than I'd expect. Judging from the relatively little activity about it on SO, I'm guessing not too many developers support it.
|
Mark M. |
for these sorts of specialized segments, I try to do a bit in the space (e.g., Wear notifications), then wait to see how the segment fares
|
Jul 21 | 4:30 PM |
Mark M. |
I think all the specialized segments (Wear, TV, Auto) are only doing so-so for developer adoption
|
Mark M. |
which is why Google went to some lengths to make it so that more apps would ship on Chrome OS "out of the box"
|
Mark M. |
at least on touchscreen-enabled Chromebooks
|
Lawrence K. |
I admit I'm a bit surprised how much coverage you're giving to Chrome OS -- perhaps I don't realize the importance of the Android-on-ChromeOS thing.
|
Mark M. |
it's only a chapter
|
Lawrence K. |
Oh I guess I'm referring to your various blog posts recently.
|
Mark M. |
length-wise, I probably spend more time on Wear-friendly notifications
|
Mark M. |
the reason for the blog posts is partly because it's new, and partly because "you only have one chance to make a first impression"
|
Mark M. |
and this is the first impression of Android on a desktop-y environment
|
Mark M. |
at least in terms of official support (vs. Bluestacks, JIDE, etc.)
|
ndrocchietto_ivano |
I am surprised google did not exploit the fact an ad hoc linux distro could have been devised, i am assuming they did not meet Mr. Penguin philosophy not big data oriented. after all I am playing android studio on an I3 lubuntu and is fastest than on my i7 4th gen windows 8.1
|
Jul 21 | 4:35 PM |
Mark M. |
Ivano: I cannot really comment on that, sorry
|
ndrocchietto_ivano |
sure sorry for the lack of neutrality, I fully understand:)
|
Mark M. |
Lawrence: since Android apps will ship to touchscreen Chromebooks automatically when support rolls out "for realz", I worry that developers will ignore the platform and users will have a lousy experience as a result
|
Mark M. |
this is different from Wear/Auto/TV, where developers have to explicitly opt into the platform
|
Lawrence K. |
Makes sense.
|
Mark M. |
but you'll see less on Chrome OS going forward, unless I run into show-stopping problems
|
Lawrence K. |
Is writing the book your full-time gig?
|
Mark M. |
I do a mix of things on a freelance basis
|
Mark M. |
historically, the book had been a full-time gig
|
Steve S. | has entered the room |
Mark M. |
hello, Steve!
|
Steve S. |
Hi Mark!
|
Mark M. |
Steve: Ivano and Lawrence have had time to ask questions already, so I'll turn to you -- do you have a question?
|
Steve S. |
Yes.
|
Steve S. |
I'm trying to do something pretty basic: I want to put activity files into their own package/folder.
|
Steve S. |
I'm having problems getting that to compile.
|
Jul 21 | 4:40 PM |
Mark M. |
so, if your package name is com.steve.awesomeapp, you are trying to put your activities into com.steve.awesomeapp.ui?
|
Steve S. |
Exactly.
|
Mark M. |
other than having to add the import statement for com.steve.awesomeapp.R, that should work fine
|
Mark M. |
plenty of apps go that route
|
Mark M. |
I don't think I have any book samples that do, just because my samples are all fairly short
|
Mark M. |
but the APK edition of the book itself has activities in a variety of packages
|
Mark M. |
what is your specific compile problem?
|
Steve S. |
I think it's what your solution addresses: "package R does not exist"
|
Mark M. |
OK
|
Mark M. |
in Java, you automatically import all classes that are in the same package
|
Steve S. |
ok
|
Mark M. |
so, if your activities are in com.steve.awesomeapp, you do not need to have an import statement for R, as R is also in com.steve.awesomeapp
|
Steve S. |
What is the APK edition of the book?
|
Mark M. |
the book is published in PDF, EPUB, MOBI/Kindle, and as an Android app (APK)
|
Mark M. |
you'll find a download for it on your Warescription page
|
Steve S. |
Great. I'll look for that.
|
Steve S. |
I think I should be able to get this working now and will give it a try.
|
Mark M. |
anyway, if you move classes to a different package, that's fine, but you then need to add an import statement for the R class
|
Steve S. |
That makes sense.
|
Steve S. |
I'll also need to modify the manifest to include the subdirectory in the activity name, I take it.
|
Mark M. |
yes
|
Steve S. |
So those two changes?
|
Jul 21 | 4:45 PM |
Mark M. |
if you used Android Studio's refactoring tools to move the class, the manifest may already be taken care of for you
|
Steve S. |
I didn't use that but will give it a try.
|
Mark M. |
Android Studio supports drag-and-drop to move classes to other packages
|
Mark M. |
it then tries to fix up all external references to that class to match
|
Steve S. |
That's good to know about.
|
Steve S. |
Ok. I'll try what you said. Thanks so much!
|
Mark M. |
you are very welcome
|
Mark M. |
if anyone has any questions, go right ahead!
|
Steve S. | has left the room |
Lawrence K. |
Do you have questions for app developers? :-)
|
Mark M. |
besides Wear apps, what things do you want covered that are not being covered in the book?
|
Mark M. |
I can't promise anything, but it's always good to know where pain points lie
|
Jul 21 | 4:50 PM |
ndrocchietto_ivano |
javaRX, syncadapter, refactoring for android
|
Mark M. |
Ivano: I am not sure what you mean by "refactoring for android"
|
Mark M. |
RxJava might get in there next year, as with SyncAdapter
|
ndrocchietto_ivano |
well you magistrally covered in your chapters for testing, the concept of Junit vs Instrumentation but...
|
Lawrence K. |
I switched a bunch of my app to RxJava a few months ago. It was a good experience, but it's a large library that caused some dex problems.
|
ndrocchietto_ivano |
testing and refactoring are a combined skill today in times of TDD and BDD, so android has some particularities, like a lot of super classes, overrides everywhere, ad hoc classes, that could be covered with some tips, more android SDK focused than java.
|
Mark M. |
yes, I do not cover the 64K DEX method reference limit in much detail
|
Mark M. |
the problem is that since I do not do that much in the way of massive refactoring, I cannot really provide advice
|
Mark M. |
with new APIs and such, I can craft examples and explore beyond what documentation offers
|
ndrocchietto_ivano |
clear and understandable. Also I would add regarding RX java
|
Lawrence K. |
Mark: To answer your question, though, I don't know. I tend to just jump into the book looking for whatever I'm working on at the time. It was helpful for home page widgets, especially since I have a list widget. Wear was the one time I didn't find what I needed.
|
Mark M. |
Lawrence: that's fair, thanks!
|
ndrocchietto_ivano |
now java 8 is supported this means users will be able to use the new functionalities as lamba, default interfaces, and mainly streams that are really similar to rxjva concepts
|
Jul 21 | 4:55 PM |
Mark M. |
yes, one of the reasons why I held off on RxJava was waiting for first-class lambda support
|
Mark M. |
that is why I might cover it next year
|
Lawrence K. |
I don't know if the book covers this, but it's related to Steve's question: How to structure the app? Google's examples (and yours) are simple, so everything is thrown together. I wish Google would open-source their larger apps so that we could see what a well-structured large app looks like. Stuff like how do you decompose classes into packages, are fragments still a good idea, etc. Large-program issues.
|
Mark M. |
by and large, that's the sort of thing that goes beyond what you are likely to find in most books
|
Lawrence K. |
Exactly!
|
Lawrence K. |
But where to find it then?
|
Mark M. |
conference presentations/meetups would be one candidate
|
Mark M. |
blog posts/articles from developers of larger apps
|
Mark M. |
personally, I haven't written what I would consider to be a large app
|
Lawrence K. |
But if you do consulting, you might have seen some.
|
Mark M. |
hence, as with Ivano's refactoring request, I lack the experience
|
Mark M. |
yes and no
|
Mark M. |
I have to be careful, with respect to non-disclosures and stuff
|
ndrocchietto_ivano |
what matter is that you are a great teacher. I do not know how will go with the new documents SO functionalities, but your way to explain concept is number 1, even better than official documentation imo
|
Mark M. |
Ivano: thanks for the kind words!
|
ndrocchietto_ivano |
is true
|
Mark M. |
Lawrence: plus, I generally want to have code that demonstrates what I am talking about
|
Mark M. |
and I can't devote the time to write a large app for the sake of writing a large app
|
Lawrence K. |
Related questions, like should Application be subclasses (or used at all), how to deal with globals, singletons, how to pass Context to singletons, that sort of thing.
|
Jul 21 | 5:00 PM |
ndrocchietto_ivano |
architecture
|
Lawrence K. |
Yes, architecture.
|
Mark M. |
Lawrence: while fine topics, those are the sorts of things that usually are better for a Stack Overflow question, or a blog post
|
Mark M. |
architecture gets back to the large-app problem
|
Mark M. |
and I'm not really a strong MVC/MVP/MVVM advocate in the first place
|
Mark M. |
I am not saying that any of those are bad topics to want; they just are bad topics for *me* to deliver
|
Lawrence K. |
Well I wasn't looking to see a large app, only a bullet list of advice, like "- Try to put all activities into a sub-package" or whatever. That wouldn't violate non-disclosures.
|
Mark M. |
I have lots of limitations
|
Lawrence K. |
Yeah I'm not a fan of MVC either.
|
Mark M. |
yes, but, that's as much a matter of taste as anything else
|
Lawrence K. |
Is it?
|
Mark M. |
I was just in a chat with others on that very topic, for code organization
|
Mark M. |
it's not a cut-and-dried, This Is The One True Way sort of thing
|
Mark M. |
it starts to get into team roles (e.g., where do you start dividing into libraries), version control strategies, etc.
|
Mark M. |
and that's waaaaaaaaaaaaaaaay outside what I want to get into
|
Lawrence K. |
Right.
|
ndrocchietto_ivano |
right
|
Mark M. |
again, all valid concerns, just not what I'm really in position to do, in the format of a book
|
Mark M. |
anyway, that's a wrap for today's chat
|
Lawrence K. |
Thanks Mark!
|
Mark M. |
the next chat is Saturday at 9am US Eastern
|
ndrocchietto_ivano |
have a nice time mark and Lawrence
|
Mark M. |
this transcript will go up on https://commonsware.com/office-hours/ shortly
|
ndrocchietto_ivano |
thanks
|
Mark M. |
have a pleasant day!
|
ndrocchietto_ivano | has left the room |
Lawrence K. | has left the room |
Mark M. | turned off guest access |