Apr 1 | 9:20 AM |
Mark M. | has entered the room |
Mark M. | turned on guest access |
Apr 1 | 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
|
NetApex |
So it checks to see if the file is updated with each opening
|
Apr 1 | 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
|
NetApex |
I was thinking xml, but doesn't have to be
|
Mark M. |
JSON may be simpler, but XML could work
|
Mark M. |
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
|
Mark M. |
parse the stuff into an ArrayList
|
NetApex |
yeah I saw that and shivered a bit
|
Mark M. |
feed that ArrayList to your ArrayAdapter
|
Mark M. |
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.
|
NetApex |
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
|
Mark M. |
your ArrayList will be of something else
|
NetApex |
Ok, well that is my problem lol
|
Mark M. |
e.g., ArrayList<Link>
|
Mark M. |
where Link is your own class that holds a title and a URL
|
Apr 1 | 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
|
NetApex |
Thanks again
|
Mark M. |
sure
|
Mark M. |
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
|
John M. |
and skimmed through the other two
|
John M. |
but found the tutorials on the Android site so I am working through those slowly
|
John M. |
I only get a few hours every few days
|
John M. |
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
|
John M. |
I would like to find a code example of this
|
John M. |
using a .png is fine
|
Mark M. |
I don't have a code example, per se
|
Apr 1 | 9:45 AM |
Mark M. |
some are implemented as dedicated activities
|
Mark M. |
with their own layout
|
Mark M. |
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 :-)
|
Mark M. |
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
|
Mark M. |
they are not necessarily complicated
|
Mark M. |
but without knowing what functionality you want in a splash screen, it is difficult to provide advice
|
Mark M. |
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?
|
Mark M. |
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
|
Mark M. |
the point is that they let the user know the app is indeed starting, while something time-consuming goes on
|
Mark M. |
in the case of Eclipse, there's a mountain of Java code to get loaded
|
Mark M. |
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
|
Mark M. |
in which case, the ad network probably has recommendations on how to create such a "pre-roll" splash screen
|
Mark M. |
they might even have code designed to work well with their network
|
Apr 1 | 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
|
Mark M. |
it in turn starts an AsyncTask or something to do the work that necessitates the splash screen
|
Mark M. |
or, it uses postDelayed() to just set a timer
|
Mark M. |
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
|
Mark M. |
look at the Camera samples in the Advanced Android code
|
Mark M. |
it's something like Theme.NoTitleBar.FullScreen
|
Mark M. |
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
|
John M. |
I'm really rusty with java but the tutorials are helping me get back in the groove
|
Apr 1 | 9:55 AM |
Mark M. |
yeah, it's like when I back off of Android development for a bit and go back to Ruby
|
Mark M. |
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
|
John M. |
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
|
Mark M. |
I don't trumpet them all that loudly
|
Mark M. |
if they get too crowded, their value drops
|
Mark M. |
four is workable
|
Mark M. |
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
|
Apr 1 | 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
|
John M. |
Mark do you have any apps on the Android Market?
|
Mark M. |
none under my name
|
Mark M. |
two done under contract
|
NetApex |
There is an app called send to qr.
|
NetApex |
(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
|
Mark M. |
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
|
John M. |
thanks guys. have a great day!
|
John M. | has left the room |
NetApex |
Take care John
|
NetApex |
Is there a place that lists the intents available for you to link up with?
|
Mark M. |
oy
|
Mark M. |
not exactly
|
Mark M. |
the Intent class lists a bunch
|
Apr 1 | 10:05 AM |
Mark M. |
there is also http://developer.android.com/guide/appendi…
|
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
|
Apr 1 | 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
|
NetApex |
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"
|
Apr 1 | 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" :-)
|
Mark M. |
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
|
Apr 1 | 10:20 AM |
Jim J. | has entered the room |
Jim J. |
Hello
|
Mark M. |
howdy, Jim!
|
Mark M. |
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
|
Mark M. |
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.
|
Jim J. |
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
|
Apr 1 | 10:25 AM |
Jim J. |
Does the fact that some of the data is a camera image destroy the idea of using extras ?
|
Jim J. |
Or maybe a mixed solution ?
|
Mark M. |
well, the image can't be stored well that way
|
Mark M. |
inevitably, the solution will need to be mixed, unless you store the wizard data in EXIF tags or something
|
Mark M. |
you'll have your image, and you'll have the rest of the stuff
|
Mark M. |
the rest off the stuff could be just passed around as extras (if small)
|
Mark M. |
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
|
Mark M. |
same place as it does on the device
|
Mark M. |
except you can actually get to it on the emulator
|
Mark M. |
/data/data/your.package.here/files corresponds to getFilesDir()
|
Mark M. |
(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".
|
Apr 1 | 10:30 AM |
Jim J. |
So SOMEWHERE, there should be a "killinfo.dat" file within the emulator's image data ?
|
Mark M. |
yes
|
Mark M. |
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
|
Jim J. |
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 |