Re: [android-developers] How to make Activity with Theme.Dialog modal?

2012-12-14 Thread Blake B.
Try this in your manifest.  When I set them both to 8, the behavior goes 
away:



Blake


On Friday, December 14, 2012 4:19:07 PM UTC-6, Mark Murphy (a Commons Guy) 
wrote:
>
> On Fri, Dec 14, 2012 at 4:59 PM, Blake B. > 
> wrote: 
> > I'd be curious to know if you still don't see it.  Maybe there is 
> something 
> > else I'm doing. 
>
> No, still no change -- taps outside the dialog-themed activity have no 
> effect. android:windowCloseOnTouchOutside is having no effect, true or 
> false, so for the moment I am chalking this up to a flawed scrap app 
> that I am trying this out with. 
>
> -- 
> Mark Murphy (a Commons Guy) 
> http://commonsware.com | http://github.com/commonsguy 
> http://commonsware.com/blog | http://twitter.com/commonsguy 
>
> Aqui estão alguns sites onde você pode perguntar ou responder dúvidas 
> sobre desenvolvimento de aplicações para Android: 
> http://www.andglobe.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

Re: [android-developers] How to make Activity with Theme.Dialog modal?

2012-12-14 Thread Blake B.
Odd.  May be related to my use of a drawable.xml for the dialog window 
background:

*AndroidManifest.xml entry:*



*styles.xml entry:*

<item name="android:windowBackground">@drawable/rounded</item>
<item name="android:windowCloseOnTouchOutside">false</item>  <!-- 
API level 11 -->


*rounded.xml:*

http://schemas.android.com/apk/res/android"; >











I'd be curious to know if you still don't see it.  Maybe there is something 
else I'm doing.


On Friday, December 14, 2012 3:45:32 PM UTC-6, Mark Murphy (a Commons Guy) 
wrote:
>
> On Fri, Dec 14, 2012 at 4:32 PM, Blake B. > 
> wrote: 
> > Well, this may not be a problem on older APIs after all.  I was testing 
> on 
> > 4.x devices (Moto Xoom and Samsung GSIII) and touch events outside of 
> the 
> > dialog (the Activity using Theme.Dialog) cause the dialog activity to be 
> > cancelled and the events do get passed back to the background activity. 
>
> Curiously, I can't reproduce that behavior on a 4.1 emulator, or a 
> Nexus S, or a Galaxy Nexus. 
>
> -- 
> Mark Murphy (a Commons Guy) 
> http://commonsware.com | http://github.com/commonsguy 
> http://commonsware.com/blog | http://twitter.com/commonsguy 
>
> Aqui estão alguns sites onde você pode perguntar ou responder dúvidas 
> sobre desenvolvimento de aplicações para Android: 
> http://www.andglobe.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

Re: [android-developers] How to make Activity with Theme.Dialog modal?

2012-12-14 Thread Blake B.
Mark, thanks for the quick reply.

Well, this may not be a problem on older APIs after all.  I was testing on 
4.x devices (Moto Xoom and Samsung GSIII) and touch events outside of the 
dialog (the Activity using Theme.Dialog) cause the dialog activity to be 
cancelled and the events do get passed back to the background activity. 
 Adding the "android:windowCloseOnTouchOutside" in the style definition 
prevents this in API 11 and higher devices.

However, it appears that in older devices (I've tested on emulators using 
2.2 and 2.3.3), the touch events do NOT get passed back by default, so 
there may not an issue for me here.  This default behavior may have changed 
in new versions of Android.

One exception I have seen is for the original Kindle Fire, running 2.3.4 (I 
have not tested on the newer Kindle devices).  It handles a touch outside 
the dialog as a "back" button press.  In the logcat I see this message: 
"Simulating 
back button on press outside dialog" followed by the call to 
onKeyDown(keyCode, KeyEvent), which is simple to override and ignore for 
keyCode 
== KeyEvent.KEYCODE_BACK.

So, I believe between these 3 different behaviors, I am able to prevent the 
issue in my original post.  Hopefully this is helpful to others along the 
way!

Regards,
Blake 


On Friday, December 14, 2012 3:05:39 PM UTC-6, Mark Murphy (a Commons Guy) 
wrote:
>
> On Fri, Dec 14, 2012 at 3:54 PM, Mark Murphy 
> > 
> wrote: 
> > On Fri, Dec 14, 2012 at 3:41 PM, Blake B. > 
> wrote: 
> >> I have an Activity that is using the Theme.Dialog theme to present a 
> dialog 
> >> to the user.  By default however, when the user touches outside of the 
> >> dialog window, the touch event is passed to the views of the Activity 
> in the 
> >> background. 
> > 
> > AFAIK, it should not do that. Do you have a sample app that 
> > demonstrates this behavior? 
>
> I just tossed together a quick scrap app, with a regular Activity 
> launching a Theme.Dialog activity. Nothing special, and on a 2.2 
> emulator, touch events outside the dialog are not delivered to the 
> visible regular activity. Leastways, the buttons I try tapping on in 
> the non-foreground activity do not respond. 
>
> So, if you can reproduce your findings in something we can look at, 
> that would be very interesting. 
>
> -- 
> Mark Murphy (a Commons Guy) 
> http://commonsware.com | http://github.com/commonsguy 
> http://commonsware.com/blog | http://twitter.com/commonsguy 
>
> Aqui estão alguns sites onde você pode perguntar ou responder dúvidas 
> sobre desenvolvimento de aplicações para Android: 
> http://www.andglobe.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 make Activity with Theme.Dialog modal?

2012-12-14 Thread Blake B.
I have an Activity that is using the Theme.Dialog theme to present a dialog 
to the user.  By default however, when the user touches outside of the 
dialog window, the touch event is passed to the views of the Activity in 
the background.  For API level 11 devices and higher, I can use the 
following attribute in the Theme's style definition:

   false

but of course this does not work on older (2.x) devices.  I have also tried 
these calls in onCreate():

   getWindow().setFlags(LayoutParams.FLAG_NOT_TOUCH_MODAL, 
LayoutParams.FLAG_NOT_TOUCH_MODAL);
   getWindow().setFlags(LayoutParams.FLAG_WATCH_OUTSIDE_TOUCH, 
LayoutParams.FLAG_WATCH_OUTSIDE_TOUCH);

Although these will notify my dialog Activity a onTouchEvent() call with 
a ACTION_OUTSIDE action, the event still gets passed back to the background 
activity and views.  How can I make my Theme.Dialog Activity modal without 
using a Dialog class explicitly?

Blake

-- 
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: SeekBar bug? Calling setThumb(drawable) makes thumb disappear

2011-06-15 Thread Blake B.
Thanks for the hint, Romain!  Here is the code that now works:

final int drawableId = R.drawable.thumb1;
final Drawable d = getResources().getDrawable(drawableId);
d.setBounds(new Rect(0, 0, d.getIntrinsicWidth(),
d.getIntrinsicHeight()));   <== this is the new call
slider.setThumb(d);

Regards,
Blake


On Jun 15, 12:58 pm, Romain Guy  wrote:
> You probably need to call setBounds() on the drawable to give it a size?
>
>
>
>
>
>
>
>
>
> On Wed, Jun 15, 2011 at 6:03 AM, Blake B.  wrote:
> > I'm using a custom image for the Thumb on my SeekBar.  I want to
> > change the image at some points in my app, but whenever
> > setThumb(drawable) is called, the Thumb image disappears.  The seekbar
> > still works, but it's like the Thumb is invisible.
>
> > I've found a few other questions regarding this, but no answers, and
> > there is no Issue being tracked that I could find.  Does anyone know
> > what I'm doing wrong, or how to work around this?  Any Googlers that
> > are familiar with SeekBar?
>
> > Thanks,
> > Blake
>
> > --
> > 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
>
> --
> Romain Guy
> Android framework engineer
> romain...@android.com
>
> Note: please don't send private questions to me, as I don't have time
> to provide private support.  All such questions should be posted on
> public forums, where I and others can see and answer them

-- 
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] SeekBar bug? Calling setThumb(drawable) makes thumb disappear

2011-06-15 Thread Blake B.
I'm using a custom image for the Thumb on my SeekBar.  I want to
change the image at some points in my app, but whenever
setThumb(drawable) is called, the Thumb image disappears.  The seekbar
still works, but it's like the Thumb is invisible.

I've found a few other questions regarding this, but no answers, and
there is no Issue being tracked that I could find.  Does anyone know
what I'm doing wrong, or how to work around this?  Any Googlers that
are familiar with SeekBar?

Thanks,
Blake

-- 
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] Does LG Eve phone support AudioRecord sample rate > 8kHz?

2010-05-26 Thread Blake B.
I have a user that is reporting that he can not record on his LG Eve
phone at a sample rate greater than 8kHz (8000Hz works, but nothing
higher such as 44100, 22050, 11025).  Do any of you have an LG Eve
phone?  Have you tried to use
AudioRecord.getMinBufferSize(sampleRateInHz, channelConfig,
audioFormat) with a sample rate greater than 8kHz?  If it is
supported, the getMinBufferSize() call should return a value > 0.

Thanks,
Blake

-- 
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 Seeding Program for Top Android Market Developers

2010-03-05 Thread Blake B.
Just got my confirmation email also.  Rock on!

