Office Hours — Today, February 10

Thursday, February 5

Feb 10
7:25 PM
Mark M.
has entered the room
Mark M.
turned on guest access
7:40 PM
Venkat
has entered the room
Venkat
Good day Mark
Mark M.
hello, Venkat
how can I help you today?
Venkat
Tutorial #6 - adding a library: you look at adding compiled jars
However I need to add .java files thats what the installation nodes for https://github.com/quemb/QMBForm say
add the complete folder to my android studio project
Mark M.
yes, I see that in the Installation section of the README
7:45 PM
Venkat
But I try, I get compilation errors that the package is not found
would you be having similar step by step instructions as in tutorial , but for adding the source of a library?
Mark M.
no, sorry
Johnny
has entered the room
Mark M.
but it's not that difficult
(BTW, hello, Johnny -- I will be with you shortly!0
...er, shortly!)
Johnny
Hi Mark
No worries
Mark M.
Venkat: when you downloaded and set up the library, did you modify your settings.gradle file and your build.gradle file of your app to reflect the library?
Venkat
settings.gradle - yes
build.gradle - what do I need to do?
Mark M.
your app module's build.gradle file would need a compile project(:...) line in the dependencies closure
where ... is replaced by the location of the library module
Venkat
ok, thanks ... will give it a try
Mark M.
so, for example, if your project root has your app in app/ and this library in qbform/
your settings.gradle would have :app and :qbform
and your app'
and your app's build.gradle would have compile project(':qbform')
Venkat
thank you!
Mark M.
my CWAC libraries are mostly set up this way
Venkat
ok
Mark M.
so if you peek at the Gradle files for a library like https://github.com/commonsguy/cwac-richedit you will see how they get connected
7:50 PM
Mark M.
and with that, let me take a question from Johnny, and I will be back with you shortly
Johnny: your turn! do you have a question?
Johnny
View paste
yep, I'm about to start a new project and I was wondering in your opinion what is the best way to structure an Android projects. 
Should we use MVP, MVC etc?
Mark M.
Android does not strictly follow MVC, MVP, MVVM, etc.
you'll find various blog posts and such that describe how to shoehorn Android into those sorts of GUI architectures
personally, I don't get too hung up on any of them
again, mostly because Android's not a specific fit for any
I tend to think in terms of MVC, in part because that's the only one of those GUI architectures that I have ever used
that's not to say that MVP, MVVM, etc. are bad, or worse for Android -- I'm just not familiar with the nuances
Johnny
I see, thanks. How would you structure your project for unit testing?
Mark M.
well, I'm certainly a fan of Android Studio/Gradle for Android's project structure, where the test code can go in the androidTest/ sourceset
beyond that, I'm not a big fan of scripted GUI testing, so I usually focus on model-level stuff
7:55 PM
Mark M.
my guess is that these answers aren't helping you much :-)
Johnny
Thank you! One last question if you wouldn't mind. I've only become aware of these concepts but would you recommend we use dependency injection and functional reactive programming for Android programming?
Mark M.
there are lots of DI fans
it's one of those things I never really got into in pre-Android Java development
Johnny
Haha it's giving me a general direction of where I should focus my energy :)
Mark M.
and so I personally haven't used it
RxJava is "the new black", and frankly I haven't figured out what all the fuss is about
I'm happy with event buses
but, again, there are power developers (e.g., anyone who works at Square) who swear by both of them
Johnny
Yes I was thinking of using Otto for my new project
Mark M.
I'm more of a greenrobot EvenBus fan, personally, just because I like the more flexible threading options
but Otto is cool
either are better than LocalBroadcastManager, in terms of verbosity
let me take another question from Venkat, and I will be back with you in a bit
8:00 PM
Mark M.
Venkat: your turn! do you have another question?
Johnny
Thanks Mark for your help, that's all from me :)
Venkat
That fixed the compile errors, thank you!
Johnny
has left the room
Mark M.
it would certainly be easier if that library were available as an AAR artifact from a repository
but, I'm glad that you got it going
Venkat
Thats all from me
Venkat
has left the room
8:30 PM
Mark M.
turned off guest access

Thursday, February 5

 

Office Hours

People in this transcript

  • Johnny
  • Mark Murphy
  • Venkat