Office Hours — Today, March 10

Monday, February 28

Mar 10
9:55 AM
Mark M.
has entered the room
Mark M.
turned on guest access
10:05 AM
Kathy V.
has entered the room
Mark M.
hello, Kathy!
Kathy V.
Good morning.
Mark M.
how can I help you today?
10:10 AM
Kathy V.
I am thinking about trying to do a screen that displays something like flower shapes that are floating. and slowly moving When someone touches one of the flowers a message would pop up. Do you have anywhere you can direct met o find out how to do this?
Mark M.
I suspect that would typically be done using 2D graphics on a Canvas, and touch events on that same Canvas
this is how most 2D games work, for example
I have not delved into that area of Android, and so I do not have any specific advice regarding those techniques
you can try to achieve your desired effect using ImageView widgets and widget animations
animations are covered in _The Busy Coder's Guide to Advanced Android Development_
Kathy V.
Okay. I have been doing some research and not finding much for the floating images that did not involve a lot of programming. So, maybe I won't do the floating and moving thing. I was hoping to find some built in basic things in Android to do it but I guess they aren't there.
10:15 AM
Mark M.
well, I doubt there is a canonical definition of "floating"
Kathy V.
Would just displaying a message when someone touches an image perhaps be easier?
Mark M.
well, yes
Kathy V.
I did other searches besides floating like moving and other similar words.
Mark M.
just have an ImageView somewhere
add the android:onClick attribute to it in your layout XML
have the method you name in the android:onClick attribute display a message (e.g., Toast)
Kathy V.
Thanks, that is helpful. When I do toast messages they don't stick around very long. Is there a way to make them not disappear so quickly. By the way I am a newbie at this.
Mark M.
Toasts are not designed to last very long
you can choose between Toast.LENGTH_SHORT (1-2 seconds) and Toast.LENGTH_LONG (3-4 seconds IIRC)
Kathy V.
If I don't use a toast what would be the best way to display a message then?
Mark M.
there is no abstract "best"
what is "best" depends entirely on context
Kathy V.
Ok, then, a better way?
Mark M.
alternatives include dialogs, notifications, or displaying something in the activity itself (e.g., the thing that has the ImageView the user tapped upon)
10:20 AM
Kathy V.
I have another question about doing wallpapers. I have some images that I would like to sell as wallpaper on Android. I would also like the wallpapers to be sized easily. Are there any tutorials or examples of this that you know of that I can look at?xah turlite
Mark M.
I have not played with any wallpaper imagery other than what comes standard on a device
by definition, bitmap images cannot "be sized easily"
I cannot really help you in this area, as it has nothing to do with Android application development
Kathy V.
Well, I thought that I would have to develop some sort of an app to upload to the store to do the wallpapers.
Mark M.
Android has the notion of live wallpapers, but they are not images.
10:25 AM
Mark M.
live wallpapers are apps
Kathy V.
I looked in the store and saw that they were selling some wallpapers that I thought were not live. Are all of those wallpapers live then?
Mark M.
no clue
there is the WallpaperManager system service, which lets you get/set wallpaper
it has methods to give you the right wallpaper size
perhaps the apps are merely shells around using this service and using that to load in the correct wallpaper
personally, if I wanted wallpaper, I would simply download an image to the phone and set it as the wallpaper
Kathy V.
I own some antique images that I thought might make some nice wallpapers that are unique and I do see people selling groups of wallpaper images in the store.
David
has entered the room
Mark M.
I'm not saying you can't sell wallpaper
10:30 AM
Mark M.
I am saying that wallpaper management is not a topic covered in my books or any other development that I have done, and that I am not exactly a model target customer
howdy, David!
David
Good Morning.
Mark M.
David, do you have a question?
David
Yes. I implemented a bind service using an example in your book.
Kathy V.
I have read that there is a piracy issue with android apps and so some (Angry Birds) are putting ads into their apps. Are there any companies that you might recommend to use for adding ads to apps?
David
It is working well. I'd like to add another service. I need your advice.
Mark M.
David: it is unusual for an application to need more than one service, though it is certainly possible
David
There is one callback function defined in the interface. Is it possible to add another callback?
Mark M.
Kathy: I have not written any ad-sponsored apps, and so I have little advice. You might consider AdWhirl as a "compatibility layer" to allow you to use multiple ad providers, though -- I have heard that some ad networks have difficulty supplying enough paid ads
David: sure
just add it to the Binder
David
But I have problem in onBind.
Mark M.
your Binder can expose as many methods as you want
10:35 AM
Mark M.
what is your problem in onBind?
David
onBind returns only one listenr.
Mark M.
correct
or, more accurately, onBind() returns one Binder
implement more than one method on the Binder
David
I mean binder. So I have to put several callbacks in one binder. Correct?
Mark M.
if you need two distinct Binders for some reason, put something in the Intent to identify which you want for various circumstances (e.g., custom action string), and have onBind() choose the right Binder based upon that.
however, for an local service, I cannot think of a reason why you would need two Binders
David
Okay.
Mark M.
just add more methods to the existing Binder
David
I see. Thanks
Kathy V.
I have a screen right now that has three spinners and a button. I would like to add some informational text beneath the spinners and above the button. What would be a good way to do that?
Mark M.
Kathy: use a TextView
10:40 AM
David
Can Service send an Intent to Activity? Since it is not working, I have to stick with bind service. Is it correct approach?
fitz
has entered the room
fitz
morning
Mark M.
David: a service has many possible ways to communicate back to an activity, as is covered in the chapters on services in _The Busy Coder's Guide to Android Development_
fitz
Mark how was California - good show/sessions?
Kathy V.
Ok, thanks. The app I am working on has three screens. I am using a separate activity for each screen display. Is that the correct way to do it?
Mark M.
one approach is to broadcast an Intent, picked up by the activity via a BroadcastReceiver registered via registerReceiver()
fitz: AnDevCon went reasonably well. Bigger than expected attendance.
Kathy: that is impossible to answer in the abstract
Kathy V.
When using multiple screens when should you use a new activity for each one?
Mark M.
Kathy: that depends on what the "multiple screens" really are. I suggest that you read this blog post: http://commonsware.com/blog/2011/02/14/nat…
10:45 AM
fitz
ya android around here is going nuts - was at meetup weekend hacakathon last weekend down at paypal - was huge and tons of VC's - so money should start to flow soon
Mark M.
fitz: was that called "andevcamp"? Christian Kurzke was tweeting about something named that.
fitz
so would it be worth next year going to this AnDevCon for 1k?
yes that was it
Mark M.
fitz: next AnDevCon will be in November, actually. Personally, I'm not a big conference-goer (I|O is about all I go to unless I'm speaking), so I'm a poor judge of value.
many of the presentations from this one are here: http://andevcon.com/speakerpresentations.html
fitz
had some demos Friday night included to Google presentations - think the audience knew a ton mode that these lead developers about there own products (Android 3.0) and API's - it was kind of funny
10:50 AM
Kathy V.
Besides reading your great books, do you have any recommndations for some good online video tutorials? Seeing something visually in addition to reading about it helps me learn better.
Mark M.
fitz: yeah, sometimes they send new developer advocates to events, or at least new to Android
fitz
cool thanks for link - ya these guys had pettagree - just think they were managers
Mark M.
Kathy: I have seen references to video tutorials, but I haven't been keeping track of links. The Google I|O conference videos are good and are up on YouTube, but I wouldn't describe them as "tutorials" per se.
fitz: Ah, ok. AnDevCon got lucky and snagged Romain Guy and Chet Haase for an Android 3.0 keynote, plus got Kiril Grouchnikov (sp?) and Chet for regular conference sessions.
Kathy V.
By the way, I am in Austin and SXSW is coming up. There is a free Google event, but I do not know how much of it will be Android oriented, so I don't know if I should go and deal with the traffic, crowds and parking.
Mark M.
I am hoping that since the next one is also out here in CA, that the Google presence will keep up, as presentations by core Android team members are generally authoritative
Kathy: If you're referring to the League of Extraordinary Hackers or whatever it's called, I don't think that's Android specific. I'm not sure what else Google has going on at SXSW.
Kathy V.
Yes, it was the League of Extraordinay Hackers. I can't afford a SXSW badge so I was just looking for free stuff.
10:55 AM
Mark M.
Out of curiosity, how expensive is SXSZ? I've never gone.
er, SXSW
fitz
do you know if google IO will be broadcast live? I did not get ticket - was not fast enough
Mark M.
fitz: last year, the keynotes were live and the rest were later uploaded to YouTube
fitz
sorry no business questions today :)
Kathy V.
A platinum pass is around $900 for a platinum and they go down to $375 I think. You can get the prices here at http://sxsw.com/attend
Mark M.
if you have a GTUG in your area, though, there may be some sort of simulcast beyond the keynotes
the global head of GTUGs was here at AnDevCon and mentioned something about this at a fireside chat
Kathy: that's not as bad as I was afraid of, but certainly not cheap
OTOH, Austin has great steaks... :-)
Kathy V.
Yes, we do. We also have great trailer food.
fitz
ya the SV GTUG is a good group
Mark M.
the SV GTUG is bigger than my home town
Kathy V.
Mark, Thanks for all your help.
11:00 AM
Mark M.
Kathy: sure, sorry I didn't have better answers for some of your questions
and that's a wrap for today
David
Yes. I have one app, but it displays two icons because of another activity in my app. Do you have any suggestions how to remove the extra icon? I think it is due to the setContentView in another Activity.
Mark M.
if the icons in question are in the launcher, it is because you put the LAUNCHER <intent-filter> in both activities in the manifest
David
Thanks.
Mark M.
the next office hours chat is tomorrow, 4pm Eastern
have a pleasant day, everyone!
Kathy V.
has left the room
David
has left the room
fitz
the android meetup group is even bigger
fitz
has left the room
Mark M.
turned off guest access

Monday, February 28

 

Office Hours

People in this transcript

  • David
  • fitz
  • Kathy Van Torne
  • Mark Murphy