I really would prefer the N1 since I'm with T*Mo, but I have an Open
GL app that barfed all over when I ran it on my mother-in-law's Droid,
so I could definitely use the Droid as a test platform, but not an
everyday phone (at least right now).   :-(



On Mar 5, 8:47 pm, Greg Donald  wrote:
> On Fri, Mar 5, 2010 at 8:18 PM, Mario Zechner  wrote:
> > I just received the confirmation e-mail.
>
> Same here.  Yay.
>
> --
> Greg Donald
> destiney.com | gregdonald.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: Device Seeding Program for Top Android Market Developers

2010-03-04 Thread Blake B.
Great idea, Al.  I've run into issues (as many of you have as well)
both with differing phone hardware behavior and differing Android
behavior between versions.  It's very frustrating, so maybe we can
help each other here and prevent further frustration and potential bad-
press for Android.

Waiting for my N1/Droid,
Blake
Livo Recorder Pro


On Mar 4, 7:21 am, Al Sutton  wrote:
> If you're one of the chosen few can I suggest you show your
> appreciation by helping out other developers who are having problems
> specifically with 2.x devices and haven't been so fortunate.
>
> It's only a suggestion, but my view is that that Google have just
> saved the chosen ones $500+, so even if you think you're time is worth
> $100 an hour it might be worth putting in 5 hours of "community
> service" as a way of showing Google that these kind of actions are
> much appreciated and that the benefit of them is felt beyond the
> chosen ones.
>
> Al.
>
> On 4 Mar, 07:28, Join  wrote:
>
> > Very helpful.
>
> > On Mar 4, 3:20 pm, Yin  wrote:
>
> > > guys, try 2 check 
> > > this:http://sites.google.com/site/developermarketandroidgiveaway/faq-Hide 
> > > quoted text -
>
> > - Show quoted text -

-- 
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: Call Recording in Andriod ?

2009-12-14 Thread Blake B.
There is an open issue related to this (missing) feature.  #2117.  If
you want to encourage this to take a higher priority, "star" the issue
to be notified of changes.  The number of people following the issue
seems to give some priority to the issue in Google's eyes.

http://code.google.com/p/android/issues/detail?id=2117


On Dec 14, 1:22 am, tuku  wrote:
> hi
>         i also want same thing
>         if u  get any idea then plz help me out
>
> bye takecare
>
> On Dec 9, 4:50 pm, Y2U  wrote:
>
> > Hello Guys i want to know can we record phone calls in android and if
> > yes then can anybody provide me with some sample code or any other
> > info regarding this.
>
> > i read somewhere that call recording is blocked by android but even
> > then there are some call recording apps in the market for android.
> > so please help asap.. :)
>
> > thanks in advance.
>
> > Usman

-- 
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: Alternatives to Multitouch

2009-07-19 Thread Blake B.

I would agree with the previous post - the early demo video on the HTC
Magic of using a circular motion for zooming looked even more useful
than pinching, since it can be done more easily with a single hand on
the phone.  It doesn't appear to have made it to the initial releas of
the phone, but may still come in a future update.  The usage looked
like this:

Double-tap screen displays a gray circle overlay with a button on the
circle. CW circle motion = Zoom In,  CCW circle motion = Zoom Out.

Looks useful, could become a standard on the phone...
http://www.androidcentral.com/android-has-sweet-circular-zoom-video


On Jul 19, 1:07 pm, Zsolt Váradi  wrote:
> And if we're talking about circles, there was that HTC image viewer
> where you can zoom in and out by doing a circle gesture. Add some
> realtime feedback to it, and it's interesting IMO :)
>
>
>
> On Sunday, July 19, 2009, Alexey Krasnoriadtsev  
> wrote:
>
> > double tap, that circles through predefined zoom levels.- Hide quoted text -
>
> - Show quoted text -
--~--~-~--~~~---~--~~
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 do you handle orientation change for a Cupcake widget?

2009-06-30 Thread Blake B.

Does this imply that EVERY RemoteViews update that I apply to my
widget should be capable of COMPLETELY initializing the correct
current state of every component on the widget?

Right now I am sending more frequent minor updates (that don't include
re-setting button listeners, button images, etc), and have attempted
to only do a full "refresh" on orientation changes, but the sequence
of the ACTION_CONFIGURATION_CHANGED event and the widget UI inflation
and layout does not seem to support sending a "full refresh"
RemoteViews update at the time of that event.  I send a RemoteViews
update that resets the button listeners, but it appears that the
"cached" RemoteViews is being used instead and my update is lost (or
at least, applied to the previous widget on the old orientation).  The
effect is, after an orientation change my ImageButtons don't work and
they don't reflect any updates to their images.

So, in order to guarantee preserving widget state on orientation
changes, should every RemoteViews update completely reset the state of
all widget components?  Or am I missing something here?

Thanks,
Blake

On Jun 21, 12:20 am, Jeff Sharkey  wrote:
> >    When it is initially created, the onUpdate() method of my
> > AppWidgetProvider calls views.setOnClickPendingIntent(buttonID,
> > pendingIntent) to register for my button events, but when the
> > orientation changes, new buttons are created and I don't have an
> > opportunity to re-register the "onClick" listeners. What is the proper
> > way to do this?
>
> The system keeps a cache of the last RemoteViews update you sent, and
> reapplies it to the newly inflated landscape layout automatically.  :)
>
> --
> Jeff Sharkey
> jshar...@android.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: Update widget from code

2009-06-29 Thread Blake B.

I believe only the same application can push updates to a widget.  I
know I wouldn't want other apps to be able to send updates to my
widget directly.

The proper approach would be to handle it with your AppWidgetProvider
subclass (remember this is simply a BroadcastReceiver with some help
for widget-specific events).  Register it for a
"com.whatever.CALENDAR_UPDATE" event, and allow other apps/services/
whoever post requests to add/change/remove calendar events.  Your
widget provider class can then do any security or sanity checks on the
request before posting the update to the on-screen widget itself.

Blake

On Jun 28, 8:05 pm, Aaron  wrote:
> Is there a way to push an update to a widget from another activity?
> It seems like in order to use the AppWidgetManager.updateAppWidget
> method, it has to be within the widget code itself?  Can i push an
> update to the widget from the app personally?  I tried this and it
> didn't do anything
>
>     // Push update for this widget to the home screen
>             ComponentName thisWidget = new ComponentName(this,
> WordWidget.class);
>             AppWidgetManager manager = AppWidgetManager.getInstance
> (this);
>             manager.updateAppWidget(thisWidget, updateViews);
>
> For example, if I have a calendar app that has a calendar widget..how
> do i push changes to the widget if I update an event on the calendar?
> I have been looking at the calendar and calendar widget code but I
> have yet to figure out how to do this.
>
> Thanks.
>
> On Jun 8, 12:14 am, Teo  wrote:
>
> > I've got a related question (or i'm not getting this right). The way i
> > see it, onReceive can be used to handle interface events, but what
> > pending intent do i need to attach to a button so that onReceive can
> > be triggered?
>
> > Thanks,
> > Teo
>
> > On Apr 23, 1:05 am, Al  wrote:
>
> > > That worked, thanks.
>
> > > On Apr 22, 7:36 pm, Tom Gibara  wrote:
>
> > > > That's true, but notice that his service has no dependency on the class
> > > > implementing the onUpdatemethod, in principal anything in the 
> > > > application
> > > > could invoke that service. You'll find the appwidgetids available via 
> > > > the
> > > > getAppWidgetIds() on AppWidgetManager.
> > > > Tom.
>
> > > > 2009/4/22 Al 
>
> > > > > In Jeff's example, the service is started from his onUpdatemethod,
> > > > > which is called by AppWidgetProvider. This is different from what I'd
> > > > > like to do, I'd like topushan update to thewidgetfrom inside my
> > > > > activity, but with the correct int[] values.
>
> > > > > On Apr 22, 7:16 pm, Tom Gibara  wrote:
> > > > > > Yes, you canpushupdatesto your widgets any time by obtaining an
> > > > > > AppWidgetManager.
> > > > > > Jeff Sharkey posted an example that performs an update within a 
> > > > > > Service.
> > > > > It
> > > > > > includes this code that might help.
>
> > > > > >             //Pushupdate for thiswidgetto the home screen
> > > > > >             ComponentName thisWidget = new ComponentName(this,
> > > > > > WordWidget.class);
> > > > > >             AppWidgetManager manager =
> > > > > AppWidgetManager.getInstance(this);
> > > > > >             manager.updateAppWidget(thisWidget, updateViews);
>
> > > > > > The relevant methods you are looking for are on the AppWidgetManager
> > > > > class.
> > > > > > In this case everywidgetis being updated in the same way so this 
> > > > > > code
> > > > > > takes advantage of the updateAppWidgetmethod(which doesn't take an
> > > > > array
> > > > > > of ids, butupdatesallwidgetinstances identically).
>
> > > > > > Jeff's blog post is at:
>
> > > > > >http://android-developers.blogspot.com/2009/04/introducing-home-scree...
>
> > > > > > Tom.
>
> > > > > > 2009/4/22 Al 
>
> > > > > > > Depending on what I do in my application, I might want to force an
> > > > > > > update on mywidget. I've have had a poke around and can't seem to
> > > > > > > find any API for doing a manual update. At the moment, I have a
> > > > > > > function that sends a broadcast and my onReceive does this:
>
> > > > > > >       �...@override
> > > > > > >        public void onReceive(Context context, Intent intent) {
>
> > > > > > >                String action = intent.getAction();
>
> > > > > > >                if (action != null && 
> > > > > > > action.equals(UPDATE_ACTION)) {
> > > > > > > //internal
> > > > > > > static string
> > > > > > >                        onUpdate(context,
> > > > > > > AppWidgetManager.getInstance(context), new int[]
> > > > > > > { 0 });
> > > > > > >                }
>
> > > > > > >                else {
> > > > > > >                        super.onReceive(context, intent);
> > > > > > >                }
> > > > > > >        }
>
> > > > > > > Is there a proper way to do this, which sents the int array to the
> > > > > > > correct values? Or do I have to do it like this instead?
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google

[android-developers] Re: How to disable Buttons on a Widget

2009-06-19 Thread Blake B.

Hi Jeff,
I've tried the two options you mentioned below for disabling a
button on a widget, but although they can have the appearance of a
disabled button from the image, the button is still in an enabled
state and does not have the standard Android appearance of a disabled
button.  I looked into swapping out two buttons using VISIBLE/GONE,
but I don't see that "enabled" state is supported in the XML layout
definition for an ImageButton.  Am I missing somthing?  I don't see
any way to put a button into a disabled state on a widget.


