Office Hours — Today, April 1

Tuesday, March 30

Apr 1
9:20 AM
Mark M.
has entered the room
Mark M.
turned on guest access
9:30 AM
NetApex
has entered the room
Mark M.
howdy!
John M.
has entered the room
NetApex
Good morning
John M.
Morning
NetApex
Quick scenario for you
Mark M.
howdy, John!
John M.
Hi Mark
Mark M.
NetApex: go ahead
NetApex
I want to have a file with "title" and "http:blahblah.com/stuff" on the internet and have my app read that file and make it into a spinner
So it checks to see if the file is updated with each opening
9:35 AM
NetApex
Seems possible, but my "grab from internet and place into array" skills are lacking
Mark M.
place into array?
NetApex
End result would be a drop down list of titles, that when clicked take you to blah blah
Mark M.
what format is the file in?
NetApex
Currently the file does not exist, so which ever way makes the most sense is how I will do it
I was thinking xml, but doesn't have to be
Mark M.
JSON may be simpler, but XML could work
you'll see examples of how to download from the Internet in the Service/WeatherPlus example
NetApex
heck I would love to be able to put a db out there and have the program hit a webpage to get the info... but again, not at that level lol
Mark M.
that also shows XML parsing, but the National Weather Service XML format is icky
parse the stuff into an ArrayList
NetApex
yeah I saw that and shivered a bit
Mark M.
feed that ArrayList to your ArrayAdapter
put the ArrayAdapter in the Spinner
NetApex
My issue with arrays... I understand how a simple list works, but a list that lets you get to the link, I can't grasp at the moment.
I could make the drop down basically with the titles from the array, but having those titles correspond to the links doesn't click in my head
Mark M.
your ArrayList won't be of strings
your ArrayList will be of something else
NetApex
Ok, well that is my problem lol
Mark M.
e.g., ArrayList<Link>
where Link is your own class that holds a title and a URL
9:40 AM
NetApex
Oh wow, ok cool, didn't realize that could be done
Mark M.
if you are not customizing the Spinner layouts, implement toString() on Link to return your title
NetApex
ok, gonna give that a shot
Thanks again
Mark M.
sure
John: did you have a question?
John M.
Hi Mark. Thanks for making yourself available here
Mark M.
happy to help
John M.
I started going through the tutorials book
and skimmed through the other two
but found the tutorials on the Android site so I am working through those slowly
I only get a few hours every few days
anyway I was wondering if you could direct me to an example of something
Mark M.
OK
John M.
I notice that some apps I have downloaded from the market have splash screens
I would like to find a code example of this
using a .png is fine
Mark M.
I don't have a code example, per se
9:45 AM
Mark M.
some are implemented as dedicated activities
with their own layout
some are implemented on the "next" activity (the thing after the splash), with the splash image/layout visible and the real stuff not for a while
John M.
so its the layout that is taking over the whole screen? then time out?
Mark M.
to be honest, asking for an example of a splash screen is a bit like asking for an example of a motor vehicle :-)
there are lots of possible motor vehicles, from scooters to tanks
John M.
ah I didn't think it was that involved
Mark M.
there are lots of possible splash screens, too
they are not necessarily complicated
but without knowing what functionality you want in a splash screen, it is difficult to provide advice
for example, what is the point of the splash screen?
John M.
I'm just interested in a basic non-animated graphic that takes up the screen then times out and turns over control to the ui
Mark M.
why?
those aren't necessarily popular among users
John M.
just something like you see with Eclipse
Mark M.
is there something in particular you are doing that needs an up-front delay?
John M.
no. I'm just a learner and that's one thing I would like to do
Mark M.
splash screens usually aren't just eye candy
the point is that they let the user know the app is indeed starting, while something time-consuming goes on
in the case of Eclipse, there's a mountain of Java code to get loaded
in the case of some Android apps, they need to download info from the Web
John M.
I've also noticed some hook an advert into the splash screen
Mark M.
that's another possibility
in which case, the ad network probably has recommendations on how to create such a "pre-roll" splash screen
they might even have code designed to work well with their network
9:50 AM
John M.
mkay
Mark M.
the simplest approach to a splash screen is a dedicated activity, with a layout that has whatever you want in it
it in turn starts an AsyncTask or something to do the work that necessitates the splash screen
or, it uses postDelayed() to just set a timer
when the work or timer is done, call startActivity() on the next thing and finish() to get rid of the splash screen from the history
John M.
so the layout can be coded to prevent that top bar from displaying?
Mark M.
there's a theme for that you can put in the manifest
look at the Camera samples in the Advanced Android code
it's something like Theme.NoTitleBar.FullScreen
bear in mind, though, that going with a full-screen graphic makes your life more difficult with multiple screen sizes
John M.
ah found it
Mark M.
unless someone is forcing you to use that model, I'd go with some design that minimize the number of distinct artwork/layouts you need to work OK on different screen sizes
John M.
ok thanks
I'm really rusty with java but the tutorials are helping me get back in the groove
9:55 AM
Mark M.
yeah, it's like when I back off of Android development for a bit and go back to Ruby
I'm fumbling with my cheatsheet to remember stuff
John M.
I have a few ideas for apps but it's gonna be awhile before I can get there
Your books have helped a bunch
Mark M.
glad they're useful!
John M.
Do these chat sessions ever get very busy?
Mark M.
max I think I've had is four, plus me
I don't trumpet them all that loudly
if they get too crowded, their value drops
four is workable
ten would mean not everyone gets to ask a question, in all likelihood
NetApex
True
Mark M.
so, I'm letting them sloooooooooooowly grow
John M.
If NetApex wanted to ask another question feel free
NetApex
I am just listening in right now while I work on stuff
10:00 AM
NetApex
This way if something pops up I can hop in, or pick up some new ideas :)
John M.
lol ya that's what I was planning to do
Mark do you have any apps on the Android Market?
Mark M.
none under my name
two done under contract
NetApex
There is an app called send to qr.
(Or something like that) Where it uses the send intent and lets you make qr codes out of links
Mark M.
plus I've assisted on a couple of others on the Market
NetApex: I've seen it
NetApex
It starts off with a "this is what the program does" page that then removes itself from the programs section to keep from wasting space. I think that is pretty cool personally.
Mark M.
they are disabling their activity component via the PackageManager, most likely
John M.
ok well I have to get the kids moving
thanks guys. have a great day!
John M.
has left the room
NetApex
Take care John
Is there a place that lists the intents available for you to link up with?
Mark M.
oy
not exactly
the Intent class lists a bunch
10:05 AM
Mark M.
neither of those are complete, though, as there are a few Intent actions scattered elsewhere in the docs
NetApex
Cool thank you again
Mark M.
OpenIntents has an Intent registry on their site, but last I checked it was pretty stale
NetApex
Yeah that is the one I found (OpenIntents) and thought it was missing a lot
10:10 AM
NetApex
your movie app that you have out there for streaming video... that is what I am basing the thing I am doing off of
only instead of typing in a url, I want to be able to do the spinner part
Mark M.
OK
NetApex
This way I don't have to push out updates when there are more movies, just update the one file and voila everyone has access
Mark M.
ah
NetApex
Another question, push notifications... is that something that is within the realm of "not to hard"
10:15 AM
Mark M.
if by "not too hard" you mean "there is no framework for it, so it will involve pain reminiscent of smashing your off hand repeatedly with a ballpeen hammer", then, yes, it is "not too hard" :-)
coming up with a solution for that is high on my engineering agenda
NetApex
Then I will patiently wait for someone much smarter than myself (being you) to tackle it first and slide in on your coat tails lol
10:20 AM
Jim J.
has entered the room
Jim J.
Hello
Mark M.
howdy, Jim!
got a question?
Jim J.
Not really. I was just seeing who was here. I like following the discussions.
Mark M.
sorry, quiet day today
John M. was in earlier
Jim J.
For temp data, do you like SQLite or regular, flat files. By temp, I mean if you were building a wizard type flow among activities, and needed to collect information along the way, which will be ultimately used at the end, what would you do ?
Mark M.
if it's small, I'd just use Intent extras
Jim J.
Oh, and at the end, it is uploaded to a server and removed from the device.
Some of the data is a camera image.
Mark M.
between the other two, though, a wizard probably isn't collecting enough "rows" of data to justify a table structure, so I'd roll with flat files
10:25 AM
Jim J.
Does the fact that some of the data is a camera image destroy the idea of using extras ?
Or maybe a mixed solution ?
Mark M.
well, the image can't be stored well that way
inevitably, the solution will need to be mixed, unless you store the wizard data in EXIF tags or something
you'll have your image, and you'll have the rest of the stuff
the rest off the stuff could be just passed around as extras (if small)
or, use a single activity
Jim J.
Does the emulator store the data somewhere ? I have yet to find it when I write the flat files.
Mark M.
sure
same place as it does on the device
except you can actually get to it on the emulator
/data/data/your.package.here/files corresponds to getFilesDir()
(substituting in an appropriate value for your.package.here)
Jim J.
I can't find the file name I used.
Mark M.
did you close the file?
Jim J.
Yep. Flushed it too.
Mark M.
:: shrug :: then it should be there
Jim J.
I will try again to look where you said. But the exact file name will be used ?
Mark M.
yes
Jim J.
I used the name "killinfo.dat".
10:30 AM
Jim J.
So SOMEWHERE, there should be a "killinfo.dat" file within the emulator's image data ?
Mark M.
yes
and the "somewhere" is /data/data/your.package.here/files
Jim J.
Hhmmm...I will try again.
Mark M.
unless you specified a subdirectory under that
Jim J.
Nope. Just the file name.
Mark M.
Well, that's a wrap for today's office hours chat
Jim J.
thx
bye
Mark M.
Next one will be a week from today
Jim J.
has left the room
NetApex
Cool, take care
Mark M.
have a pleasant day!
NetApex
has left the room
Mark M.
turned off guest access

Tuesday, March 30

 

Office Hours

People in this transcript

  • Jim Jackson
  • John Martinez
  • Mark Murphy
  • NetApex