Oct 15 | 3:50 PM |
Mark M. | has entered the room |
Mark M. | turned on guest access |
Oct 15 | 4:00 PM |
EGHDK | has entered the room |
Mark M. |
hello, EGHDK
|
Mark M. |
how can I help you today?
|
EGHDK |
If I have an arrayadapter and its backed by an array, and I call datasetChanged what actually happens?
|
EGHDK |
Because I'm updating my array and calling dataSetChanged but not seeing a change.
|
Mark M. |
do you mean notifyDataSetChanged()?
|
Mark M. |
and by "array" do you mean an ArrayList?
|
EGHDK |
Yes and Yes
|
Mark M. |
notifyDataSetChanged() tells the AdapterView to reload its contents from the Adapter
|
Mark M. |
if you are not seeing changes, make sure that you are affecting the actual ArrayList that the ArrayAdapter wraps
|
Mark M. |
or, use the add(), insert(), and remove() methods on ArrayAdapter
|
EGHDK |
Alright. Will do.
|
Mark M. |
which both modify the ArrayList *and* do a notifyDataSetChanged() for you
|
Oct 15 | 4:05 PM |
EGHDK |
Okay, next qquestion might be a little weird, but I was using your camera library in my eclipse project.
|
EGHDK |
I believe I was using a 0.5 or 0.6 version or something.
|
Mark M. |
current is 0.6.10
|
EGHDK |
I switched from using eclipse to Android studio and it complained about multiple package names or something because I had camera and camerav9
|
Ron B. | has entered the room |
Mark M. |
with Android Studio, you wouldn't use JARs, but rather grab the artifacts from the repository
|
Mark M. |
in which case, just asking for camera-v9 will pull in the camera artifact
|
Mark M. |
(hello, Ron -- I will be with you momentarily!)
|
Ron B. |
Hi Mark,
|
EGHDK |
So I tried that, but it broke my app because it says that you can only have video in portrait or something.
|
Mark M. |
the library does not support video recording in portrait
|
EGHDK |
So I'm trying to use the old library. Any way to grab that from the repo?
|
Mark M. |
put that editions version number in the compile directive
|
Mark M. |
but portrait recording is buggy, and I do not recommend it
|
EGHDK |
Okay
|
EGHDK |
I will use it, but I will take note of that.
|
Mark M. |
Ron: your turn! do you have a question?
|
Ron B. |
I have an app that displays a map on all of my devices except my Samsung 10" tablet? Is there some setting or something else I should be looking for? It just displays a white screen.
|
Mark M. |
Maps V2?
|
Ron B. |
Yes
|
Mark M. |
does the regular Maps application work on the tablet?
|
Oct 15 | 4:10 PM |
Ron B. |
Yes
|
Mark M. |
anything interesting in LogCat?
|
Ron B. |
Haven't dug too deep yet, just happened to coincide with office hours :-). Does anything sound familiar?
|
Mark M. |
not really
|
Mark M. |
if it works on one device and not another, that's usually more of a device issue
|
Mark M. |
for example, it might not be up on the latest Play Services or something
|
Mark M. |
but that should pop a dialog when you check for Play Services compatibility
|
Ron B. |
Yeah, I did check the play store version, it's OK
|
Mark M. |
so, I'd rummage around LogCat and see if there is anything interesting showing up in there
|
Ron B. |
Do maps not like to display on a large screen without some other setting...?
|
Mark M. |
no, there's no problems thre
|
Mark M. |
er, there
|
Mark M. |
now, I can't rule out something broken in your UI (e.g., you have a white thing floating over your map)
|
Ron B. |
OK, I'll keep diggin.. Thanks anyway
|
Mark M. |
that only happens to show up on tablets
|
Mark M. |
EGHDK: your turn! do you have another question?
|
EGHDK |
View paste
|
Mark M. |
yes, or replace the + with a specific patchlevel
|
Oct 15 | 4:15 PM |
Mark M. |
0.5.+ says "gimme the highest patchlevel of the 0.5.x series"
|
EGHDK |
oh. That seems easy enough
|
Mark M. |
0.5.1 says "gimme 0.5.1"
|
EGHDK |
And that makes sense. Thanks.
|
Mark M. |
Ron: your turn! do you have another question?
|
Mark M. |
Ron: if you come up with a question, let me know
|
Mark M. |
EGHDK: back over to you, if you have another question
|
EGHDK |
So it turns out my array my adapter is using is not being directly edited. Its more like 1 array is being updated, then that one updates another 1. Whats your advice in that kind of perdicament? Besides the obvious "just use one array, and only modify that one"?
|
Mark M. |
I'd stick with the obvious :-)
|
Oct 15 | 4:20 PM |
EGHDK |
Damn. Alright. Worth a try.
|
Mark M. |
having multiple collections without clear roles for them can get you in trouble, as it would appear is happening here
|
EGHDK |
They do have clear roles.
|
Mark M. |
what are the roles?
|
EGHDK |
Well one is basically a db helper and another array is just a filtered list from the db
|
Mark M. |
what does "basically a db helper" mean?
|
Mark M. |
do you mean some sort of cache of Plain Old Java Objects (POJOs) that you created based on a database query?
|
EGHDK |
Yeah
|
EGHDK |
Exactly that. (So thats what pojos are)
|
Mark M. |
then if you update the master copy ("basically a db helper"), you need to ensure everyone working off of a separate subset of that master ("filtered list from the db") knows about changes
|
EGHDK |
Okay. Makes sense.
|
EGHDK |
View paste
|
Mark M. |
that's... different
|
Oct 15 | 4:25 PM |
Mark M. |
I haven't seen that message before
|
Oct 15 | 4:25 PM |
EGHDK |
This happens even though the application isn't even installed.
|
Mark M. | |
EGHDK |
What if proguard isn't an option.
|
Mark M. |
get rid of some libraries, perhaps
|
Mark M. |
the post there indicates that this is another side effect of the 64K DEX method reference limit
|
Mark M. |
which basically boils down to "you're using too many libraries for Android to handle"
|
EGHDK |
bah. How is that possible. Isn't the 64k dex limit on all android versions?
|
EGHDK |
How does it work on 4.0?
|
Mark M. |
normally, it's a compile-time limit -- you usually crash at build time
|
EGHDK |
?
|
Mark M. |
actually, re-reading the answer, the developer didn't hit the 64K DEX method reference limit, but still had a too-big APK file, presumably based on code volume
|
EGHDK |
Normally its compile time... but "you usually crash at build time". Isn't that the same thing?
|
Mark M. |
yes
|
Oct 15 | 4:30 PM |
Mark M. |
I misinterpreted the SO answer -- the developer there did not hit the 64K DEX method reference limit, but hit some other limit ("the buffer", whatever that is)
|
Mark M. |
and reducing the size of the app helped
|
EGHDK |
Interesting. Okay.
|
EGHDK |
So in Androisd studio... I have camera and cameraV9 module in my project tree.
|
Mark M. |
(BTW, Ron, if you have another question, chime in)
|
EGHDK |
View paste
|
EGHDK |
Do I basically have two instances of them now?
|
Mark M. |
two instances of what?
|
Ron B. |
Yup, I see a message that coincides with an entry in StackOverflow. http://stackoverflow.com/questions/8463731/andr...
|
EGHDK |
or since the camera v9 and camera libraries aren't used, they don't get compiled/bundled in with my app?
|
Mark M. |
libraries are compiled in
|
Mark M. |
ProGuard might remove them for release builds, if you're not using them
|
EGHDK |
Mark: so if I don't include `compile project(':cameraV9')` then it shouldn't be bundled in with my app right?
|
Mark M. |
correct -- Android Studio does not pull in libraries that it does not know about
|
Oct 15 | 4:35 PM |
EGHDK |
It might be how android studio opened my eclipse porject and then tried to include all my dependencies.
|
Mark M. |
possibly
|
EGHDK |
I have compile project(':mergeAdapter') the : means that its coming from my local project and not a repo somewhere right?
|
Mark M. |
yes, from your mergeAdapter/ module
|
EGHDK |
Okay, so where is compile 'com.android.support:support-v4:18.0.0' coming from?
|
EGHDK |
Is that getting pulled from google? Because I don't see that module anywhere
|
Mark M. |
either you have a compile directive for it, or you are using a library that has a compile directive for it, or you are pulling in the JAR from libs/ with a compile fileTree() directive, etc.
|
Oct 15 | 4:40 PM |
EGHDK |
So its not pulling from the web is what your saying?
|
Mark M. |
well, for that particular library, it will come from your Android Repository that you installed in the SDK Manager
|
Mark M. |
which is local to your machine, in your SDK directory
|
EGHDK |
okay.
|
Mark M. |
compile directives citing an artifact by name (e.g., compile 'com.android.support:support-v4:18.0.0' ) will pull from some repository
|
Mark M. |
usually, that repository is a hosted one, like Maven Central
|
Mark M. |
in the case of the Android Support libraries and the Play Services SDK, they come from local repositories set up by the SDK Manager
|
EGHDK |
View paste
|
Mark M. |
I do not depend upon appcompat-v7
|
Mark M. |
beyond that, support-v4 and appcompat-v7 are separate libraries
|
EGHDK |
Oh. Okay.
|
Oct 15 | 4:45 PM |
EGHDK |
So for support-v4 I'm getting a redline under it. "Should not use lower version 18 than sdk target (19)
|
EGHDK |
Is that an issue since cwac camera asks for 18?
|
Mark M. |
no, it should be OK
|
Mark M. |
I probably need to figure out a more flexible approach to declaring that dependency
|
Ron B. |
Are you ready for me yet? I sent a link above, Google maps has no problem with the gsm signal not being there.
|
Mark M. |
Ron: whoops! sorry, missed that in the transcript
|
EGHDK |
Sorry Ron!
|
Ron B. |
NP, bad timing on my part :-)
|
Mark M. |
Ron: I can't imagine that those messages would result in an empty map
|
Ron B. |
There are error messages. The marker and accuracy circle are there.
|
Mark M. |
so, you're missing the tiles
|
Oct 15 | 4:50 PM |
Mark M. |
I don't see how that error message would tie into not getting tiles
|
Ron B. |
I guess you could say that
|
Mark M. |
on a whim, you might try running one of my Maps V2 samples on the tablet, switched to your own API key
|
Mark M. |
if that works, perhaps there is something in your app that is confounding matters on this table
|
Mark M. |
er, tablet
|
Mark M. |
if it does not work -- and that would be my guess -- then I haven't the foggiest notion what the problem would be
|
Mark M. |
though, FWIW, not having the right API key results in this set of symptoms, so make sure you're running the same APK on the phone and the tablet
|
Mark M. |
for example, if your applicationId is different in one, you'd need to set up your Maps API key to support both applicationId values
|
Ron B. |
I am trying to put buttons and text on top of the map. It's also Android V4.0.4, which is the only device of it's type. It runs on 4 other devices, though I am in the debugger right now.
|
Mark M. |
EGHDK: regarding your last topic, if you have the { exclude } stuff for that camera-v9 dependency, as you pasted into the chat earlier, you should be able to request a newer support-v4 edition to make the tools happy, and camera-v9 should not care
|
Oct 15 | 4:55 PM |
Mark M. |
Ron: 4.0.4 is a bit long in the proverbial tooth, though I would expect other symptoms if age were a problem (e.g., dialog about not having the right Play Services Framework installed)
|
Randall M. | has entered the room |
Mark M. |
hello, Randall!
|
Randall M. |
Hi Mark.
|
Mark M. |
Randall: the chat is only a couple of minutes from ending -- do you have a quick question?
|
Randall M. |
Ah, time zones...grr.
|
Randall M. |
Yes, and it's probably a quick one.
|
Ron B. |
Would Google maps work OK and not an app if there is a problem with play services?
|
Randall M. |
Variable-height ListView TableRows? Is it just a matter of providing a custom view of the correct height (sized to a wrapping text label)?
|
Mark M. |
Ron: yes, if the app is requesting a version of Play Services that happens to be there, and you're asking for a newer one
|
Mark M. |
Randall: go ahead
|
Mark M. |
Randall: well, ListView rows overall are usually wrap_content, so as long as your content is tall enough, you're fine
|
Mark M. |
not sure about using TableRow in a ListView row, though
|
Mark M. |
with no TableLayout in the picture, I'm not sure you're gaining anything
|
Randall M. |
Grrr, meant TableLayout.
|
Oct 15 | 5:00 PM |
Randall M. |
sorry, trying to type quickly, since I mis-timed this.
|
Mark M. |
so, a TableLayout in ListView rows?
|
EGHDK |
One more thing mark... where do you think: compile 'com.actionbarsherlock:actionbarsherlock:4.4.0@aar' is coming from? I had it downloaded and in eclipse as a lib, but when I went to android studio, I don't see it in my project tree.
|
Mark M. |
EGHDK: *that* is coming from camera-v9, because the point behind camera-v9 is to use ActionBarSherlock
|
Randall M. |
yeah, I have a list of Table of Contents strings, and some need to wrap to a second line. I don't want all rows to have multi-line heights, just those that need it.
|
Randall M. |
Would also like the wrapped line to be indented, a hanging indent, I think it's called.
|
Randall M. |
If this is too involved, I'll come back on Friday for your office hours.
|
Mark M. |
Randall: I don't completely follow your use case, but if you set the ListView row to have a height of wrap_content, then you control the height of the row and can use things like stretchColumns/shrinkColumns in a TableLayout to help manage it
|
Mark M. |
in terms of a hanging indent, that could get tricky
|
Mark M. |
off the top of my head, I don't know how I would have a paragraph in a single TextView with a hanging indent
|
Mark M. |
if you are splitting the text across multiple TextViews, and you want the top one to stick out more on the left than the others, there are a few options for that, such as using your TableLayout and having the hanging TextView span two cells or something
|
Oct 15 | 5:05 PM |
Mark M. |
or GridLayout might give you more choices, instead of TableLayout
|
Mark M. |
but, I really do need to get going
|
Mark M. |
the next chat is Friday at 4pm US Eastern Time
|
Mark M. |
this chat's transcript will be posted to http://commonsware.com/office-hours/ shortly
|
Randall M. |
Thanks. I've adjusted my calendar notice to reflect the time zone difference.
|
Mark M. |
have a pleasant day!
|
EGHDK | has left the room |
Ron B. | has left the room |
Randall M. | has left the room |
Mark M. | turned off guest access |