Not directly, but you could send a widget update that swaps out the
drawable used and clears the PendingIntent.  Or, keep two buttons in
your layout, and visible/gone them as needed.


Thanks,
Blake

On Jun 16, 7:19 pm, "Blake B."  wrote:
> I suspected as much with the Google Search "widget".  Thanks for
> clarifying.  And the results of the grep for @RemotableViewMethod
> annotation are very useful.
>
> Great responses to every question!  Thanks Jeff!
>
> On Jun 16, 3:25 pm, Jeff Sharkey  wrote:
>
>
>
> > > Is it possible to disable a button on a Cupcake desktop widget?
>
> > Not directly, but you could send a widget update that swaps out the
> > drawable used and clears the PendingIntent.  Or, keep two buttons in
> > your layout, and visible/gone them as needed.
>
> > > The current Google Search widget disables the search button until a
> > > user enters text, then the button is disabled.  Is this only allowed
> > > for "special widgets", or is there an approach available to third-
> > > party widgets?
>
> > The Google Search bar on the desktop looks and feels like a widget,
> > but it isn't a real widget.  It lives directly in the Launcher app,
> > which is how it does things like auto completion.  Other
> > AppWidgetHosts are free to include their custom elements like this:
>
> >http://d.android.com/reference/android/appwidget/AppWidgetManager.htm...
>
> > > More generally, is there a list somewhere of the allowed / disallowed
> > > calls to widget views via the RemoteViews.set() approach?  I've
> > > also encountered that "setSelected" and some others are not allowed.
>
> > The allowed methods are simply marked with the @RemotableViewMethod
> > annotation, here's a quick grep across the Cupcake tree:
>
> >http://pastebin.com/f45b5130a
>
> > --
> > Jeff Sharkey
> > jshar...@android.com- Hide quoted text -
>
> - Show quoted text -
--~--~-~--~~~---~--~~
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 do you handle orientation change for a Cupcake widget?

2009-06-19 Thread Blake B.

Hi,
Maybe I'm missing something obvious, but how do you handle
orientation changes for a Cupcake desktop widget?
When it is initially created, the onUpdate() method of my
AppWidgetProvider calls views.setOnClickPendingIntent(buttonID,
pendingIntent) to register for my button events, but when the
orientation changes, new buttons are created and I don't have an
opportunity to re-register the "onClick" listeners. What is the proper
way to do this?

Thanks,
Blake
--~--~-~--~~~---~--~~
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 do you handle orientation change for a Cupcake widget?

2009-06-19 Thread Blake B.

Hi,
Maybe I'm missing something obvious, but how do you handle
orientation changes for a Cupcake desktop widget?
When it is initially created, the onUpdate() method of my
AppWidgetProvider calls views.setOnClickPendingIntent(buttonID,
pendingIntent) to register for my button events, but when the
orientation changes, new buttons are created and I don't have an
opportunity to re-register the "onClick" listeners. What is the proper
way to do this?

Thanks,
Blake
--~--~-~--~~~---~--~~
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 disable Buttons on a Widget

2009-06-16 Thread Blake B.

I suspected as much with the Google Search "widget".  Thanks for
clarifying.  And the results of the grep for @RemotableViewMethod
annotation are very useful.

Great responses to every question!  Thanks Jeff!


On Jun 16, 3:25 pm, Jeff Sharkey  wrote:
> > Is it possible to disable a button on a Cupcake desktop widget?
>
> Not directly, but you could send a widget update that swaps out the
> drawable used and clears the PendingIntent.  Or, keep two buttons in
> your layout, and visible/gone them as needed.
>
> > The current Google Search widget disables the search button until a
> > user enters text, then the button is disabled.  Is this only allowed
> > for "special widgets", or is there an approach available to third-
> > party widgets?
>
> The Google Search bar on the desktop looks and feels like a widget,
> but it isn't a real widget.  It lives directly in the Launcher app,
> which is how it does things like auto completion.  Other
> AppWidgetHosts are free to include their custom elements like this:
>
> http://d.android.com/reference/android/appwidget/AppWidgetManager.htm...
>
> > More generally, is there a list somewhere of the allowed / disallowed
> > calls to widget views via the RemoteViews.set() approach?  I've
> > also encountered that "setSelected" and some others are not allowed.
>
> The allowed methods are simply marked with the @RemotableViewMethod
> annotation, here's a quick grep across the Cupcake tree:
>
> http://pastebin.com/f45b5130a
>
> --
> Jeff Sharkey
> jshar...@android.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] Can you disable/enable Buttons on a Cupcake desktop widget?

2009-06-16 Thread Blake B.

(updated subject)

On Jun 16, 11:36 am, "Blake B."  wrote:
> Is it possible to disable a button on a Cupcake desktop widget?
>
> When I attempt to use the RemoteViews.setBoolean(myButtonId,
> "setEnabled", false) approach, I get an error saying that calling
> "setEnabled" is not permitted via RemoteViews.
>
> The current Google Search widget disables the search button until a
> user enters text, then the button is disabled.  Is this only allowed
> for "special widgets", or is there an approach available to third-
> party widgets?
>
> More generally, is there a list somewhere of the allowed / disallowed
> calls to widget views via the RemoteViews.set() approach?  I've
> also encountered that "setSelected" and some others are not allowed.
>
> Thanks,
> Blake
--~--~-~--~~~---~--~~
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 disable Buttons on a Widget

2009-06-16 Thread Blake B.

Is it possible to disable a button on a Cupcake desktop widget?

When I attempt to use the RemoteViews.setBoolean(myButtonId,
"setEnabled", false) approach, I get an error saying that calling
"setEnabled" is not permitted via RemoteViews.

The current Google Search widget disables the search button until a
user enters text, then the button is disabled.  Is this only allowed
for "special widgets", or is there an approach available to third-
party widgets?

More generally, is there a list somewhere of the allowed / disallowed
calls to widget views via the RemoteViews.set() approach?  I've
also encountered that "setSelected" and some others are not allowed.

Thanks,
Blake
--~--~-~--~~~---~--~~
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: My good god, bugs in Android brick phone, and it's not difficult to reproduce...

2009-06-04 Thread Blake B.

Can any of the Google team comment on this?

I found similar reports on the T-Mobile discussion threads, but no
work-arounds other than wipe or replace your phone.  I've opened
defect 2864: http://code.google.com/p/android/issues/detail?id=2864


On Jun 2, 8:32 pm, "Blake B."  wrote:
> I have not installed any system builds other than those pushed by T-
> Mobile OTA.  So, 1.5 was the first update since 1.1.  The OS is
> completely stock, non-rooted.
>
> I have both aHome and dxTop desktops installed, and have developed
> widgets that support both of those desktops, pre-Cupcake.  However, I
> have NOT developed any 1.5-compatible widget yet, so would be suprised
> if this affected the Android system, unless these desktops are somehow
> updated a widget list/registry that is shared by the Android default
> desktop?  I haven't heard of such a thing, but then, I haven't had a
> chance to dig into the 1.5 release much yet.
>
> Blake
>
> On Jun 2, 3:22 pm, Jeff Sharkey  wrote:
>
> > When you saw this error, was it a direct upgrade from the last-OTA'ed
> > release, or had you installed other builds in the meantime without
> > wiping data?  I think there was an obscure bug if you somehow had
> > allocated, but unmanaged, appWidgetIds.
>
> > j
>
> > On Tue, Jun 2, 2009 at 5:19 AM, Blake B.  wrote:
>
> > > Any update on this?  I'm encountering the samecrashand would rather
> > > not wipe my phone if I don't have to.  Safe mode does not work.  Phone
> > > (stock G1) just keeps cycling at the Android logo image and I have to
> > > pull the battery to kill it.
>
> > > I received theCupcakeOTA update on Saturday, and yesterday (Monday)
> > > was the first time I rebooted the phone after the update.  So, I've
> > > never had a successful reboot withCupcake.  The offending call is in
> > > com.android.server.AppWidgetService.readStateFromFileLocked
> > > (AppWidgetService.java:972), getting IndexOutOfBoundsException.
>
> > > (BTW, great work onCupcake.  er except for this of course.   :-)
>
> > > My stacktrace is the same as AndroidApp's:
>
> > > 
> > > 06-01 22:14:51.893: VERBOSE/WifiStateTracker(62): Connection to
> > > supplicant established, state=SCANNING
> > > 06-01 22:14:51.903: VERBOSE/WifiStateTracker(62): Changing supplicant
> > > state: SCANNING ==> SCANNING
> > > 06-01 22:14:51.913: INFO/SystemServer(62): Starting Location Manager.
> > > 06-01 22:14:51.943: DEBUG/GpsLocationProvider(62): enable
> > > 06-01 22:14:51.953: VERBOSE/WifiMonitor(62): Event [Trying to
> > > associate with 00:1d:5a:d4:eb:d9 (SSID='2WIRE456' freq=2412 MHz)]
> > > 06-01 22:14:51.953: VERBOSE/WifiMonitor(62): Event [CTRL-EVENT-STATE-
> > > CHANGE id=-1 state=3]
> > > 06-01 22:14:51.953: VERBOSE/WifiStateTracker(62): Changing supplicant
> > > state: SCANNING ==> ASSOCIATING
> > > 06-01 22:14:51.963: DEBUG/GpsLocationProvider(62): GpsEventThread
> > > starting
> > > 06-01 22:14:51.973: DEBUG/GpsLocationProvider(62): NetworkThread
> > > starting
> > > 06-01 22:14:51.973: DEBUG/GpsLocationProvider(62): NetworkThread wait
> > > for network
> > > 06-01 22:14:51.993: INFO/SystemServer(62): Starting Search Service.
> > > 06-01 22:14:52.003: INFO/SystemServer(62): Starting Checkin Service.
> > > 06-01 22:14:52.003: INFO/SystemServer(62): Starting Wallpaper Service
> > > 06-01 22:14:52.013: DEBUG/WallpaperService(62): WallpaperService
> > > startup
> > > 06-01 22:14:52.023: INFO/SystemServer(62): Starting Audio Service
> > > 06-01 22:14:52.083: DEBUG/AudioHardwareMSM72XX(35): setVoiceVolume
> > > (0.60)
> > > 06-01 22:14:52.083: INFO/AudioHardwareMSM72XX(35): Setting in-call
> > > volume to 3 (available range is 0 to 5)
> > > 06-01 22:14:52.163: DEBUG/AudioHardwareMSM72XX(35): setVoiceVolume
> > > (1.00)
> > > 06-01 22:14:52.163: INFO/AudioHardwareMSM72XX(35): Setting in-call
> > > volume to 5 (available range is 0 to 5)
> > > 06-01 22:14:52.183: DEBUG/dalvikvm(62): Trying to load lib /system/lib/
> > > libsoundpool.so 0x0
> > > 06-01 22:14:52.203: DEBUG/dalvikvm(62): Added shared lib /system/lib/
> > > libsoundpool.so 0x0
> > > 06-01 22:14:52.233: INFO/SystemServer(62): Starting HeadsetObserver
> > > 06-01 22:14:52.293: INFO/SystemServer(62): Starting AppWidget Service
> > > 06-01 22:14:52.763: DEBUG/dalvikvm(62): GC freed 4358 objects / 252408
> > > bytes in 417ms
> > > 06-01 22:14:52.883: INFO/W

