Jan 16 | 7:20 PM |
Mark M. | has entered the room |
Jan 16 | 7:25 PM |
Mark M. | turned on guest access |
EGHDK | has entered the room |
Mark M. |
hello, EGHDK!
|
Mark M. |
how can I help you today?
|
EGHDK |
Hello. I've got a small list ready!
|
EGHDK |
I have two things to follow up on from the last time you gave me advice on how to create a listView from multiple adapters. First, https://github.com/commonsguy/cwac-merge has an error in the readme of the installation section. The first link takes you to: gihub.com/... instead of github.com/... Made me think github was down for a while. hahaha.
|
Mark M. |
OK, I'll take a look at that
|
Mark M. |
in the future, feel free to file an issue on the project
|
EGHDK |
Second, you said "Step #2: Create three views for the headers, however you want those to look". I'm having trouble creating these views. I have done "TextView text = new TextView(this)" text.setText("Header") and then mergeAdapter.addView(text); But it looks weird/unstyled. I know I asked about this before but I was never able to "figure it out". How would I go about creating an textView xml and then using that for the textView? And what is that called?
|
Mark M. |
it is called a layout resource
|
Mark M. |
you put it in res/layout/ or a similar directory
|
Mark M. |
you probably have many of these already
|
Mark M. |
and, you would use a LayoutInflater to create the TextView from the layout resource
|
Jan 16 | 7:30 PM |
EGHDK |
So let's say I wanted to create the textView for this header, what would have to be my root element in xml? a textView?
|
Mark M. |
yes
|
EGHDK |
Okay, so my last item on my list is: I'm interested in enabling proguard for my application. As of right now I'm getting even more familiar android security and the project file tree. Something that surprised me today when trying to enable proguard is that in the root of my project I have myApp.keystore, and my-key.keystore. Is that bad? Does that mean that the keystore is being shipped with my apk?
|
Mark M. |
no, the keystore will not be in your APK
|
Mark M. |
just as other files in the root of your project are not in your APK
|
Mark M. |
the only one that is would be AndroidManifest.xml
|
Jan 16 | 7:35 PM |
EGHDK |
Okay, I guess that's it. Besides me being stuck on proguard.
|
EGHDK |
There's a bunch of tutorials on it online, but they seem outdated.
|
Mark M. |
the ProGuard site itself should be up to date, though not especially Android-specific
|
EGHDK |
Some of the files they reference don't exist. I looked in your book for a proguard "lesson" but I didn't find anything. Did I miss something?
|
Mark M. |
no, I have not covered it yet
|
Mark M. | |
Mark M. |
the filenames for use in Android will differ from ProGuard norms, perhaps, because we have a different build process
|
EGHDK |
Yeah, I was reading through that today but on the first line it mentions: proguard.cfg but I don't have that.
|
Mark M. |
right
|
Mark M. |
the default name is proguard-project.txt
|
Mark M. |
same role
|
EGHDK |
Okay, and then the properties would be project.properties?
|
Mark M. |
I'm not sure quite what you're referring to there, though there is a project.properties file
|
Mark M. |
however, if proguard-project.txt is your filename, you should not need to change project.properties
|
Jan 16 | 7:40 PM |
Mark M. |
yeah, that page is out of date
|
Mark M. |
le sigh
|
EGHDK |
Okay good. I thought it was me.
|
EGHDK |
Because I tried following "the instructions"
|
EGHDK | |
EGHDK |
but if you are in project.properties it tells you to "uncomment" this to enable proguard.
|
EGHDK | |
Mark M. |
that's the right line there, with the reference to proguard-project.txt
|
Mark M. |
so, leave project.properties alone if that line is there
|
EGHDK |
So I'm unsure of what to go with. I don't know if eclipse generated the wrong things, or if the documentation is old.
|
Mark M. |
and put your ProGuard directives in proguard-project.txt
|
EGHDK |
Yeah, that line is there (originally it was commented out), but I uncommented it, so now it should be "enabled"... right?
|
Mark M. |
correct
|
Mark M. |
for release builds
|
EGHDK |
Because that same file says "#Do not modify this file"
|
EGHDK |
so I got worried.
|
Mark M. |
if it makes you feel better, this will all be a lot simpler in, say, 2017 or so
|
Mark M. |
:-)
|
EGHDK |
Basically this is my project.properties... does it look correct?
|
EGHDK |
View paste
|
Mark M. |
assuming that your first comment word-wrapped, and assuming that actionbarsherlock is a subdirectory under the project root, yes, that looks fine
|
Jan 16 | 7:45 PM |
EGHDK |
2017... hahah Why do you say that this will be simpler? Are they working on something?
|
Mark M. |
over the past couple of updates to my book, I have been adding chapters about the new Gradle-based build system
|
Mark M. |
which, all things considered, is probably not something that you specifically should need to worry about in the near term
|
Mark M. |
Google is changing the way we build our projects, in conjunction with building out the new Android Studio IDE
|
Mark M. |
however, the Android toolchain steers like an aircraft carrier
|
Mark M. |
and so, it takes a *long* time to pivot on stuff like this
|
Mark M. |
and it takes a *long* time for knowledge to percolate through the ecosystem
|
EGHDK |
gotcha.
|
Mark M. |
for me, these next few years are gonna suck, from the standpoint of support questions
|
Mark M. |
but, in the end, we will wind up with a more sensible solution
|
EGHDK |
Also, just to triple check. You said assuming my first comment is word wrapped. My first comment is:
|
EGHDK |
# To enable ProGuard to shrink and obfuscate your code, uncomment this (available properties: sdk.dir, user.home):
|
EGHDK |
Should the words directly after "uncomment this" be uncommented?
|
EGHDK |
(Available properties:sdk.dir, user.home):
|
Mark M. |
that is all one line in your file, right?
|
EGHDK |
yeah
|
Mark M. |
then it is correct as it stands
|
EGHDK |
great.
|
EGHDK |
You also mentioned "and put your ProGuard directives in proguard-project.txt"
|
Jan 16 | 7:50 PM |
Mark M. |
correct
|
EGHDK |
So basically after I enable proguard in project.properties, all the other changes will be made in proguard-project.txt?
|
Mark M. |
correct
|
EGHDK |
Btw that merge adapter was super simple. So easy to use.
|
Mark M. |
it doesn't do much, so it tries to do it simply
|
Mark M. |
sometimes, I come up with a good API my first try
|
Mark M. |
other times, not so much
|
EGHDK |
Which brings me to another question. I never "know" if I'm importing libraries/jars the right way. So for the merge adapter to work, I had to download two seperate jars. I then dragged them from my downloads into the libs folder in my app, I then right clicked on my project, went to "Java build path" and under libraries I clicked "add jars", browsed for them in my project libs and then, when to the "order and export" tab and checked both of the jars. Is that the right way to do it?
|
Mark M. |
you were fine up through the "into the libs folder of my app"
|
Mark M. |
the rest was unnecessary and might cause problems
|
Mark M. |
putting the JARs in libs/ is sufficient for Eclipse and Ant
|
Jan 16 | 7:55 PM |
EGHDK |
Oh really?
|
Mark M. |
you may wish to double-check one item in your build path for your project: http://stackoverflow.com/questions/16596969/lib...
|
EGHDK |
Interesting. Should I just remove them then? in libraries and order and export?
|
Mark M. |
I'd say yes
|
Mark M. |
generally speaking, outside of double-checking the one thing in that SO answer I linked to above, you don't mess with the Java build path in Eclipse for Android development
|
Mark M. |
OTOH, so long as what you have is working, you could just leave it alone for the time being
|
Mark M. |
it's your call
|
EGHDK |
OTOH?
|
Mark M. |
"on the other hand"
|
EGHDK |
Gotcha. So if I order and export android private libraries, that will go into my libs folder and make sure everything is working?
|
Mark M. |
yes
|
EGHDK |
working or imported? whatever you want to call it.
|
EGHDK |
oh! So thats what that means.
|
EGHDK |
heh
|
EGHDK |
Okay, well I've messed up a lot of jars then. I've done this same process tens of times now.
|
Mark M. |
again, if your app is running, you can leave them alone
|
Mark M. |
but, you don't need to do it
|
Jan 16 | 8:00 PM |
Mark M. |
the real problem comes in if you *don't* put them in libs/, and just try attaching them to your project via the manually-adjusted build path
|
Mark M. |
then, they will be available for the compile step, but will not be packaged into the APK
|
Mark M. |
and you get a lot of ClassNotFoundExceptions at runtime
|
EGHDK |
Gotcha.
|
EGHDK |
Makes sense.
|
EGHDK |
When it comes to libraries that are folders (like ABS), I just import them as a project in eclipse, and then add it manually by project properties -> android -> add library. That sounds correct... right?
|
Mark M. |
ues
|
Mark M. |
er, yes
|
EGHDK |
Is there anyway to keep my eclipse package explorer clean? I use a whole bunch of libraries and they are all over the place. I never know if it's a library or what, because most libraries are called "library" and never "ActionBarSherlock" or "SwitchBackport".
|
Mark M. |
well, you can rename them in Eclipse to be whatever you want
|
Mark M. |
Shift+Alt+R, or right-click over the project and choose Refactor > Rename
|
Jan 16 | 8:05 PM |
EGHDK |
Alright, I never knew if that messed anything up. So I never attempted. Cool, I look forward to naming all of the with an "A" to make sure they show up at the top of my package explorer. heh. Thanks
|
Jan 16 | 8:10 PM |
EGHDK |
I think that about sums it up for all the questions I had in 48 hours worth of coding since Tuesday. hahah. Thanks again Mark
|
Mark M. |
you are very welcome
|
Jan 16 | 8:15 PM |
Emmanuel | has entered the room |
Jan 16 | 8:20 PM |
Mark M. |
hello, Emmanuel!
|
Emmanuel |
Hello all
|
Mark M. |
Emmanuel: do you have a question?
|
Emmanuel |
no, I wanted to personally thank you for your long and detailed answer today
|
Mark M. |
ah, you're the Emmanuel who used the new SO bump service?
|
Emmanuel |
I thought it was 7.30pm CST...lol
|
Emmanuel |
yes
|
Emmanuel |
really nice idea
|
Mark M. |
it's something I had been meaning to add to the site for quite a while
|
Mark M. |
finally got around to it
|
Emmanuel |
I actually had the chance to talk to you in person in AnDevCon Boston last year
|
Emmanuel |
(I was the guy asking about Context)
|
Emmanuel |
maybe you had multiple guys asking about Context
|
Mark M. |
it's more that it was, like, eight months ago
|
Mark M. |
I'm happy if I remember what I had for breakfast, some days
|
Mark M. |
:-)
|
mfcplus | has entered the room |
Mark M. |
hello, mfcplus!
|
Emmanuel |
LOL
|
Mark M. |
mfcplus: the chat will be ending soon -- do you have a question?
|
mfcplus |
any idea when will the code be updated using android studio instead of eclipse?
|
Mark M. |
at their current pace?
|
Mark M. |
mid-2014, I'm hoping
|
mfcplus |
ok, thanks
|
Mark M. |
even then, I won't be converting all of them
|
mfcplus |
and what you think about html5 vs native
|
Mark M. |
um, could you be more specific?
|
Jan 16 | 8:25 PM |
mfcplus |
like writing a native android app using java vs using html5 javascript on the device
|
Mark M. | |
mfcplus |
cool thanks
|
Mark M. |
while that blog post is more about PhoneGap than plain HTML5, it covers my opinion
|
Mark M. |
generally speaking: HTML5 (with or without PhoneGap) is fine for many use cases, though not all
|
Mark M. |
if anyone has a question, chime in
|
Emmanuel |
You are not coming any time soon to St. Louis, MO, right?
|
Mark M. |
I have no current plans to go to St. Louis
|
Mark M. |
if I think of it, I might propose a talk for Strange Loop, which IIRC is held in St. Louis
|
Emmanuel |
I was going to tell you about that right now
|
Emmanuel |
you beat me to it
|
Emmanuel |
that would be great!
|
Mark M. |
I have heard good things about that event
|
Jan 16 | 8:30 PM |
Emmanuel |
yeah
|
Emmanuel |
and it is more affordable than AnDevCon
|
Mark M. |
it seems like it's more of a language event, though
|
Emmanuel |
yeah, that is true
|
Mark M. |
anyway, I filed myself a to-do for it
|
Mark M. |
and that's a wrap for today's chat
|
Emmanuel |
cool, thank you, good night
|
EGHDK |
Thanks mark goodnight!
|
Mark M. |
the transcript will be posted to http://commonsware.com/office-hours/ shortly
|
Mark M. |
next one is 10am US Eastern on Tuesday
|
Mark M. |
have a pleasant day!
|
Emmanuel |
see you then
|
EGHDK | has left the room |
Emmanuel | has left the room |
mfcplus | has left the room |
Mark M. | turned off guest access |