[android-developers] How to calculate sound sample duration using SoundPool / AudioManager construct
Hi, Have had this problem for a while now. I am using SoundPool / AudioManager combination to load 30 audio samples (for a sound sampling app) and it's working great ! But, now I need to add the information about every sample's duration in the GUI. Have looked through the docs and couldn't find the answer :( I am using .ogg format. Any hints ? Thanks, Hatch -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
[android-developers] Re: ViewFlipper seamless transition (like the activity fly in/out)
Never mind. Was an internal bug. Works as specified. Cheers, Hatch On Nov 17, 8:38 am, Hatch tomislav.hecimo...@gmail.com wrote: Hi. I just get this. I would like the ViewFlipper animation to look (almost) the same as the native Activity show/disappear. I currently have fly-out-to-left and fly-in-from-right animations when user clicks Next, but the animation is not smooth. *Out to left:* Animation outtoLeft = new TranslateAnimation( Animation.RELATIVE_TO_PARENT, 0.0f, Animation.RELATIVE_TO_PARENT, -1.0f, Animation.RELATIVE_TO_PARENT, 0.0f, Animation.RELATIVE_TO_PARENT, 0.0f); outtoLeft.setDuration(msDuration); outtoLeft.setInterpolator(new AccelerateInterpolator()); *In from right:* Animation inFromRight = new TranslateAnimation( Animation.RELATIVE_TO_PARENT, +1.0f, Animation.RELATIVE_TO_PARENT, 0.0f, Animation.RELATIVE_TO_PARENT, 0.0f, Animation.RELATIVE_TO_PARENT, 0.0f); inFromRight.setDuration(msDuration); inFromRight.setInterpolator(new AccelerateInterpolator()); But the animation is ugly since flipper first does the fly-out and after that fly-in. How can I set them to render at the same time ? Cheers, Hatch -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
[android-developers] Re: ViewFlipper jump to 'page'
I guess RTFM was in order. Thanks for the tip. Cheers, Hatch On Nov 17, 9:19 am, Brad Gies rbg...@gmail.com wrote: flipper.setDisplayedChild(1); Sincerely, Brad Gies --- Bistro Bot - Bistro Blurbhttp://bgies.com http://nocrappyapps.comhttp://bistroblurb.com http://forcethetruth.comhttp://ihottonight.com --- Everything in moderation, including abstinence (paraphrased) Every person is born with a brain... Those who use it well are the successful happy ones - Brad Gies Adversity can make or break you... It's your choice... Choose wisely - Brad Gies Never doubt that a small group of thoughtful, committed people can change the world. Indeed. It is the only thing that ever has - Margaret Mead On 16/11/2010 11:32 PM,Hatchwrote: Is it possible to tell the flipper to jump to a given view instead of navigating using showNext() and showPrevious() ? I would like my ViewFlipper to start at page N instead of the first one. Cheers, Hatch -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
[android-developers] ViewFlipper jump to 'page'
Is it possible to tell the flipper to jump to a given view instead of navigating using showNext() and showPrevious() ? I would like my ViewFlipper to start at page N instead of the first one. Cheers, Hatch -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
[android-developers] ViewFlipper seamless transition (like the activity fly in/out)
Hi. I just get this. I would like the ViewFlipper animation to look (almost) the same as the native Activity show/disappear. I currently have fly-out-to-left and fly-in-from-right animations when user clicks Next, but the animation is not smooth. *Out to left:* Animation outtoLeft = new TranslateAnimation( Animation.RELATIVE_TO_PARENT, 0.0f, Animation.RELATIVE_TO_PARENT, -1.0f, Animation.RELATIVE_TO_PARENT, 0.0f, Animation.RELATIVE_TO_PARENT, 0.0f); outtoLeft.setDuration(msDuration); outtoLeft.setInterpolator(new AccelerateInterpolator()); *In from right:* Animation inFromRight = new TranslateAnimation( Animation.RELATIVE_TO_PARENT, +1.0f, Animation.RELATIVE_TO_PARENT, 0.0f, Animation.RELATIVE_TO_PARENT, 0.0f, Animation.RELATIVE_TO_PARENT, 0.0f); inFromRight.setDuration(msDuration); inFromRight.setInterpolator(new AccelerateInterpolator()); But the animation is ugly since flipper first does the fly-out and after that fly-in. How can I set them to render at the same time ? Cheers, Hatch -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
[android-developers] Re: Spinner/drum roller control like native Clock app has for choosing hours/minutes
Thank you Mark, Brad. I will look into the http://code.google.com/p/android-wheel/ The javascript solution looks too tedious :) Cheers, Hatch On Nov 13, 1:25 am, Brad Gies rbg...@gmail.com wrote: I needed the same thing awhile ago and couldn't find a good implementation of it anywhere. What I came up with was I embedded a WebView control in my AlertDialog, and used Javascript to control the spinner. What I did was create a web page with the information I wanted to scroll in the background and moved it up and down with the Javascript. It works well.. and looks good, but it was a pain to program. Hope you find an easier way. There was a fairly long thread on it on (I think) osdir.com.. and I took the basic idea from there. Sincerely, Brad Gies --- Bistro Bot - Bistro Blurbhttp://bgies.com http://nocrappyapps.comhttp://bistroblurb.com http://forcethetruth.comhttp://ihottonight.com --- Everything in moderation, including abstinence (paraphrased) Every person is born with a brain... Those who use it well are the successful happy ones - Brad Gies Adversity can make or break you... It's your choice... Choose wisely - Brad Gies Never doubt that a small group of thoughtful, committed people can change the world. Indeed. It is the only thing that ever has - Margaret Mead On 12/11/2010 3:17 AM,Hatchwrote: Hi all. I cannot find a corresponding control anywhere. The control I am interested in is iPhone's spinner. It's much simpler to use than Android's TimePicker. Since I see that native Clock app has it, does anyone know how is that control called and how can one use it in his app ? Thanks, Hatch -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
[android-developers] Spinner/drum roller control like native Clock app has for choosing hours/minutes
Hi all. I cannot find a corresponding control anywhere. The control I am interested in is iPhone's spinner. It's much simpler to use than Android's TimePicker. Since I see that native Clock app has it, does anyone know how is that control called and how can one use it in his app ? Thanks, Hatch -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
[android-developers] Re: color banding. can't get over it :(
Thank you all for your input. Here's the solution: http://stuffthathappens.com/blog/2010/06/04/android-color-banding/ in short: Window.setFormat(PixelFormat.RGBA_); ! Cheers, Hatch On Nov 5, 6:10 am, Adam Hammer adamhamm...@gmail.com wrote: Since you use it in a ImageView I do not know how to set the bitmap preferences. You will probably have to load the Bitmap in code, and then assign it to the ImageView once loaded. E.g. BitmapFactory.Options myOptions = new BitmapFactory.Options(); myOptions.inDither = true; myOptions.inScaled = false; myOptions.inPreferredConfig = Bitmap.Config.ARGB_; myOptions.inDither = false; myOptions.inPurgeable = true; preparedBitmap = BitmapFactory.decodeResource(CTX.getResources(), R.drawable.myImage, myOptions); new line --- MyImageView.setImageBitmap(preparedBitmap); I don't know if you can specify image loading configs in the xml for a ImageView. On Nov 4, 1:33 am,Hatchtomislav.hecimo...@gmail.com wrote: Great Your reply gives me hope :) But can you provide me with more information on how to do it ? I have a gradient alpha png. I just use it in imageView inside an XML resource. I don't set the dither option (although have tried both true and false options with same result) And I get the bands. Do I need to draw the image by hand, and which API must I use in that case ? Regards, Hatch On Nov 4, 1:19 am, Adam Hammer adamhamm...@gmail.com wrote: It get's banded because Android automatically decodes images based on your screen, and not based on the actual image. Why decode a 2048x2048 image when it's showing on a 800x480 screen. This I assume is to save cpu cycles and speed up image decoding where it normally will not have a issue. When you are doing compositing though it does make a difference, and you need to be specific as to how you want the image decoded. Like I said before, you need to manually define your options to ensure it uses ARGB_ when decoding the image, disable dithering and scaling. Do this and you will no longer have banding. Adam On Nov 2, 1:01 am,Hatchtomislav.hecimo...@gmail.com wrote: Yes, Thank you for your replies. I have read the article but it doesn't explain why alpha enabled resource get's banded :( Is there a way to know exactly which RGB is used in the png ? BTW the dither option didn't work in the XML nor in the code. On Oct 30, 2:04 am, Lance Nanek lna...@gmail.com wrote: I saw an interesting article on avoiding this the other day:http://android.nakatome.net/2010/04/bitmap-basics.html On Oct 29, 7:01 pm,Hatchtomislav.hecimo...@gmail.com wrote: Seems my original post (ugly pngs...) somehow disappeared :( nvm. I have a problem with a png resource that has gradient fade-out alpha. The png looks great in the emulator, but displays an artefact known as color banding (http://en.wikipedia.org/wiki/Colour_banding) Has anyone surpassed this issue ? My designer wants to trop a shadow behind his icons, and that's where the bands appear. What are my options ? Thanks Hatch BTW is there any way to see all my posts here on google groups ? -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
[android-developers] Re: How to override native dialog's theme ?
Thank you. If anyone else has a better idea, pls be so kind ... Cheers, Hatch On Nov 11, 7:35 am, Kumar Bibek coomar@gmail.com wrote: I am not sure about this. But I guess, you will have to override the default long click action and drop in your Custom context menu there and handle the events. On Tue, Nov 9, 2010 at 8:27 PM, Hatch tomislav.hecimo...@gmail.com wrote: ah :( Yes. that's the native copy/paste dialog. So there is no way to resolve those parts that are gray/black on the posted image ? Then the themes aren't that flexible, are they ? Ok, can you give me a clue on how can to disable native copy/paste and replace it with custom ones ? Thank you for your input. Regards, Hatch On Nov 9, 2:44 pm, Kumar Bibek coomar@gmail.com wrote: Are you referring to the Copy Paste dialog that comes up when EditText is long clicked? If that is the case, you will have to first disable the default dialog and use your own custom dialog and implement the Copy Paste functionality. On Tue, Nov 9, 2010 at 6:57 PM, Hatch tomislav.hecimo...@gmail.com wrote: Here's how the native popup looks like: http://postimage.org/image/t59v7udg/ Anyone has an idea on what I failed to override in the themes.xml (besides item name=android:background@color/background/item) I am creating all my dialogs by hand to avoid this, and now I found out that simple coply/paste dialog will look ... well bad :) Any hints ? Cheers Hatch -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.comandroid-developers%2Bunsubs cr...@googlegroups.comandroid-developers%2Bunsubs cr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -- Kumar Bibekhttp://techdroid.kbeanie.comhttp://www.kbeanie.com -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.comandroid-developers%2Bunsubs cr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -- Kumar Bibekhttp://techdroid.kbeanie.comhttp://www.kbeanie.com -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
[android-developers] How to override native dialog's theme ?
Here's how the native popup looks like: http://postimage.org/image/t59v7udg/ Anyone has an idea on what I failed to override in the themes.xml (besides item name=android:background@color/background/item) I am creating all my dialogs by hand to avoid this, and now I found out that simple coply/paste dialog will look ... well bad :) Any hints ? Cheers Hatch -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
[android-developers] Re: How to override native dialog's theme ?
ah :( Yes. that's the native copy/paste dialog. So there is no way to resolve those parts that are gray/black on the posted image ? Then the themes aren't that flexible, are they ? Ok, can you give me a clue on how can to disable native copy/paste and replace it with custom ones ? Thank you for your input. Regards, Hatch On Nov 9, 2:44 pm, Kumar Bibek coomar@gmail.com wrote: Are you referring to the Copy Paste dialog that comes up when EditText is long clicked? If that is the case, you will have to first disable the default dialog and use your own custom dialog and implement the Copy Paste functionality. On Tue, Nov 9, 2010 at 6:57 PM, Hatch tomislav.hecimo...@gmail.com wrote: Here's how the native popup looks like: http://postimage.org/image/t59v7udg/ Anyone has an idea on what I failed to override in the themes.xml (besides item name=android:background@color/background/item) I am creating all my dialogs by hand to avoid this, and now I found out that simple coply/paste dialog will look ... well bad :) Any hints ? Cheers Hatch -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.comandroid-developers%2Bunsubs cr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -- Kumar Bibekhttp://techdroid.kbeanie.comhttp://www.kbeanie.com -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
[android-developers] Re: color banding. can't get over it :(
Great Your reply gives me hope :) But can you provide me with more information on how to do it ? I have a gradient alpha png. I just use it in imageView inside an XML resource. I don't set the dither option (although have tried both true and false options with same result) And I get the bands. Do I need to draw the image by hand, and which API must I use in that case ? Regards, Hatch On Nov 4, 1:19 am, Adam Hammer adamhamm...@gmail.com wrote: It get's banded because Android automatically decodes images based on your screen, and not based on the actual image. Why decode a 2048x2048 image when it's showing on a 800x480 screen. This I assume is to save cpu cycles and speed up image decoding where it normally will not have a issue. When you are doing compositing though it does make a difference, and you need to be specific as to how you want the image decoded. Like I said before, you need to manually define your options to ensure it uses ARGB_ when decoding the image, disable dithering and scaling. Do this and you will no longer have banding. Adam On Nov 2, 1:01 am,Hatchtomislav.hecimo...@gmail.com wrote: Yes, Thank you for your replies. I have read the article but it doesn't explain why alpha enabled resource get's banded :( Is there a way to know exactly which RGB is used in the png ? BTW the dither option didn't work in the XML nor in the code. On Oct 30, 2:04 am, Lance Nanek lna...@gmail.com wrote: I saw an interesting article on avoiding this the other day:http://android.nakatome.net/2010/04/bitmap-basics.html On Oct 29, 7:01 pm,Hatchtomislav.hecimo...@gmail.com wrote: Seems my original post (ugly pngs...) somehow disappeared :( nvm. I have a problem with a png resource that has gradient fade-out alpha. The png looks great in the emulator, but displays an artefact known as color banding (http://en.wikipedia.org/wiki/Colour_banding) Has anyone surpassed this issue ? My designer wants to trop a shadow behind his icons, and that's where the bands appear. What are my options ? Thanks Hatch BTW is there any way to see all my posts here on google groups ? -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
[android-developers] Device name ?
Is there a way to get/set a generic device name ? My app will offer the user an option to use the same app on several devices and they will be aware of each other through server. 1) Is there anything in the APIs to allow me to fetch some kind of friendly device name (cannot be OS/model since user might have the same on both devices) ? 2) AFAICT the only option is to use Bluetooth name but how can I fetch my device name in code ? (and it's a nag do explain the user to use bluetooth just to set the name of the device) Regards, Hatch -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
[android-developers] Re: Device name ?
Yup, Already investigated both approaches and none fit our model. But now I know that there's nothing I can do. Thank you for your replies. On Nov 4, 10:39 am, Kostya Vasilyev kmans...@gmail.com wrote: There are user-friendly strings in Build.OS, but they are not unique to a particular device, only to all devices having the same make / model. Perhaps you could let the user customize the name in your application, using strings from Build.OS as a default / starting point. -- Kostya Vasilyev --http://kmansoft.wordpress.com 04.11.2010 12:26 пользователь Mathias Lin m...@mathiaslin.com написал: You could use the SubscriberId / IMSI, but it cannot be detected with all SIM cards, depends on the SIM card. Or you can use the IMEI, the device id: TelephonyManager mTelephonyMgr = (TelephonyManager) context.getSystemService(Context.TELEPHONY_SERVICE); String imei = mTelephonyMgr.getDeviceId(); But it's just a number, nothing really 'user friendly'. On Nov 4, 4:36 pm, Hatch tomislav.hecimo...@gmail.com wrote: Is there a way to get/set a gener... -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
[android-developers] Adding table row by inflating does not take table's settings
Hi all. I have a table layout with a few predefined rows in it. Each row has only two columns. Now I need to dynamically add additional rows in it. I have two problems: 1) When programmatically inflating, I cannot set the index of the newly created row (I want it in place 'n') 2) After inflation, the inserted (actually appended) row doesn't listen to parent table's stretch column property. So here are my questions: q1) Can I set the place where to insert the inflated row programatically ? q2) Why doesn't the new row inflate properly (the second column is not shown because the first column doesn't contains a TextView with fill_parent. In the end I need the first column to occupy 80% of the screen width, and the second column remaining 20%. q3) is that doable with programmatic row insertions ? Regards, Hatch -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
[android-developers] Re: Adding table row by inflating does not take table's settings
I'll reply to myself. a1) public void addView (View child, int index) a2) care for the padding and styles set for the main table and the child row you are inserting a3) it's definitely doable. Hope I helped someone On Nov 4, 11:03 am, Hatch tomislav.hecimo...@gmail.com wrote: Hi all. I have a table layout with a few predefined rows in it. Each row has only two columns. Now I need to dynamically add additional rows in it. I have two problems: 1) When programmatically inflating, I cannot set the index of the newly created row (I want it in place 'n') 2) After inflation, the inserted (actually appended) row doesn't listen to parent table's stretch column property. So here are my questions: q1) Can I set the place where to insert the inflated row programatically ? q2) Why doesn't the new row inflate properly (the second column is not shown because the first column doesn't contains a TextView with fill_parent. In the end I need the first column to occupy 80% of the screen width, and the second column remaining 20%. q3) is that doable with programmatic row insertions ? Regards, Hatch -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
[android-developers] background and resize option
Hi all. I am having problems with a layout my designer set for me to do. Here's the idea: +--+ | | +--+--+--+--+ +--+ | || | | | | 1 | | 2 | | || | | | +--+--+--+--+ +--+ +---+ (I'm not sure how this will look since there is no monospace setting in google groups :( ) In short: The screen has two main parts: 1 and 2 Both of them have 6 rows. But part one has 4 columns, and part 2 has only one column. Each cell contains only one image icon. *The problem*: The background of element 1 must be a rounded rectangle while element 2 has no background. Does anyone have in mind how to accomplish this ? Why is it such a problem ? The whole 'table' is stretchable so it fills out the screen. So there is no way for me to grab the 1 and set the background and maintain the alignment between 1 and 2 at the same time. Any hints ? -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
[android-developers] Re: color banding. can't get over it :(
Yes, Thank you for your replies. I have read the article but it doesn't explain why alpha enabled resource get's banded :( Is there a way to know exactly which RGB is used in the png ? BTW the dither option didn't work in the XML nor in the code. On Oct 30, 2:04 am, Lance Nanek lna...@gmail.com wrote: I saw an interesting article on avoiding this the other day:http://android.nakatome.net/2010/04/bitmap-basics.html On Oct 29, 7:01 pm,Hatchtomislav.hecimo...@gmail.com wrote: Seems my original post (ugly pngs...) somehow disappeared :( nvm. I have a problem with a png resource that has gradient fade-out alpha. The png looks great in the emulator, but displays an artefact known as color banding (http://en.wikipedia.org/wiki/Colour_banding) Has anyone surpassed this issue ? My designer wants to trop a shadow behind his icons, and that's where the bands appear. What are my options ? Thanks Hatch BTW is there any way to see all my posts here on google groups ? -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
[android-developers] color banding. can't get over it :(
Seems my original post (ugly pngs...) somehow disappeared :( nvm. I have a problem with a png resource that has gradient fade-out alpha. The png looks great in the emulator, but displays an artefact known as color banding (http://en.wikipedia.org/wiki/Colour_banding) Has anyone surpassed this issue ? My designer wants to trop a shadow behind his icons, and that's where the bands appear. What are my options ? Thanks Hatch BTW is there any way to see all my posts here on google groups ? -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
[android-developers] ugly looking shaded png. premultiplied alpha messed it up ?
Hi all. I load an 'alpha enabled' png icon and use it in the layout xml file. In simulator everything looks excellent ! But when I try it on the Device (des...@froyo 2.2) it looks BAD :( The icon itself is ok but the fading out alpha (shade) looks like it's been rendered in cga graphics :) The shade fades out in steps rather then linearly making an aureola effect. The iPhone experts working beside me informed me that iPhone used to have this problem and the source was premultiplied alpha done automagically by the environment. iPhone (so they tell me) later on offerred an option to turn premultiplication off, and the issue was closed. Here I go rambling... 1) In short, does anyone know if premultiplication really is causing my problem ? 2) What should I tell my designer to use to create nice fade out/shade effect ? 3) can i add shade to my icons in XML / code ? 4) I will try adding the png in raw (and changing the extension, just in case) and load it at runtime 5) Any other suggestions ? -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
[android-developers] Re: Location API. Detecting proximity to a given point
Yup. did that in the mean time. Thx for the tip. Although I have other questions, I will poste them in a new thread. Thank you for your help Regards Tomislav On Oct 18, 11:47 pm, TreKing treking...@gmail.com wrote: On Mon, Oct 18, 2010 at 5:52 AM, Hatch tomislav.hecimo...@gmail.com wrote: Am I missing something, or that's the only way ? That proximity alert take a PendingIntent, into which you can shove whatever data your little heart desires - including some way of ID'ing the location that generated the alert. --- -- TreKing http://sites.google.com/site/rezmobileapps/treking - Chicago transit tracking app for Android-powered devices -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
[android-developers] Registering for proximity alert doesn't work for more than one Location.
Hi all. I am trying to register to several proximity alerts. Here's an excerpt: FOR EACH location: { Intent intent = new Intent(context, Service_locationUpdated.class); // remember which location is it intent.putExtra(Service_locationUpdated.MSG_LOCATION_UPDATED_EXTRA_LOCATION_ID, locationInformation.getInternalID()); // prepare new PendingIntent pIntent = PendingIntent.getService(aApplication, 0, intent, 0); lm.addProximityAlert(location.getLatitude(), location.getLongitude(), location.getRadius(), -1L, pIntent); } And when I change the location, the service doesn't get started :( BUT ! if i put a break; after adding only one proximityAlert, everything works just fine. So does anyone have a clue why it works for one and not for more locations? Am I missing a flag or something while creating the intents ? -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
[android-developers] Google maps: please fetch me a location
Hi. Excuse my noobishness, but I cannot find an answer on how to preform 'get location' operation on google maps. I don't need any special map view and just need the user to pick a location from google maps application. I found (http://developer.android.com/guide/appendix/g-app- intents.html) that you can start google maps app on a given location. Since the list of intent on that page is incomplete, I wonder, where can one find the complete list of intents that google maps can respond to ? In short, my app requires a user to pick some location from a map. Do I have to create a specialized MapView for this ? Thanks -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
[android-developers] Re: Registering for proximity alert doesn't work for more than one Location.
Great ! My conclusion was that the system somehow regarder the intents as 'invalid' (why else would it work for only one?). Thank you for shedding more light on the subject. I would never look at the filterEquals docs myself. It's working now. (I just changed the type) Cheers, Tomislav On Oct 19, 7:20 pm, TreKing treking...@gmail.com wrote: On Tue, Oct 19, 2010 at 2:04 AM, Hatch tomislav.hecimo...@gmail.com wrote: So does anyone have a clue why it works for one and not for more locations? Probably because you're creating the same PendingIntent, as far as the system is concerned. Read this:http://developer.android.com/reference/android/content/Intent.html#fi... You should differentiate your Intents somehow - perhaps by using setData(). --- -- TreKing http://sites.google.com/site/rezmobileapps/treking - Chicago transit tracking app for Android-powered devices -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
[android-developers] Re: Google maps: please fetch me a location
Thank you. It makes me happy to know I am not reinventing the wheel ;) Regards Hatch On Oct 19, 1:40 pm, Mark Murphy mmur...@commonsware.com wrote: On Tue, Oct 19, 2010 at 3:39 AM,Hatchtomislav.hecimo...@gmail.com wrote: Since the list of intent on that page is incomplete, I wonder, where can one find the complete list of intents that google maps can respond to ? That is the complete list of documented and supported Intents that Google Maps honors. In short, my app requires a user to pick some location from a map. Do I have to create a specialized MapView for this ? Yes, sorry. -- Mark Murphy (a Commons Guy)http://commonsware.com|http://github.com/commonsguyhttp://commonsware.com/blog|http://twitter.com/commonsguy Android App Developer Books:http://commonsware.com/books -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
[android-developers] Re: Flint only part of the view
Thanks. I did that in the meantime and it works fine. thx! On Oct 13, 11:27 am, Kumar Bibek coomar@gmail.com wrote: Don't put your toolbar inside your flipper then So that it won't change when the flipper changes the views. On Wed, Oct 13, 2010 at 2:56 PM, Hatch tomislav.hecimo...@gmail.com wrote: Hi all. I have a fixed toolbar on the bottom of my screen and would like it to remain static while flipping through views. Is that possible ? Currently my flipper will change the whole screen including the toolbar (and a custom made view that displays the currently active view, those small circles with the active one slightly larger size and brighter color ). Regards, Tomislav -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.comandroid-developers%2Bunsubs cr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -- Kumar Bibekhttp://techdroid.kbeanie.comhttp://www.kbeanie.com -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
[android-developers] Location API. Detecting proximity to a given point
Hi all. I would like to 'be notified' when the user enters a given range of certain Geo point(s). For instance, one point could be School. When User is within 500m of the School he would get a notification (for example.) Is this the way to go: 1) Turn on LocationListener in a background service and ask for location update every 5 minutes (is that a lot?) on location update: 2) check whether new location is better than the last one 3) calculate distance of current location and School location. 4) if within range: do something. Am I transgressing something with such design ? The Idea is to have a kind of a 'proximity sensor' to certain predefined points. Thank you. -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
[android-developers] Re: Location API. Detecting proximity to a given point
Wow, that's great! I missed those docs. Thank you. On Oct 18, 10:45 am, Filip Havlicek havlicek.fi...@gmail.com wrote: Hi Hatch, you can always try thishttp://developer.android.com/reference/android/location/LocationManag..., double, float, long, android.app.PendingIntent) although I'm not sure about battery consumption compared to your proposed method. Best regards, Filip Havlicek 2010/10/18 Hatch tomislav.hecimo...@gmail.com Hi all. I would like to 'be notified' when the user enters a given range of certain Geo point(s). For instance, one point could be School. When User is within 500m of the School he would get a notification (for example.) Is this the way to go: 1) Turn on LocationListener in a background service and ask for location update every 5 minutes (is that a lot?) on location update: 2) check whether new location is better than the last one 3) calculate distance of current location and School location. 4) if within range: do something. Am I transgressing something with such design ? The Idea is to have a kind of a 'proximity sensor' to certain predefined points. Thank you. -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.comandroid-developers%2Bunsubs cr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
[android-developers] Re: Location API. Detecting proximity to a given point
One more thing (looks related enough not to start a new topic:) The Location manager triggers the appropriate intents just fine (way to go !), but it seems I have to manually match with the original location. For instance, I request 'proximity reporting' to locations A, B, and C but by their parameters (lon, lat, and radius) The Location manager will trigger the proximity entering and provide me with location X. So now I need to run through all my locations to match which one's boundaries have been transgressed. Am I missing something, or that's the only way ? Thanks again. On Oct 18, 10:51 am, Hatch tomislav.hecimo...@gmail.com wrote: Wow, that's great! I missed those docs. Thank you. On Oct 18, 10:45 am, Filip Havlicek havlicek.fi...@gmail.com wrote: HiHatch, you can always try thishttp://developer.android.com/reference/android/location/LocationManag..., double, float, long, android.app.PendingIntent) although I'm not sure about battery consumption compared to your proposed method. Best regards, Filip Havlicek 2010/10/18Hatchtomislav.hecimo...@gmail.com Hi all. I would like to 'be notified' when the user enters a given range of certain Geo point(s). For instance, one point could be School. When User is within 500m of the School he would get a notification (for example.) Is this the way to go: 1) Turn on LocationListener in a background service and ask for location update every 5 minutes (is that a lot?) on location update: 2) check whether new location is better than the last one 3) calculate distance of current location and School location. 4) if within range: do something. Am I transgressing something with such design ? The Idea is to have a kind of a 'proximity sensor' to certain predefined points. Thank you. -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.comandroid-developers%2Bunsubs cr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
[android-developers] Flint only part of the view
Hi all. I have a fixed toolbar on the bottom of my screen and would like it to remain static while flipping through views. Is that possible ? Currently my flipper will change the whole screen including the toolbar (and a custom made view that displays the currently active view, those small circles with the active one slightly larger size and brighter color ). Regards, Tomislav -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
[android-developers] Closing current activity when an action happens in custom view.
Hi all. I have a toolbar view set for most of my activities. The toolbar has several buttons which all trigger certain intents. Now, the problem is: how can I close current activity before starting another one ? Problem 1) Activity cones For instance one of the buttons ('A') starts activity A. Activity A also has toolbar. If you press on the 'A' button, a new A activity will be started. I suppose I can look at Activity.getInstanceCount(), right ? Problem 2) Unnecessary activities The activity X is not needed any more if the opts for A. I just want A then. How can I remove X from toolbar which only has access to context ? I, of course could find toolbar view inside activity X and override the onClicks, but in general this would mean doing so for all my activities !? Am I on the right track ? -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
[android-developers] How to remove layout element
Hi, Sorry if this has been answered before, but I just cannot input the right term into search box to find the answer. Here's what's bugging me. To generalize a given screen as much as possible, I include several elements (button1, text1, button2, text2) Depending on the internal state, I would like to remove (for instance) element button2. Now, I've already tried (although in vain) by using button2.setVisibility(INVISIBLE). The element was not shown, but it consumed the screen area never the less (so it was there, but just not drawn nor active). 1) How do I completely remove button2 from layout ? 2) What's the proper way to deal with such requirement ? 2a) Create a common (most generic) layout and then remove elements by state or 2b) Create the least common denominator layout and then add elements by state ? Thank you, Regards Hatch -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
[android-developers] Re: How to remove layout element
Wow, that was fast. Way to go. It works as you suggested. Thanks ! But do you now if it's better practice to have a A) one big layout - remove elements by hand when necessary B) small and common layout - add elements when needed. Thank you Hatch On Sep 23, 1:57 pm, Kostya Vasilyev kmans...@gmail.com wrote: Use setVisibility(View.GONE) GONE views are ignored during layout process and so do not consume layout space. -- Kostya 23.09.2010 15:53, Hatch пишет: Now, I've already tried (although in vain) by using button2.setVisibility(INVISIBLE). The element was not shown, but it consumed the screen area never the less (so it was there, but just not drawn nor active). -- Kostya Vasilyev -- WiFi Manager + pretty widget --http://kmansoft.wordpress.com -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
[android-developers] Re: Testing C2DM service on Android 2.2 emulator
Been trying for ages (at least, so it seems) I am using Google APIs 8,rev2. Keep getting the same result. Something just isn't geting digested in the auth layer :( Any tips ? (scenario: simple c2dm registration - failing, chrome to phone - working ok !) Regards, Hatch On Aug 19, 12:15 pm, xianhao lv xianhao...@gmail.com wrote: Try Google APIs by Google Inc., Android API 8, revision2 if SDK api8 revision 2 doesn't work. On Thu, Aug 19, 2010 at 6:09 PM, xianhao lv xianhao...@gmail.com wrote: Maybe you should use SDK platform Android 2.2 API 8 revision 2 to have a try. But I got the following errors: 8-19 09:56:08.777: DEBUG/GoogleLoginService(171): onBind: Intent { act=android.accounts.AccountAuthenticator cmp=com.google.android.gsf/.loginservice.GoogleLoginService } 08-19 09:56:10.557: WARN/DefaultRequestDirector(171): Authentication error: Unable to respond to any of these challenges: {} 08-19 09:56:10.557: DEBUG/C2DMRegistrar(171): [C2DMRegistrar.22] register: http error 401 08-19 09:56:10.557: ERROR/C2DMRegistrar(171): [C2DMReg] handleRequest caught org.apache.http.auth.AuthenticationException 08-19 09:56:10.647: DEBUG/GoogleLoginService(171): onBind: Intent { act=android.accounts.AccountAuthenticator cmp=com.google.android.gsf/.loginservice.GoogleLoginService } 08-19 09:56:10.967: DEBUG/GoogleLoginService(171): onBind: Intent { act=android.accounts.AccountAuthenticator cmp=com.google.android.gsf/.loginservice.GoogleLoginService } 08-19 09:56:36.147: WARN/DeviceRegistrar(275): Registration error Read error: Failure in SSL library, usually a protocol error On Thu, Aug 12, 2010 at 4:24 AM, Mark Murphy mmur...@commonsware.comwrote: Make sure you have set up a Google account in the emulator (Settings Accounts). On Wed, Aug 11, 2010 at 4:00 PM, Sean Liao wirelessw...@gmail.com wrote: I am having the same problem ... any solution or any pointer? On Tue, Jul 6, 2010 at 9:59 AM, guligo igors.gulbins...@gmail.com wrote: Hi guys, I am playing around with C2DM service. What I am concerned about is that I cannot test my device-side application from Android 2.2 emulator. The application was built more or less according to http://code.google.com/android/c2dm/index.htmldoc, but when register intent is sent from application, Logcat shows this: Unable to start service Intent { act=com.google.android.c2dm.intent.REGISTER (has extras) }: not found I also tried to run chrometophone and jumpnote applications and the result is the same when registring device. Any ideas? ...main question probably - is it possible to test C2DM service from Android emulator? Thanks in advance! -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.comandroid-developers%2Bunsubs cr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.comandroid-developers%2Bunsubs cr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -- Mark Murphy (a Commons Guy) http://commonsware.com|http://github.com/commonsguy http://commonsware.com/blog|http://twitter.com/commonsguy Android 2.2 Programming Books:http://commonsware.com/books -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.comandroid-developers%2Bunsubs cr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en