[android-developers] Re: My good god, bugs in Android brick phone, and it's not difficult to reproduce...

2009-06-02 Thread Blake B.

I have not installed any system builds other than those pushed by T-
Mobile OTA.  So, 1.5 was the first update since 1.1.  The OS is
completely stock, non-rooted.

I have both aHome and dxTop desktops installed, and have developed
widgets that support both of those desktops, pre-Cupcake.  However, I
have NOT developed any 1.5-compatible widget yet, so would be suprised
if this affected the Android system, unless these desktops are somehow
updated a widget list/registry that is shared by the Android default
desktop?  I haven't heard of such a thing, but then, I haven't had a
chance to dig into the 1.5 release much yet.

Blake

On Jun 2, 3:22 pm, Jeff Sharkey  wrote:
> When you saw this error, was it a direct upgrade from the last-OTA'ed
> release, or had you installed other builds in the meantime without
> wiping data?  I think there was an obscure bug if you somehow had
> allocated, but unmanaged, appWidgetIds.
>
> j
>
>
>
>
>
> On Tue, Jun 2, 2009 at 5:19 AM, Blake B.  wrote:
>
> > Any update on this?  I'm encountering the samecrashand would rather
> > not wipe my phone if I don't have to.  Safe mode does not work.  Phone
> > (stock G1) just keeps cycling at the Android logo image and I have to
> > pull the battery to kill it.
>
> > I received theCupcakeOTA update on Saturday, and yesterday (Monday)
> > was the first time I rebooted the phone after the update.  So, I've
> > never had a successful reboot withCupcake.  The offending call is in
> > com.android.server.AppWidgetService.readStateFromFileLocked
> > (AppWidgetService.java:972), getting IndexOutOfBoundsException.
>
> > (BTW, great work onCupcake.  er except for this of course.   :-)
>
> > My stacktrace is the same as AndroidApp's:
>
> > 
> > 06-01 22:14:51.893: VERBOSE/WifiStateTracker(62): Connection to
> > supplicant established, state=SCANNING
> > 06-01 22:14:51.903: VERBOSE/WifiStateTracker(62): Changing supplicant
> > state: SCANNING ==> SCANNING
> > 06-01 22:14:51.913: INFO/SystemServer(62): Starting Location Manager.
> > 06-01 22:14:51.943: DEBUG/GpsLocationProvider(62): enable
> > 06-01 22:14:51.953: VERBOSE/WifiMonitor(62): Event [Trying to
> > associate with 00:1d:5a:d4:eb:d9 (SSID='2WIRE456' freq=2412 MHz)]
> > 06-01 22:14:51.953: VERBOSE/WifiMonitor(62): Event [CTRL-EVENT-STATE-
> > CHANGE id=-1 state=3]
> > 06-01 22:14:51.953: VERBOSE/WifiStateTracker(62): Changing supplicant
> > state: SCANNING ==> ASSOCIATING
> > 06-01 22:14:51.963: DEBUG/GpsLocationProvider(62): GpsEventThread
> > starting
> > 06-01 22:14:51.973: DEBUG/GpsLocationProvider(62): NetworkThread
> > starting
> > 06-01 22:14:51.973: DEBUG/GpsLocationProvider(62): NetworkThread wait
> > for network
> > 06-01 22:14:51.993: INFO/SystemServer(62): Starting Search Service.
> > 06-01 22:14:52.003: INFO/SystemServer(62): Starting Checkin Service.
> > 06-01 22:14:52.003: INFO/SystemServer(62): Starting Wallpaper Service
> > 06-01 22:14:52.013: DEBUG/WallpaperService(62): WallpaperService
> > startup
> > 06-01 22:14:52.023: INFO/SystemServer(62): Starting Audio Service
> > 06-01 22:14:52.083: DEBUG/AudioHardwareMSM72XX(35): setVoiceVolume
> > (0.60)
> > 06-01 22:14:52.083: INFO/AudioHardwareMSM72XX(35): Setting in-call
> > volume to 3 (available range is 0 to 5)
> > 06-01 22:14:52.163: DEBUG/AudioHardwareMSM72XX(35): setVoiceVolume
> > (1.00)
> > 06-01 22:14:52.163: INFO/AudioHardwareMSM72XX(35): Setting in-call
> > volume to 5 (available range is 0 to 5)
> > 06-01 22:14:52.183: DEBUG/dalvikvm(62): Trying to load lib /system/lib/
> > libsoundpool.so 0x0
> > 06-01 22:14:52.203: DEBUG/dalvikvm(62): Added shared lib /system/lib/
> > libsoundpool.so 0x0
> > 06-01 22:14:52.233: INFO/SystemServer(62): Starting HeadsetObserver
> > 06-01 22:14:52.293: INFO/SystemServer(62): Starting AppWidget Service
> > 06-01 22:14:52.763: DEBUG/dalvikvm(62): GC freed 4358 objects / 252408
> > bytes in 417ms
> > 06-01 22:14:52.883: INFO/WindowManager(62): Menu key state: 0
> > safeMode=false
> > 06-01 22:14:52.913: INFO/WindowManager(62): Config changed:
> > { scale=1.0 imsi=0/0 locale=en_US touch=3 key=2/1/1 nav=3 orien=1 }
> > 06-01 22:14:52.943: DEBUG/PowerManagerService(62): system ready!
> > 06-01 22:14:52.963: WARN/ResourceType(62): No package identifier when
> > getting value for resource number 0x7f03
> > 06-01 22:14:52.983: WARN/ResourceType(62): No package identifier when
> > getting value for resource number 0x7f03000c
> > 06-01 22:14:52.993: WARN/ResourceType(62): No package identifier when
> > gettin

[android-developers] Re: My good god, bugs in Android brick phone, and it's not difficult to reproduce...

2009-06-02 Thread Blake B.

Any update on this?  I'm encountering the same crash and would rather
not wipe my phone if I don't have to.  Safe mode does not work.  Phone
(stock G1) just keeps cycling at the Android logo image and I have to
pull the battery to kill it.

I received the Cupcake OTA update on Saturday, and yesterday (Monday)
was the first time I rebooted the phone after the update.  So, I've
never had a successful reboot with Cupcake.  The offending call is in
com.android.server.AppWidgetService.readStateFromFileLocked
(AppWidgetService.java:972), getting IndexOutOfBoundsException.

(BTW, great work on Cupcake.  er except for this of course.   :-)

My stacktrace is the same as AndroidApp's:


