Mark M. | has entered the room |
Mark M. | turned on guest access |
Dec 1 | 10:00 AM |
BenVonHandorf | has entered the room |
Mark M. |
howdy, Ben!
|
Mark M. |
how can I help you today?
|
BenVonHandorf |
Mark, I wanted to thank you for your books, for
starters, and ask you a non-techncial question... how did you go about
moving from beginner to intermediate and advanced in Android?
|
Mark M. |
first, you're welcome
|
BenVonHandorf |
I'm at the point where I've got a pretty good handle on the basic stuff, IMHO...
|
BenVonHandorf |
I can come up with 3 or 4 different approaches to
any problem, but I dont' yet have that "journeyman" level of
understanding that helps me decide which one to pursue./
|
Mark M. |
well, "best practices" are still very much a work in progress in the Android community in general
|
BenVonHandorf |
From your blog post, I've started following the
various chatrooms and reading other stuff, but most books aren't
covering the kind of stuff I'm after at this point... the patterns and
best practices.
|
Mark M. |
that's because Android is a bit young
|
Dec 1 | 10:05 AM |
Mark M. |
now, I will be trying to cover more of what we *do* know *today* of best practices in the Big Book Reboot
|
Mark M. | |
Mark M. |
however, there will be gaps
|
Mark M. |
gaps big enough that the gaps will have their own little gaps... :-)
|
Mark M. |
and, today's best practices may not be tomorrow's best practices
|
BenVonHandorf |
I can handle gaps... but there are so many bits to
the SDK that it's hard to decide what's actually worth using and what
is just crazy Google engineer thoughts.
|
BenVonHandorf |
Like ContentProviders. :)
|
Mark M. |
ah, well, um
|
Mark M. |
different people will have different perspectives on that
|
Mark M. |
it's like asking what's the best beer
|
BenVonHandorf |
So, no consensus has emerged?
|
Mark M. |
certainly there's no consensus on every given possible point in Android
|
Mark M. |
if you mean ContentProviders specifically, there are two main camps:
|
Mark M. |
1. ContentProviders are fine for inter-process stuff but aren't the greatest for internal stuff
|
Mark M. |
2. ContentProviders should be used everywhere
|
Mark M. |
I am in the first camp
|
Mark M. |
others are in the second
|
BenVonHandorf |
So inside of an app, would you just pull cursors up to the UI from, say, a SQLite DB?
|
Mark M. |
sure
|
BenVonHandorf |
Or do you deserialize into POJOs?
|
BenVonHandorf |
Or...?
|
Mark M. |
I tend to avoid converting to POJOs just for the sake of converting to POJOs, as that consumes more heap and CPU
|
Mark M. |
so, for a simple CRUD app, I'd just work with the Cursor
|
BenVonHandorf |
Agreed, but I'm fairly new to Java and wasn't sure if that was a stupid approach.
|
Dec 1 | 10:10 AM |
Mark M. |
there may be cases where there is so much application logic tied to the models that converting to POJOs will be the right answer
|
Mark M. |
and certainly Android devices have tended to get faster
|
Mark M. |
with larger heaps
|
BenVonHandorf |
Sure, there are always exceptions... I can accept
that... but the object conversion and the nice way the adapters work
with Cursors seemed to make Cursors a better choice generally.
|
Mark M. |
I agree
|
BenVonHandorf |
So, another "approach" question... How would you
go about syncing data in a local DB in the background? SyncProvider?
Inexact alarms with a Service? I'm currently working down the
SyncProvider method, and it seems OK, but I don't know enough to figure
out if I'm going to hit a hard wall with it.
|
Mark M. |
I haven't yet played with SyncProvider
|
Mark M. |
I have spoken with people who have, and they have tended to use profanities in the discussion
|
BenVonHandorf |
Uh oh.
|
Mark M. |
but I don't recall any specifics of what they encountered
|
Mark M. |
I hope to play with SyncProvider in 2012
|
Mark M. |
shortly before the Mayan apocalypse occurs in December
|
Mark M. |
:-)
|
BenVonHandorf |
I just hope the Apocalypse runs Android. At least then all this effort learning the platform won't be wasted.
|
Mark M. |
right now, if I had to implement something, I would use an inexact repeating alarm
|
Mark M. |
yeah, but it will have Carrier IQ installed
|
BenVonHandorf |
DOH!
|
BenVonHandorf |
I swear, the manufacturers really are trying to kill Android, aren't they?
|
Mark M. |
Manufacturers are used to a world where they controlled matters more
|
Mark M. |
it takes a while to change that attitude
|
Dec 1 | 10:15 AM |
BenVonHandorf |
<sigh>
|
BenVonHandorf |
So how do you go about keeping up? Mostly reading or mostly writing little apps to play with new features?
|
Chaitanya | has entered the room |
Chaitanya |
Hello
|
Mark M. |
oh, it's a lot of trial and even more error
|
Mark M. |
howdy, Chaitanya!
|
Chaitanya |
Hi Mark. No questions yet, just dropping in
|
Mark M. |
OK
|
Mark M. |
Ben: I also do bits of consulting, which gets me into more areas that I might not have investigated as quickly otherwise
|
Mark M. |
and I'm cutting back on training to be able to spend more time on engineering
|
Mark M. |
for example, there's TouchFire
|
Mark M. | |
Mark M. |
I'm working with them to get Android support going for their keyboard overlay thingy
|
Mark M. |
I'll take the SDK SoftKeyboard example and get it to line up with their physical key placement
|
BenVonHandorf |
Oh, awesome!
|
Dec 1 | 10:20 AM |
Mark M. |
open source the results, and try to spur developers who create good IMEs to offer a TouchFire compatible version
|
Mark M. |
ordinarily, writing IMEs would be low on my list of priorities
|
Mark M. |
but, I'll do some light experimenting here
|
BenVonHandorf |
Seems like there are a lot of things like that going on with Android. One of the things I like about the platform.
|
BenVonHandorf |
Cool. I'll stop monopolizing your time, but do you mind lurkers in these chats?
|
Mark M. |
I don't mind them
|
Mark M. |
but, these chats are mostly for Q&A
|
Mark M. |
so, lurkers often get bored, I suspect, if there's nobody asking questions :-)
|
BenVonHandorf |
Understood... but sometimes seeing a question points you in a direction you didn't know existed.
|
Mark M. |
agreed
|
BenVonHandorf |
And the SDK is so broad and has so many different ways to do the same thing...
|
Chaitanya |
I do have a thought I'd like your comment on Mark
|
Mark M. |
I'm still posting links to the transcripts on the
cw-android Google Group, though eventually I'll switch that to a feed of
some sort
|
Mark M. |
Chaitanya: go ahead!
|
Chaitanya |
As a consultant developer, when asked to provide
estimates on developing an Android app, am I justified in stating that
given the same development skill, developing for the Android platform
would require more hours than developing on iOS?
|
Chaitanya |
I know the platforms cannot be compared directly
|
Mark M. |
oh, I have no idea
|
Mark M. |
I can barely spell OiS
|
Mark M. |
iSO
|
Mark M. |
iOS
|
Mark M. |
whatever
|
Mark M. |
:-)
|
Chaitanya |
but its a question I often wonder about
|
Mark M. |
oh, it's a perfectly valid question, just not one that I can answer
|
Chaitanya |
but if you had to wager...
|
Mark M. |
well, it depends
|
Dec 1 | 10:25 AM |
Mark M. |
Android development might take more time for a couple of reasons:
|
Chaitanya |
my justification is that since we have to support a
broader range of devices, we have to put in more code to handle the
various configurations
|
Mark M. |
1. Some things are just plain harder, such as dealing with varying screen sizes
|
Mark M. |
2. You might try doing things that you simply can't do in iOS, such as app widgets
|
Mark M. |
OTOH, Android apps tend to skate by with, shall we say, less-sophisticated graphic design
|
Mark M. |
and iOS apps may have to go a couple of rounds with the App Store folk for approval
|
Mark M. |
in those cases, iOS might take more effort
|
Mark M. |
on the whole, particularly if you are putting
equal graphic design effort on the Android side, and you are targeting
the full range of Android devices, Android probably takes more time
|
Chaitanya |
I'm pretty adamant that the applications I design
should use customized UI controls which leads to further development
time. This might change once I play with the native UI of ICS.
|
Chaitanya |
oh speaking of which, how is the Galaxy Nexus treating you?
|
Mark M. |
um, let's just say that I think the phone, ICS, or both, were slightly rushed to market
|
Mark M. |
nothing huge
|
BenVonHandorf |
FWIW: Things like the 9-patch images on Android
made custom buttons in our app easier on Android than iOS (where every
button text was a different image). Direct development time is harder
to compare... different teams worked on it.
|
Mark M. |
and, curiously, I haven't encountered the fabled volume bug
|
BenVonHandorf |
Volume but?
|
BenVonHandorf |
bug?
|
Mark M. |
yeah, the Galaxy Nexus has a tendency to spontaneously change volume, apparently
|
Mark M. |
lots of coverage
|
Mark M. |
seems to be tied to interference from other phones
|
Mark M. |
a patch is forthcoming
|
Chaitanya |
I did read today that they've started rolling out the fix OTA
|
Dec 1 | 10:30 AM |
Mark M. |
yeah, it'll be interesting to see how that works with mine, since mine is imported from the UK by Expansys
|
Mark M. |
I've always had US phones before, and received OTA
|
Mark M. |
updates
|
Mark M. |
not sure if the UK phone will change that dynamic
|
Chaitanya |
ok
|
Chaitanya |
Mark do you host Hangouts?
|
Mark M. |
I'm not yet a G+ member
|
Chaitanya |
Ok, I think that would be pretty helpful :)
|
Dec 1 | 10:35 AM |
BenVonHandorf |
Mark, are there any good regional conferences for Android development? Something like CocoaConf for iOS?
|
Mark M. |
not in the US
|
BenVonHandorf |
I'm hoping to go to IO next year, but that sold
out so quickly last year... and all the other conferences are expensive
and would involve travel/hotel/etc.
|
Mark M. |
the droidcon series would be roughly equivalent
|
Raza R. | has entered the room |
Mark M. |
droidcon has one in Berlin, London, and... um... forget exactly which city hosted the recent Netherlands one
|
Mark M. |
plus India
|
BenVonHandorf |
I wonder why nothing US based yet...
|
Mark M. |
howdy, Raza!
|
Dec 1 | 10:40 AM |
Raza R. | |
Raza R. |
it's showing null value
|
Mark M. |
Ben: there are the occasional one-day events hosted by Meetups or GTUGs
|
Mark M. |
Raza: OK
|
Mark M. |
are you sending it a fix from DDMS or telnet?
|
Mark M. |
and, if so, is your LocationListener registered before you send the fix?
|
Raza R. |
yes i did both sent from DDMS as well telnet
|
Raza R. |
how to register??
|
Mark M. |
call requestLocationUpdates() on the LocationManager
|
Raza R. |
View paste
(54 more lines)
|
Mark M. |
OK
|
Raza R. |
View paste
(33 more lines)
|
Mark M. |
Raza: the View paste link shows the full paste
|
Raza R. |
yeap got it
|
Mark M. |
once your activity is launched, and you have
gotten past onResume(), if the activity is in the foreground, simulated
fixes from DDMS/telnet should work
|
Dec 1 | 10:45 AM |
Mark M. |
also, make sure your emulator thinks it has a signal
|
Mark M. |
IOW, it shows the 3G indicator and such
|
Mark M. |
if the emulator shows no signal, then it will not respond to simulated GPS fixes
|
Raza R. |
yes its showing 3G indictor
|
Mark M. |
beyond that, I don't know what to tell you
|
Mark M. |
your code seems OK
|
Raza R. |
m getting following message, "Provider not available"
|
Mark M. |
where are you getting this message?
|
Mark M. |
oh, never mind
|
Mark M. |
you're calling getLastKnownLocation()
|
Mark M. |
that's not going to work
|
Raza R. |
that program showing
|
Mark M. |
you don't have a location by that point in time
|
Mark M. |
just use the location supplied to the LocationListener in onLocationChanged()
|
Dec 1 | 10:50 AM |
Raza R. |
any possible solution for that
|
Mark M. |
no
|
Mark M. |
geLastKnownLocation() will frequently be null, on hardware and the emulator
|
Mark M. |
er, sorry, that's getLastKnownLocation()
|
Mark M. |
the only time you are fairly certain that
getLastKnownLocation() will work is after you start receiving fixes via
onLocationChanged()
|
Mark M. |
bear in mind that it may take several seconds or longer for GPS to become available after you call registerLocationUpdates()
|
Mark M. |
it might *never* be available if the device cannot get a GPS signal, or if the user has GPS disabled
|
Raza R. |
ok, otherwise code was right na?
|
Mark M. |
it seems OK
|
Mark M. |
it resembles my book examples :-)
|
Raza R. |
View paste
|
Mark M. |
call getAltitude() on the Location object
|
Dec 1 | 10:55 AM |
Raza R. |
is it possible to extract source file from apk ??
|
Mark M. |
not really
|
Mark M. |
an APK can be "decompiled" into something more readable than a bunch of binary bits
|
Mark M. |
but you don't get Java syntax source code as a result of the decompile
|
Mark M. |
any last questions?
|
Raza R. |
View paste
|
Dec 1 | 11:00 AM |
Mark M. |
it means you have a syntax error in your SQL
|
Mark M. |
NEAR, for example, only works in SQLite on FTS3 tables
|
Mark M. |
or, perhaps "near" is just part of the error message
|
Mark M. |
not sure
|
Mark M. |
regardless, that's a wrap for today's office hours chat
|
Mark M. |
the next one is Tuesday, 4pm US Eastern Time
|
Raza R. |
Thanks for the help
|
BenVonHandorf |
Thanks!
|
Mark M. |
have a pleasant day, all!
|
BenVonHandorf | has left the room |
Chaitanya | has left the room |
Raza R. | has left the room |
Mark M. | turned off guest access |