06-01 22:14:51.893: VERBOSE/WifiStateTracker(62): Connection to
supplicant established, state=SCANNING
06-01 22:14:51.903: VERBOSE/WifiStateTracker(62): Changing supplicant
state: SCANNING ==> SCANNING
06-01 22:14:51.913: INFO/SystemServer(62): Starting Location Manager.
06-01 22:14:51.943: DEBUG/GpsLocationProvider(62): enable
06-01 22:14:51.953: VERBOSE/WifiMonitor(62): Event [Trying to
associate with 00:1d:5a:d4:eb:d9 (SSID='2WIRE456' freq=2412 MHz)]
06-01 22:14:51.953: VERBOSE/WifiMonitor(62): Event [CTRL-EVENT-STATE-
CHANGE id=-1 state=3]
06-01 22:14:51.953: VERBOSE/WifiStateTracker(62): Changing supplicant
state: SCANNING ==> ASSOCIATING
06-01 22:14:51.963: DEBUG/GpsLocationProvider(62): GpsEventThread
starting
06-01 22:14:51.973: DEBUG/GpsLocationProvider(62): NetworkThread
starting
06-01 22:14:51.973: DEBUG/GpsLocationProvider(62): NetworkThread wait
for network
06-01 22:14:51.993: INFO/SystemServer(62): Starting Search Service.
06-01 22:14:52.003: INFO/SystemServer(62): Starting Checkin Service.
06-01 22:14:52.003: INFO/SystemServer(62): Starting Wallpaper Service
06-01 22:14:52.013: DEBUG/WallpaperService(62): WallpaperService
startup
06-01 22:14:52.023: INFO/SystemServer(62): Starting Audio Service
06-01 22:14:52.083: DEBUG/AudioHardwareMSM72XX(35): setVoiceVolume
(0.60)
06-01 22:14:52.083: INFO/AudioHardwareMSM72XX(35): Setting in-call
volume to 3 (available range is 0 to 5)
06-01 22:14:52.163: DEBUG/AudioHardwareMSM72XX(35): setVoiceVolume
(1.00)
06-01 22:14:52.163: INFO/AudioHardwareMSM72XX(35): Setting in-call
volume to 5 (available range is 0 to 5)
06-01 22:14:52.183: DEBUG/dalvikvm(62): Trying to load lib /system/lib/
libsoundpool.so 0x0
06-01 22:14:52.203: DEBUG/dalvikvm(62): Added shared lib /system/lib/
libsoundpool.so 0x0
06-01 22:14:52.233: INFO/SystemServer(62): Starting HeadsetObserver
06-01 22:14:52.293: INFO/SystemServer(62): Starting AppWidget Service
06-01 22:14:52.763: DEBUG/dalvikvm(62): GC freed 4358 objects / 252408
bytes in 417ms
06-01 22:14:52.883: INFO/WindowManager(62): Menu key state: 0
safeMode=false
06-01 22:14:52.913: INFO/WindowManager(62): Config changed:
{ scale=1.0 imsi=0/0 locale=en_US touch=3 key=2/1/1 nav=3 orien=1 }
06-01 22:14:52.943: DEBUG/PowerManagerService(62): system ready!
06-01 22:14:52.963: WARN/ResourceType(62): No package identifier when
getting value for resource number 0x7f03
06-01 22:14:52.983: WARN/ResourceType(62): No package identifier when
getting value for resource number 0x7f03000c
06-01 22:14:52.993: WARN/ResourceType(62): No package identifier when
getting value for resource number 0x7f03
06-01 22:14:53.003: WARN/ResourceType(62): No package identifier when
getting value for resource number 0x7f030003
06-01 22:14:53.253: DEBUG/dalvikvm(62): GC freed 2153 objects / 118592
bytes in 235ms
06-01 22:14:53.263: WARN/dalvikvm(62): threadid=13: thread exiting
with uncaught exception (group=0x4000fe70)
06-01 22:14:53.273: ERROR/AndroidRuntime(62): Uncaught handler: thread
android.server.ServerThread exiting due to uncaught exception
06-01 22:14:53.273: ERROR/AndroidRuntime(62): *** EXCEPTION IN SYSTEM
PROCESS.  System will crash.
06-01 22:14:53.333: ERROR/AndroidRuntime(62):
java.lang.IndexOutOfBoundsException: Invalid location 1, size is 1
06-01 22:14:53.333: ERROR/AndroidRuntime(62): at
java.util.ArrayList.get(ArrayList.java:353)
06-01 22:14:53.333: ERROR/AndroidRuntime(62): at
com.android.server.AppWidgetService.readStateFromFileLocked
(AppWidgetService.java:972)
06-01 22:14:53.333: ERROR/AndroidRuntime(62): at
com.android.server.AppWidgetService.loadStateLocked
(AppWidgetService.java:750)
06-01 22:14:53.333: ERROR/AndroidRuntime(62): at
com.android.server.AppWidgetService.systemReady(AppWidgetService.java:
125)
06-01 22:14:53.333: ERROR/AndroidRuntime(62): at
com.android.server.ServerThread.run(SystemServer.java:346)
06-01 22:14:53.343: ERROR/AndroidRuntime(62): Crash logging skipped,
no checkin service
06-01 22:14:53.353: INFO/Process(62): Sending signal. PID: 62 SIG: 9
06-01 22:14:53.383: INFO/ServiceManager(30): service 'batteryinfo'
died
06-01 22:14:53.393: INFO/ServiceManager(30): service 'usagestats' died
06-01 22:14:53.393: INFO/ServiceManager(30): service
'telephony.registry' died
06-01 22:14:53.393: INFO/ServiceManager(3

[android-developers] Re: PendingIntent problem

2009-03-25 Thread Blake B.

To correct my previous statement, PendingIntents are cached by the
system, not Intents.  The note about how to differentiate Intents
still holds though, so if you need to replace a current PendingIntent
with a new PI that has a new Intent that only differs by its Extras,
be sure to use the flag FLAG_CANCEL_CURRENT so that the cached PI is
not used.


>From Intent.filterEquals(o):
Returns true if action, data, type, class, and categories are the
same.  <== note does not include Extras


>From PendingIntents javadoc:

 * A PendingIntent itself is simply a reference to a token
maintained by
 * the system describing the original data used to retrieve it.  This
means
 * that, even if its owning application's process is killed, the
 * PendingIntent itself will remain usable from other processes that
 * have been given it.  If the creating application later re-retrieves
the
 * same kind of PendingIntent (same operation, same Intent action,
data,
 * categories, and components, and same flags), it will receive a
PendingIntent
 * representing the same token if that is still valid, and can thus
call
 * {...@link #cancel} to remove it.


On Mar 25, 7:48 am, "Blake B."  wrote:
> Intents are cached by the system, and two Intents are not
> differentiated by their Extras.  So your two intents look like the
> same Intent and the second one is being tossed out.  You must differ
> Intents by their Action/Data/Category.  I will sometimes use the Data
> field to hold a simple ID that is not really a URI to make two intents
> appear different.  Look at the code for Intent.equals() I believe, and
> you will see that Extras are not considered.
>
> On Mar 24, 12:47 pm, "info+farm"  wrote:
>
> > Are not Google developers looking into this forum anymore?
>
> > Then, I will be missing the detailed answers.
>
> > Regards,
> > info+farm
>
> > On Mar 24, 3:17 pm, "info+farm"  wrote:
>
> > > Hello Mr. Murphy,
>
> > > I searched for it before sending my post and looked at
>
> > >http://groups.google.com/group/android-developers/browse_thread/threa...
> > > andhttp://groups.google.com/group/android-developers/browse_thread/threa...
>
> > > But both of them could not find the answer to the problem.
>
> > > I am afraidPendingIntenthas different Intent initialization(start
> > > ()), from the normal startActivity().
>
> > > I am a little bit confused,
>
> > > Regards,
> > > info+farm
>
> > > On Mar 23, 11:32 pm, Mark Murphy  wrote:
>
> > > > info+farm wrote:
> > > > > Am I the only one who is having this problem?
> > > > > Actually, I am going to find a workaround for this problem, but I
> > > > > would like to know what I am doing wrong.
>
> > > > I do not remember the answer, but I do know this was discussed on this
> > > > list within the past few months. Search the list forPendingIntentand
> > > > you will probably find it.
>
> > > > --
> > > > Mark Murphy (a Commons Guy)http://commonsware.com
> > > > Warescription: Three Android Books, Plus Updates, $35/Year
--~--~-~--~~~---~--~~
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: PendingIntent problem

2009-03-25 Thread Blake B.

Intents are cached by the system, and two Intents are not
differentiated by their Extras.  So your two intents look like the
same Intent and the second one is being tossed out.  You must differ
Intents by their Action/Data/Category.  I will sometimes use the Data
field to hold a simple ID that is not really a URI to make two intents
appear different.  Look at the code for Intent.equals() I believe, and
you will see that Extras are not considered.


On Mar 24, 12:47 pm, "info+farm"  wrote:
> Are not Google developers looking into this forum anymore?
>
> Then, I will be missing the detailed answers.
>
> Regards,
> info+farm
>
> On Mar 24, 3:17 pm, "info+farm"  wrote:
>
> > Hello Mr. Murphy,
>
> > I searched for it before sending my post and looked at
>
> >http://groups.google.com/group/android-developers/browse_thread/threa...
> > andhttp://groups.google.com/group/android-developers/browse_thread/threa...
>
> > But both of them could not find the answer to the problem.
>
> > I am afraidPendingIntenthas different Intent initialization(start
> > ()), from the normal startActivity().
>
> > I am a little bit confused,
>
> > Regards,
> > info+farm
>
> > On Mar 23, 11:32 pm, Mark Murphy  wrote:
>
> > > info+farm wrote:
> > > > Am I the only one who is having this problem?
> > > > Actually, I am going to find a workaround for this problem, but I
> > > > would like to know what I am doing wrong.
>
> > > I do not remember the answer, but I do know this was discussed on this
> > > list within the past few months. Search the list forPendingIntentand
> > > you will probably find it.
>
> > > --
> > > Mark Murphy (a Commons Guy)http://commonsware.com
> > > Warescription: Three Android Books, Plus Updates, $35/Year
--~--~-~--~~~---~--~~
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: Thread stopping

2009-02-18 Thread Blake B.

You don't need to do anything complicated - use Handler.postDelayed
(Runnable r, long delayMS) like Stoyan mentioned.

Be sure to keep a reference to your Runnable r so you can call
removeCallbacks(r) like Romain mentioned when your activity is pre-
empted before the posted Runnable executes.  This is also helpful in
that you can re-use r if you need to.  Nice and simple.


On Feb 18, 3:30 am, Stoyan Damov  wrote:
> ...or take care of threading properly - instead of Thread.sleep, use a
> monitor and wait on it with a timeout. Here's the pseudo code
> (catching InterruptedException omitted):
>
> // in your main thread
>
> // when you launch the secondary thread make sure it's running before
> you do anything else
> synchronized (secondaryThreadRunning)
> {
>     secondaryThread = new ...
>     secondaryThread.start();
>     secondaryThreadRunning.wait();
>
> }
>
> // before you exit the app (e.g. onStop)
> synchronized (secondaryThreadStopMonitor)
> {
>     secondaryThreadShouldStop = true;
>     secondaryThreadStopMonitor.notify();
>     secondaryThread.join(); // wait for it to finish
>
> }
>
> // 1st line in the secondary thread's run()
> // signal main thread we're up and running
> synchronized (secondaryThreadRunning)
> {
>     secondaryThreadRunning.notify();
>
> }
>
> // in the secondary thread where you want to wait and then post
> synchronized (secondaryThreadStopMonitor)
> {
>     secondaryThreadStopMonitor.wait(your timeout);
>     if (secondaryThreadShouldStop)
>     {
>         // break the loop (if you have one) and exit the thread (i.e.
> let it return from run())
>     }
>     else
>     {
>        // timed out, post to your handler [1]
>     }
>
> }
>
> [1] You might get a spurious wake here, so it's best to track the
> elapsed time manually
>
> In any case, make sure you're not doing too much work, it seems that
> you can simply use:
>
> Handler.postDelayed(Runnable r, long delayMillis) and in your handler
> do it again
>
> Cheers,
> Stoyan
>
>
>
> On Wed, Feb 18, 2009 at 7:48 AM, Romain Guy  wrote:
>
> > In your application's onPause/onStop/onDestroy simply use
> > Handle.removeCallbacks(Runnable).
>
> > On Tue, Feb 17, 2009 at 9:46 PM, Dilli  wrote:
>
> >> Hi all,
>
> >> I am developing a simple application with thread concept
>
> >> problem:
>
> >>  In one thread i write
>
> >>         {
> >>           Thread.sleep(1)  //10 sec sleep
> >>           m_handler.post(my_runnable);  // to post to run another
> >> runnable
> >>         }
>
> >>  before  the thread wake up ( <10 sec)  i stopped my application
> >> exiting my application
>
> >>  but the thread sleeped not killed and it wakes up after 10 sec and
> >> try to post message
> >>  and it causes exception.
>
> >>  is there any way to kill the threads those are in sleep mode while
> >> exiting the application ??
>
> >>  and prevent to post using m_handler.
>
> >>  Need suggetions
>
> >> Thank You..
>
> >> Dilli.
>
> > --
> > Romain Guy
> > Android framework engineer
> > romain...@android.com
>
> > Note: please don't send private questions to me, as I don't have time
> > to provide private support.  All such questions should be posted on
> > public forums, where I and others can see and answer them- Hide quoted text 
> > -
>
> - Show quoted text -
--~--~-~--~~~---~--~~
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: Selling your apps section in Market help

2009-02-16 Thread Blake B.

I'm not worried about the code migration - that's only a half-hour
work (max) with eclipse & Subversion.

I'm concerned about the user experience in transitioning their data to
the new paid version.  The user has data in user preferences and a
sqlLite database that they will expect to be able to continue to have
(as they have had in each free upgrade).  Both of these data are
private to the app belonging to the old package and cannot be accessed
by my new app (in the new package).  Is there a way around this that I
am not aware of?

Right now it seems users will have to go through an intermediate step
of downloading a new version of the free app that will be able to
export data to a public location on their SD Card that new new paid
version can then find an import.  Ick.



On Feb 16, 9:08 am, Al Sutton  wrote:
> You may need to refactor your code to change the package name to
> something line com.blah.nonfree.App and rebuild your apk.
>
> It would seem to offer the quickest solution.
>
> Al.
>
>
>
>
>
> Blake B. wrote:
> > Your interpretation would make more sense, but that doesn't seem to be
> > the way it's being done.
>
> > I don't have the option on my current app to change from free.  When I
> > unpublish it and attempt to "Upload an application", I have the option
> > to set a price, but the publish site won't allow me to upload my .apk
> > because it sees that that application package has already been
> > published, and asks that I "upgrade" that app.
>
> > Am I the only one that this was a suprise to?  I am really not looking
> > forward to the annoyed user comments & emails.  I had planned for a
> > much easier transition.  What are others doing to migrate data between
> > free & paid versions of an app?
>
> > On Feb 16, 8:39 am, Al Sutton  wrote:
>
> >> Developers could always add a couple of features and charge for the
> >> feature added version.
>
> >> Al.
>
> >> Blake B. wrote:
>
> >>> Ok, maybe I missed this along the way (or heard comments of this and
> >>> couldn't believe it to be true), but this statement seems clear in the
> >>> "Setting the price of applications" section:
>
> >>> "If you have previously published an application for free, you cannot
> >>> change it to have a price."
>
> >>> This seems to mean that any app that has been in the Market up to this
> >>> point that plans on charging a price now will have to re-package
> >>> itself as a new application.  If the app contains a database or other
> >>> private data not accessible to other apps, I suppose that means we
> >>> will have to release ANOTHER version of the FREE app that includes
> >>> some kind of support for exporting data, then have the user download/
> >>> install this version and run it IN ADDITION TO the new paid version if
> >>> they want to migrate their data to the new paid version?  This seems
> >>> like a major headache for users and developers alike.
>
> >>> Am I reading this correctly?
>
> >>> On Feb 16, 2:57 am, Al Sutton  wrote:
>
> >>>>http://market.android.com/support/bin/topic.py?topic=15867
>
> >>>> Highlights;
>
> >>>> - All fee information is shown in USD, GBP, EUR, AUD, and CAD so I think
> >>>> that tells us who is going to be able to sell apps in the coming months.
> >>>> - Allowable price ranges are $0.99 to $200 (YES $200 - Sheesh) or 0.50
> >>>> GBP to 100 GBP.
> >>>> - Chargebacks for less than $10 USD will be automatically charged back.
> >>>> - A $3 USD fee may be added to chargebacks on top of the refund.
> >>>> - The 24 hour refund period starts when the user has *downloaded* the
> >>>> app, not when they purchase it.
>
> >>>> --
> >>>> ==
> >>>> Funky Android Limited is registered in England & Wales with the
> >>>> company number  6741909. The registered head office is Kemp House,
> >>>> 152-160 City Road, London,  EC1V 2NX, UK.
>
> >>>> The views expressed in this email are those of the author and not
> >>>> necessarily those of Funky Android Limited, it's associates, or it's
> >>>> subsidiaries.
>
> >> --
> >> ==
> >> Funky Android Limited is registered in England & Wales with the
> >> company number  6741909. The registered head office is Kemp House,
> >> 152-160 City Road,

[android-developers] Re: Selling your apps section in Market help

2009-02-16 Thread Blake B.

Your interpretation would make more sense, but that doesn't seem to be
the way it's being done.

I don't have the option on my current app to change from free.  When I
unpublish it and attempt to "Upload an application", I have the option
to set a price, but the publish site won't allow me to upload my .apk
because it sees that that application package has already been
published, and asks that I "upgrade" that app.

Am I the only one that this was a suprise to?  I am really not looking
forward to the annoyed user comments & emails.  I had planned for a
much easier transition.  What are others doing to migrate data between
free & paid versions of an app?


On Feb 16, 8:39 am, Al Sutton  wrote:
> Developers could always add a couple of features and charge for the
> feature added version.
>
> Al.
>
>
>
>
>
> Blake B. wrote:
> > Ok, maybe I missed this along the way (or heard comments of this and
> > couldn't believe it to be true), but this statement seems clear in the
> > "Setting the price of applications" section:
>
> > "If you have previously published an application for free, you cannot
> > change it to have a price."
>
> > This seems to mean that any app that has been in the Market up to this
> > point that plans on charging a price now will have to re-package
> > itself as a new application.  If the app contains a database or other
> > private data not accessible to other apps, I suppose that means we
> > will have to release ANOTHER version of the FREE app that includes
> > some kind of support for exporting data, then have the user download/
> > install this version and run it IN ADDITION TO the new paid version if
> > they want to migrate their data to the new paid version?  This seems
> > like a major headache for users and developers alike.
>
> > Am I reading this correctly?
>
> > On Feb 16, 2:57 am, Al Sutton  wrote:
>
> >>http://market.android.com/support/bin/topic.py?topic=15867
>
> >> Highlights;
>
> >> - All fee information is shown in USD, GBP, EUR, AUD, and CAD so I think
> >> that tells us who is going to be able to sell apps in the coming months.
> >> - Allowable price ranges are $0.99 to $200 (YES $200 - Sheesh) or 0.50
> >> GBP to 100 GBP.
> >> - Chargebacks for less than $10 USD will be automatically charged back.
> >> - A $3 USD fee may be added to chargebacks on top of the refund.
> >> - The 24 hour refund period starts when the user has *downloaded* the
> >> app, not when they purchase it.
>
> >> --
> >> ==
> >> Funky Android Limited is registered in England & Wales with the
> >> company number  6741909. The registered head office is Kemp House,
> >> 152-160 City Road, London,  EC1V 2NX, UK.
>
> >> The views expressed in this email are those of the author and not
> >> necessarily those of Funky Android Limited, it's associates, or it's
> >> subsidiaries.
>
> --
> ==
> Funky Android Limited is registered in England & Wales with the
> company number  6741909. The registered head office is Kemp House,
> 152-160 City Road, London,  EC1V 2NX, UK.
>
> The views expressed in this email are those of the author and not
> necessarily those of Funky Android Limited, it's associates, or it's
> subsidiaries.- Hide quoted text -
>
> - Show quoted text -
--~--~-~--~~~---~--~~
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: A safer way of using SoundPool?

2009-02-16 Thread Blake B.

Great idea, Jon.  Thanks for sharing the code.  I'm about to start
work on sound in my game, so I'll look into using this.

Hopefully, Google realizes that many are using SoundPool and will keep
the existing API in place for a while, even if deprecated, long enough
to migrate apps.  I think we are all interested in keeping Android's
good name and not annoying users without need.


On Feb 16, 2:05 am, Jon Colverson  wrote:
> On Feb 16, 6:25 am, Marco Nelissen  wrote:
>
> > Why do you say it's not a public API?
>
> "SoundPool is undocumented because it is not ready as a public API and
> is subject to change."
>
> http://groups.google.com/group/android-developers/msg/6c360f2d0662be0a
>
> --
> Jon
--~--~-~--~~~---~--~~
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: Selling your apps section in Market help

2009-02-16 Thread Blake B.

Ok, maybe I missed this along the way (or heard comments of this and
couldn't believe it to be true), but this statement seems clear in the
"Setting the price of applications" section:

"If you have previously published an application for free, you cannot
change it to have a price."

This seems to mean that any app that has been in the Market up to this
point that plans on charging a price now will have to re-package
itself as a new application.  If the app contains a database or other
private data not accessible to other apps, I suppose that means we
will have to release ANOTHER version of the FREE app that includes
some kind of support for exporting data, then have the user download/
install this version and run it IN ADDITION TO the new paid version if
they want to migrate their data to the new paid version?  This seems
like a major headache for users and developers alike.

Am I reading this correctly?



On Feb 16, 2:57 am, Al Sutton  wrote:
> http://market.android.com/support/bin/topic.py?topic=15867
>
> Highlights;
>
> - All fee information is shown in USD, GBP, EUR, AUD, and CAD so I think
> that tells us who is going to be able to sell apps in the coming months.
> - Allowable price ranges are $0.99 to $200 (YES $200 - Sheesh) or 0.50
> GBP to 100 GBP.
> - Chargebacks for less than $10 USD will be automatically charged back.
> - A $3 USD fee may be added to chargebacks on top of the refund.
> - The 24 hour refund period starts when the user has *downloaded* the
> app, not when they purchase it.
>
> --
> ==
> Funky Android Limited is registered in England & Wales with the
> company number  6741909. The registered head office is Kemp House,
> 152-160 City Road, London,  EC1V 2NX, UK.
>
> The views expressed in this email are those of the author and not
> necessarily those of Funky Android Limited, it's associates, or it's
> subsidiaries.
--~--~-~--~~~---~--~~
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] SurfaceView transparent through to its parent?

2009-02-11 Thread Blake B.

I have a SurfaceView that is covering a portion of its parent, a
RelativeLayout.  I have a background image covering the full
RelativeLayout area, and this is my Activity's main layout.

I would like to have the SurfaceView be transparent so that I can see
through to the background image on its parent RelativeLayout.  I have
tried the approach shown in the API Demos example
TranslucentGLSurfaceViewActivity, but this succeeds in making the
transparency go all the way through my Activity to my desktop!

I'm using the "style/Theme.Translucent" theme on my activity, and
setting this on my SurfaceView:
   mySurfaceView.getHolder().setFormat(PixelFormat.RGBA_);

The transparency to the desktop it kinda cool, but not what I'm trying
to do!  Is it possible to make a SurfaceView transparent only through
to its parent?

Thanks,
Blake
--~--~-~--~~~---~--~~
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 do you create an MMS message with audio attachment?

2009-01-07 Thread Blake B.

I'll ping the group one last time.  Can anyone confirm that this is
not possible?

I looked at the latest com.android.mms.ui.ComposeMessageActivity in
the main code branch now (I believe this includes the Cupcake
updates), and it still appears the handleSendIntent() intent method is
assuming that any EXTRA_STREAM data is an image, without checking the
data MIME type.

Any other ideas to maybe directly create an MMS message to send?  It's
hard for me to believe this is completely not possible to do in code.

Thanks again,
Blake


On Jan 5, 8:50 am, "Blake B."  wrote:
> Ok, digging into the com.android.mms.ui.ComposeMessageActivity
> "handleSendIntent()" method, it appears as though only Image
> attachments are expected in Intent Extras?  Does anyone have any
> creative work-arounds of how to create/send an MMS message with an
> audio attachment?
>
>     private void handleSendIntent(Intent intent) {
>         Bundle extras = intent.getExtras();
>
>         if (Intent.ACTION_SEND.equals(intent.getAction()) && (extras !
> = null) && extras.containsKey(Intent.EXTRA_STREAM)) {
>             Uri uri = (Uri)extras.getParcelable(Intent.EXTRA_STREAM);
>             if (uri != null) {
>                 convertMessage(true);
>                 addImage(uri);                     <  IMAGE IS
> BEING ASSUMED
>             }
>         }
>     }
>
> Will audio attachments via Intents be supported in the "cupcake"
> release?  (I haven't downloaded it yet myself)
>
> Thanks,
> Blake
>
> On Dec 30 2008, 8:52 pm, "Blake B."  wrote:
>
> > Hello all,
>
> > I am trying to create an MMS message with an audio attachment and a
> > message for the user to view and then click "send" themselves.  If you
> > create a new Message on your own, you are able to attach an audio file
> > (.amr in this case), but how do you do this programatically?
>
> > When I do this code below, I get the MMS Compose Message window, but
> > it gives an error message: "Unsupported picture format.  Please select
> > a different picture.":
>
> >         final Intent i = new Intent(Intent.ACTION_SEND);
> >         i.putExtra("sms_body", msgText);
> >         i.putExtra(Intent.EXTRA_STREAM, audioUri);
> >         i.setType("*/*");
> >         startActivity(i);
>
> > When I run this code below (changed MIME type from "*/*" to "audio/*"
> > or "audio/amr", Android instead brings up the GMail client with the
> > audio attachment on the email:
>
> >         final Intent i = new Intent(Intent.ACTION_SEND);
> >         i.putExtra("sms_body", msgText);
> >         i.putExtra(Intent.EXTRA_STREAM, audioUri);
> >         i.setType("audio/*");
> >         startActivity(i);
>
> > How can I direct the system to create an MMS message with a .amr
> > attachment?
>
> > Thanks,
> > Blake
--~--~-~--~~~---~--~~
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: What happens to the database when app is "upgraded"

2009-01-05 Thread Blake B.

When you extend SQLiteOpenHelper, override this method:

public void onUpgrade(final SQLiteDatabase db, final int 
oldVersion,
final int newVersion)

It will be called when your application is being updated with a newer
version.


On Jan 5, 8:52 am, "Dan Dumont"  wrote:
> There is a method that will get called when the version number you supply to
> the create db command exceeds the listed version that the user has ( you've
> upgraded your design )
>
> You then put code in that handler to handle the database schema updates.
> Sorry I can't be more specific...  my code is at home.
>
> On Mon, Jan 5, 2009 at 3:34 AM, Jean-Baptiste Queru  wrote:
>
> > You might find SQLiteOpenHelper useful to manage the various scenarios.
>
> > JBQ
>
> > On 1/5/09, Jay-andro  wrote:
>
> > > I have an app that creates an sqllite database on first-use, if one
> > > doesn't already exist. Recently I released a new version of the app,
> > > and all of a sudden several users are complaining of erros that I
> > > didnt encounter in my testing. In my development I always installed
> > > using adb over usb, which in turn requires uninstall the older version
> > > first. So the database was always created anew on first-use of the new
> > > version. But I suspect my existing users are doing an in-place install
> > > on top of their old version, in which case the old db is incompatible
> > > with the new one.
>
> > > So my questions are:
> > > - Does the Market app allow you to install a new version "on top of"
> > > an old one, without requiring an uninstall first (unlike adb)?
> > > - If an in-place upgrade is supported but the database is not dropped,
> > > the question arises what else is not deleted? Resources, preferences,
> > > manifest? I suspect there would be major havoc if these things werent
> > > completely removed & replaced by the new version.
>
> > > I am now contemplating adding a preference which will indicate to the
> > > app what version of my db it needs and use this on first-use to
> > > determine if I need to drop and recreate the database or just use the
> > > old db.
>
> > > Any thoughts?
>
> > --
> > Jean-Baptiste M. "JBQ" Queru
> > Android Engineer, Google.
--~--~-~--~~~---~--~~
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 do you create an MMS message with audio attachment?

2009-01-05 Thread Blake B.

Ok, digging into the com.android.mms.ui.ComposeMessageActivity
"handleSendIntent()" method, it appears as though only Image
attachments are expected in Intent Extras?  Does anyone have any
creative work-arounds of how to create/send an MMS message with an
audio attachment?

private void handleSendIntent(Intent intent) {
Bundle extras = intent.getExtras();

if (Intent.ACTION_SEND.equals(intent.getAction()) && (extras !
= null) && extras.containsKey(Intent.EXTRA_STREAM)) {
Uri uri = (Uri)extras.getParcelable(Intent.EXTRA_STREAM);
if (uri != null) {
convertMessage(true);
addImage(uri); <  IMAGE IS
BEING ASSUMED
}
}
}

Will audio attachments via Intents be supported in the "cupcake"
release?  (I haven't downloaded it yet myself)

Thanks,
Blake


On Dec 30 2008, 8:52 pm, "Blake B."  wrote:
> Hello all,
>
> I am trying to create an MMS message with an audio attachment and a
> message for the user to view and then click "send" themselves.  If you
> create a new Message on your own, you are able to attach an audio file
> (.amr in this case), but how do you do this programatically?
>
> When I do this code below, I get the MMS Compose Message window, but
> it gives an error message: "Unsupported picture format.  Please select
> a different picture.":
>
>         final Intent i = new Intent(Intent.ACTION_SEND);
>         i.putExtra("sms_body", msgText);
>         i.putExtra(Intent.EXTRA_STREAM, audioUri);
>         i.setType("*/*");
>         startActivity(i);
>
> When I run this code below (changed MIME type from "*/*" to "audio/*"
> or "audio/amr", Android instead brings up the GMail client with the
> audio attachment on the email:
>
>         final Intent i = new Intent(Intent.ACTION_SEND);
>         i.putExtra("sms_body", msgText);
>         i.putExtra(Intent.EXTRA_STREAM, audioUri);
>         i.setType("audio/*");
>         startActivity(i);
>
> How can I direct the system to create an MMS message with a .amr
> attachment?
>
> Thanks,
> Blake
--~--~-~--~~~---~--~~
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 do you create an MMS message with audio attachment?

2008-12-30 Thread Blake B.

Hello all,

I am trying to create an MMS message with an audio attachment and a
message for the user to view and then click "send" themselves.  If you
create a new Message on your own, you are able to attach an audio file
(.amr in this case), but how do you do this programatically?

When I do this code below, I get the MMS Compose Message window, but
it gives an error message: "Unsupported picture format.  Please select
a different picture.":

final Intent i = new Intent(Intent.ACTION_SEND);
i.putExtra("sms_body", msgText);
i.putExtra(Intent.EXTRA_STREAM, audioUri);
i.setType("*/*");
startActivity(i);


When I run this code below (changed MIME type from "*/*" to "audio/*"
or "audio/amr", Android instead brings up the GMail client with the
audio attachment on the email:

final Intent i = new Intent(Intent.ACTION_SEND);
i.putExtra("sms_body", msgText);
i.putExtra(Intent.EXTRA_STREAM, audioUri);
i.setType("audio/*");
startActivity(i);


How can I direct the system to create an MMS message with a .amr
attachment?

Thanks,
Blake

--~--~-~--~~~---~--~~
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] Event when shortcut is dragged to Trash?

2008-12-09 Thread Blake B.

Is there any kind of event or hook available for determining when a
shortcut (and which one) is dragged to the Trash button on the Home
screen?
--~--~-~--~~~---~--~~
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
[EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] Re: Tips for Orientation

2008-11-19 Thread Blake B.

Put the "android:screenOrientation="sensor"" as an attribute on each
activity in your manifest that you want to be sensor-oriented.

Works great!  Thx for the tip hackbod!

On Nov 18, 3:14 pm, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> wrote:
> Hi,
>
> Will this setting make the screen change to lanscape using the
> accelerometer? If so, where do I put this setting?
>
> Thanks
>
> On Oct 20, 5:37 pm, hackbod <[EMAIL PROTECTED]> wrote:
>
>
>
> > Don't do that, or moving between your app and others will be flicker.
> > Just use android:screenOrientation="sensor".
>
> > On Oct 20, 12:47 pm, Tauno T <[EMAIL PROTECTED]> wrote:
>
> > > And that's why he want's to set the orientation programmatically - the
> > > users expect that when the phone is turned "sideways" then the picture
> > > is also turned sideways:) The user is not confused - he just thinks
> > > that Android has a feature that it does not have (sadly).
>
> > > As for the solution - Xolotl Lokis solution will works just fine - you
> > > only have to figure out which sensor reading corresponds to the phone
> > > being held sideways and then change the layout using
> > > setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_*);
>
> > > Tauno
>
> > > On Oct 20, 10:39 pm, hackbod <[EMAIL PROTECTED]> wrote:
>
> > > > Your user is confused.  The standard orientation policy is to select
> > > > the orientation based on the keyboard: when the keyboard is closed it
> > > > is portrait, when open it islandscape.  Pressing Ctrl+F12 in the
> > > > emulator is exactly the same as sliding the keyboard out on the G1.
>
> > > > On Oct 20, 11:57 am, Mark Hansen <[EMAIL PROTECTED]> wrote:
>
> > > > > From what I was told by a user of my application, that it did not
> > > > > change view, even when the keyboard was opened for text entry.
>
> > > > > I've built two set's of layout files, and stored them in "layout" and
> > > > > "layout-land" for when the view changes.  In emulator mode they work
> > > > > fine, CTRL-F12 works fine.. but, and I may be misinformed here, it
> > > > > appears the actual phone itself is not rotating the screen based on
> > > > > the keyboard of position of the actual phone.
>
> > > > > He even stated many of the default Google application aren't rotating
> > > > > as well, and that very few actually change based on the way the device
> > > > > is being held.
>
> > > > > On Oct 20, 12:21 pm, hackbod <[EMAIL PROTECTED]> wrote:
>
> > > > > > I don't know what you mean by "turn the view."  When the orientation
> > > > > > changes to switch from the dominant to secondary orientation 
> > > > > > (portrait
> > > > > > tolandscapeon the g1), the graphics of the entire screen are rotated
> > > > > > to result in the screen being shown in the new orientation.  As 
> > > > > > such,
> > > > > > there is no need to do anything yourself, at it looks like to the
> > > > > > application is that the size of the screen has changed to match the
> > > > > > new orientation.
>
> > > > > > For different resources, normally you also don't need to do 
> > > > > > anything,
> > > > > > because when the orientation changes the current activity is 
> > > > > > destroyed
> > > > > > and a new one started, and the new one is running with a 
> > > > > > configuration
> > > > > > matching the new orientation so will load the appropriate resources 
> > > > > > as
> > > > > > it creates and initializes itself.
>
> > > > > > The only except is if you are using android:configChanges to avoid
> > > > > > being restarted due to a configuration change...  which is one of 
> > > > > > the
> > > > > > reasons why it is strongly encouraged not to do this, and certainly 
> > > > > > if
> > > > > > you are changing layouts due to the orientation I would really 
> > > > > > suggest
> > > > > > letting the normal destroy/recreate path execute.  If you really
> > > > > > really do want to mix the two, you will need to override
> > > > > > onConfigurationChanged() and re-inflate your view hierarchy and re-
> > > > > > initialize anything else depending on that or changing resources at
> > > > > > that point.
>
> > > > > > On Oct 20, 5:19 am, Mark Hansen <[EMAIL PROTECTED]> wrote:
>
> > > > > > > I've actually created layouts for both vertical and horizontal 
> > > > > > > views,
> > > > > > > I've had some people testing it and it turns out Android doesn't 
> > > > > > > turn
> > > > > > > the view, I guess it has to be detected?
>
> > > > > > > I was curious how to go about doing that detection.. I know I can 
> > > > > > > also
> > > > > > > set the view with:
>
> > > > > > > setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_*);
>
> > > > > > > The problem I'm having is whateventto trap or how to go about
> > > > > > > determining which way the phone is being held.
>
> > > > > > > On Oct 20, 12:13 am, hackbod <[EMAIL PROTECTED]> wrote:
>
> > > > > > > > Use the android:screenOrientation attribute when declaring your
> > > > > > > > manifest:
>
> > > > > > > >http://code.googl

[android-developers] Re: How to debug the real phone G1?

2008-11-12 Thread Blake B.

Here are the complete steps:

http://code.google.com/android/intro/develop-and-debug.html#developingondevicehardware

I don't know if the adb installs the USB Windows drivers automatically
or not, but I installed them myself.
After following these steps, I was able to run the Eclipse debugger on
my G1.


On Nov 12, 2:11 pm, Alvin Yates <[EMAIL PROTECTED]> wrote:
> On Windows, you need to install the G1 debugger drivers.  If you are
> using Eclipse, adb should pick it up when it detects the phone.
>
> On Nov 12, 6:32 am, jeka <[EMAIL PROTECTED]> wrote:
>
>
>
> > I've enabled USB debugging, plugged the phone in, but still don't see
> > it as one of the devices. Am I missing a step?
>
> > Thank you.
>
> > On Oct 17, 12:53 pm, "Romain Guy" <[EMAIL PROTECTED]> wrote:
>
> > > You can just plug the phone in. But first you need to enable USB
> > > debugging in Home > Menu > Settings > Applications > Development.
>
> > > On Fri, Oct 17, 2008 at 1:28 AM, [EMAIL PROTECTED]
>
> > > <[EMAIL PROTECTED]> wrote:
>
> > > > Any document about it so far? I would like to see something like
> > > > Microsoft Activesync: just plug in the usb cable to PC, then you can
> > > > debug!
>
> > > --
> > > Romain Guywww.curious-creature.org- Hide quoted text -
>
> - Show quoted text -
--~--~-~--~~~---~--~~
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
[EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] Re: Any way to have two MediaRecorders recording at once?

2008-11-12 Thread Blake B.

Thanks Dave.  I'll try to get it done with concatenating .amr files.

Also, is there any way to detect when the record channel is ready to
use again?  Right now I have to put a manual 100ms delay before doing
back-to-back recordings.  Is there an event or state I can check
instead?


On Nov 12, 2:15 am, Dave <[EMAIL PROTECTED]> wrote:
> I don't see a way to do that with the current API. We will be
> enhancing the audio API's in a future release of the SDK.
>
> On Nov 11, 3:14 pm, "Blake B." <[EMAIL PROTECTED]> wrote:
>
>
>
> > Ok, I thought that may be the case.
>
> > I need to create a "sliding window" effect in the recording, so that
> > there is always 15 seconds of audio history recorded. I wanted to
> > stair-step two 20-second recorders so that every 5 seconds I would
> > delete one audio recording file when its "history" got too long, then
> > restart it. In this way, there would at most be two files of 20
> > seconds of audio on the SDcard and not get too large.
>
> > I can concatenate two .amr recordings, but I have to indroduce a 100ms
> > delay between stopping one recording and starting the next, otherwise
> > I get the same "Record channel already open" error.  This delay of
> > course causes a skip in the audio file where 100ms of audio is
> > omitted.
>
> > Since can't have two recorders recording, is there any way to:
>
> > - direct the audio recording stream to multiple files?
> > - buffer the audio recording so that I can manage the recording size
> > in-memory?
> > - other creative ideas to accomplish the "sliding window" effect?
>
> > Thanks
>
> > On Nov 11, 1:29 pm, Dave <[EMAIL PROTECTED]> wrote:
>
> > > No, this use case is not supported.- Hide quoted text -
>
> - Show quoted text -
--~--~-~--~~~---~--~~
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
[EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] Re: Any way to have two MediaRecorders recording at once?

2008-11-11 Thread Blake B.

Ok, I thought that may be the case.

I need to create a "sliding window" effect in the recording, so that
there is always 15 seconds of audio history recorded. I wanted to
stair-step two 20-second recorders so that every 5 seconds I would
delete one audio recording file when its "history" got too long, then
restart it. In this way, there would at most be two files of 20
seconds of audio on the SDcard and not get too large.

I can concatenate two .amr recordings, but I have to indroduce a 100ms
delay between stopping one recording and starting the next, otherwise
I get the same "Record channel already open" error.  This delay of
course causes a skip in the audio file where 100ms of audio is
omitted.

Since can't have two recorders recording, is there any way to:

- direct the audio recording stream to multiple files?
- buffer the audio recording so that I can manage the recording size
in-memory?
- other creative ideas to accomplish the "sliding window" effect?

Thanks

On Nov 11, 1:29 pm, Dave <[EMAIL PROTECTED]> wrote:
> No, this use case is not supported.
>

--~--~-~--~~~---~--~~
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
[EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] Any way to have two MediaRecorders recording at once?

2008-11-11 Thread Blake B.

Hi all,
 For my app I need to have two audio recordings that overlap each
other - that is, at some points in time there will be two separate
audio files being created from the same audio source.  I have
attempted to use two MediaRecorders and start the second one while the
first is still recording.  When I do this I get the following error:

ERROR/AudioFlinger(25): Record channel already open

Is there any way to get around this?

Thanks in advance,
Blake

--~--~-~--~~~---~--~~
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
[EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---