[android-developers] Re: Open GL Tutorial problem

2008-07-16 Thread Steve Oldmeadow



On Jul 17, 11:54 am, Claudio Veas <[EMAIL PROTECTED]> wrote:
> thanks for the answer It definitely was the version I thougth I had
> downloaded the last one but it wasnt. Any way thanks a lot.
> Claudio Veas
>

No problems.  An easy solution - my favourite type!
--~--~-~--~~~---~--~~
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]
Announcing the new M5 SDK!
http://android-developers.blogspot.com/2008/02/android-sdk-m5-rc14-now-available.html
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] Re: Open GL Tutorial problem

2008-07-16 Thread Claudio Veas

thanks for the answer It definitely was the version I thougth I had
downloaded the last one but it wasnt. Any way thanks a lot.
Claudio Veas

On Jul 16, 10:28 pm, Steve Oldmeadow <[EMAIL PROTECTED]> wrote:
> Brendan posted a version of his tutorials for m5.  See 
> here:http://groups.google.com/group/android-developers/browse_thread/threa...
>
> I don't recall having any problems with it.  I certainly didn't need
> to modify the code.  Are you sure you have the correct version of the
> tutorial code?
>
> If you do have the correct version then it will help to see the output
> from logcat when the crash happens.
--~--~-~--~~~---~--~~
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]
Announcing the new M5 SDK!
http://android-developers.blogspot.com/2008/02/android-sdk-m5-rc14-now-available.html
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] Helo with onActivityResult()

2008-07-16 Thread Casey Borders
I am starting a sub activity that browses for a file, then in the
onActivityResult() method I parse the file that is returned.  The trouble is
that the parsing takes a little while and I am trying to pop up a progress
dialog, but the file browser is visible until the onActivityResult() method
finishes.  Is there some way that I can force the file browser to go away
and show the calling activity so the progress dialog will show?

--~--~-~--~~~---~--~~
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]
Announcing the new M5 SDK!
http://android-developers.blogspot.com/2008/02/android-sdk-m5-rc14-now-available.html
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] Re: Open GL Tutorial problem

2008-07-16 Thread Steve Oldmeadow

Brendan posted a version of his tutorials for m5.  See here:
http://groups.google.com/group/android-developers/browse_thread/thread/4a1068f3ab9e801b/079dc8e63a63b8e1

I don't recall having any problems with it.  I certainly didn't need
to modify the code.  Are you sure you have the correct version of the
tutorial code?

If you do have the correct version then it will help to see the output
from logcat when the crash happens.
--~--~-~--~~~---~--~~
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]
Announcing the new M5 SDK!
http://android-developers.blogspot.com/2008/02/android-sdk-m5-rc14-now-available.html
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] Open GL Tutorial problem

2008-07-16 Thread Claudio Veas

Hello Group my name is Claudio Veas and Im having a problem while
trying to execute the tutorial about Android with OPEN GL. The
application consist of two activities one is for selecting the
tutorials and then this activity calls another that according to the
selection of the tutorial, it creates the view that contains the
selected tutorial. The problem is that I have never got to see any of
the tutorials running. I tried debuging and for sure the second
activity is being executed and the right tutorial is selected but when
the application tries to run the constructor of the view this sentence
causes a problem so big that the activity is closed and the
application goes back to the previous one (initial activity) .

package edu.union;

import javax.microedition.khronos.opengles.GL10;

import android.content.Context;
import android.graphics.Canvas;
import android.graphics.OpenGLContext;
import android.view.View;

public class GLTutorialOne extends View {
private OpenGLContext glContext;

public GLTutorialOne(Context c) {
super(c);
glContext = new OpenGLContext(0);
GL10 gl = (GL10)glContext.getGL();

gl.glClearColor(0.0f, 0.0f, 0.0f, 0.0f); //<- THIS ONE IS THE 
ONE
THAT SEEMS TO BE  //CAUSEING PROBLEMS
}

protected void onDraw(Canvas canvas) {
GL10 gl = (GL10)glContext.getGL();

glContext.waitNative();

gl.glClear(GL10.GL_COLOR_BUFFER_BIT);
}
}

This is where you can download the tutorial and aparently for what I
have read in some places these tutorials worked fine in M3 version of
the sdk but had some problems in m5  version (I had to make some
changes in my code to make it work). Any Help will be welcome and if
you require more information do not hesitate to ask.

source are in http://code.google.com/p/android-gl/downloads/list

Thanks alot
Claudio Veas

PS: Please excuse my english is not  very good.
--~--~-~--~~~---~--~~
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]
Announcing the new M5 SDK!
http://android-developers.blogspot.com/2008/02/android-sdk-m5-rc14-now-available.html
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] Android Tutorial - Option and Context menu

2008-07-16 Thread [EMAIL PROTECTED]

This tutorial (http://developerlife.com/tutorials/?p=304) will show
you how to create options menu (hooks into the MENU button) and
context menu (press and hold a component).
--~--~-~--~~~---~--~~
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]
Announcing the new M5 SDK!
http://android-developers.blogspot.com/2008/02/android-sdk-m5-rc14-now-available.html
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] Android Tutorial - XML View inflation

2008-07-16 Thread [EMAIL PROTECTED]

This tutorial (http://developerlife.com/tutorials/?p=303) will show
you how to instantiate or inflate a View from XML; this is  useful for
components that don't provide a Java API to tweak with certain style
attributes. The Button class is used as an example; you can only get
certain styles to show up via XML that aren't available via the Java
API.
--~--~-~--~~~---~--~~
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]
Announcing the new M5 SDK!
http://android-developers.blogspot.com/2008/02/android-sdk-m5-rc14-now-available.html
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] gallery question

2008-07-16 Thread kingkung

Hi all,

I'm working with the Gallery (which is terrific btw), and I have a
simple question.  Right now, in order to scroll left and right in the
gallery via the keypad, I have to move my cursor down to the gallery
before I do anything.

I want to make it so that regardless where the cursor is, pressing
DPAD_LEFT or DPAD_RIGHT will scroll the gallery left and right.  I've
been able to do this through overriding onKeyDown(), but that takes
away the default scrolling animation.  How do I do this and keep the
scrolling animation in?

Thanks,

James


case KeyEvent.KEYCODE_DPAD_LEFT:
int position;
if ((position = 
f_gallery.getSelectedItemPosition())>0);
{
 
f_gallery.setSelection(position-1);
f_gallery.invalidate();
}
return true;
case KeyEvent.KEYCODE_DPAD_RIGHT:
if ((position =
f_gallery.getSelectedItemPosition())<(f_gallery.getCount()-1));
{
f_gallery.setSelection(position
+1);
f_gallery.invalidate();
}
--~--~-~--~~~---~--~~
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]
Announcing the new M5 SDK!
http://android-developers.blogspot.com/2008/02/android-sdk-m5-rc14-now-available.html
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] Re: How to put images in the ListView?

2008-07-16 Thread Mark Murphy

> I would like to make a ListView with images in the list?
> I have no idea how to put images in the list.
> Anyone can tell me how to do it?

I've started a series of blog posts about this very topic over at
AndroidGuys. The first one is up:

http://androidguys.com/2008/07/14/fancy-listviews-part-one/

However, as Romain Guy pointed out, I'm a bad, bad man for not discussing
convertView in the first post. Honest, I'll be covering it in the second
one, which should go up tomorrow or Friday.

Beyond that, I've discussed the issue many times in this group and
android-beginners, there are tutorials that show the technique up on
anddev.org, and List8.java in the ApiDemos that come with the M5 SDK also
shows a list of just images.

If you have questions beyond what those resources tell you, write back!

-- 
Mark Murphy (a Commons Guy)
http://commonsware.com
_The Busy Coder's Guide to Android Development_ -- Available Now!


--~--~-~--~~~---~--~~
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]
Announcing the new M5 SDK!
http://android-developers.blogspot.com/2008/02/android-sdk-m5-rc14-now-available.html
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] Re: Does Android support IMS and SIP?

2008-07-16 Thread Lee S Dryburgh

No IMS handsets exist in the world AFAIK. And the whole concept of
what constitutes IMS is in dis-array, so certainly no IMS API.

Regards

Lee

2008/7/15 Jagan B <[EMAIL PROTECTED]>:
>
> Is there any API  for IMS and SIP for transfer the media files between
> two client applications made on Android?
>
> >
>

--~--~-~--~~~---~--~~
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]
Announcing the new M5 SDK!
http://android-developers.blogspot.com/2008/02/android-sdk-m5-rc14-now-available.html
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] Re: Device owner/user info

2008-07-16 Thread Hong
many phones work out of the box once u pop in ur SIM card.

users are not expected to create a login, enter email, etc, as they do to
their PC.

so better use MSISDN or IMEI, they are guaranteed to be unique.
(Well, if the device is authorized, the IMEI will be unique.  Some black
market phones however reuse the same IMEI #, :)

On Wed, Jul 16, 2008 at 11:09 AM, Sreegesh Pillai <[EMAIL PROTECTED]>
wrote:

>
> Yes that is a possibility. Thanks.
>
> I figured that when you get a new phone with Android, you will need to
> set up a login, register owner details (eg email id). I was hoping
> that there was an API to access this information.
>
> On Jul 15, 11:54 pm, Hong <[EMAIL PROTECTED]> wrote:
> > not sure what user you want, but can't you do that with the IMEI number?
>  or
> > the phone number?  both can be found in the telephony and/or gsm package
> I
> > believe.
>

--~--~-~--~~~---~--~~
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]
Announcing the new M5 SDK!
http://android-developers.blogspot.com/2008/02/android-sdk-m5-rc14-now-available.html
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] Re: Device owner/user info

2008-07-16 Thread Sreegesh Pillai

Do you know how to access the phone number/ IMEI number via some API
in the SDK? Also, I guess I was hoping to find device owner
information such as an email id, name etc. I figured that when you get
a new Android phone you will need to set up a login as with other OS
and this is the information I was hoping to get.


On Jul 15, 11:54 pm, Hong <[EMAIL PROTECTED]> wrote:
> not sure what user you want, but can't you do that with the IMEI number?  or
> the phone number?  both can be found in the telephony and/or gsm package I
> believe.

--~--~-~--~~~---~--~~
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]
Announcing the new M5 SDK!
http://android-developers.blogspot.com/2008/02/android-sdk-m5-rc14-now-available.html
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] Re: Device owner/user info

2008-07-16 Thread Sreegesh Pillai

Yes that is a possibility. Thanks.

I figured that when you get a new phone with Android, you will need to
set up a login, register owner details (eg email id). I was hoping
that there was an API to access this information.

On Jul 15, 11:54 pm, Hong <[EMAIL PROTECTED]> wrote:
> not sure what user you want, but can't you do that with the IMEI number?  or
> the phone number?  both can be found in the telephony and/or gsm package I
> believe.

--~--~-~--~~~---~--~~
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]
Announcing the new M5 SDK!
http://android-developers.blogspot.com/2008/02/android-sdk-m5-rc14-now-available.html
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] Re: Mocking the Camera in M5

2008-07-16 Thread Anil

Hi,

   In similar lines I've done a nasty hack for audio playback from
an actual hardware that runs Android. In fact our BSP layer supports
ALSA, but as far as I know the m5 release of Android SDK does not
support ALSA audio. Hence I've brought up a client/server approach
(UDP socket based) to get minimal audio functionality like playback
and record of WAV files from the an Android application.

Warm Regards,
Anil

On Jul 16, 5:28 am, Jeffrey Sharkey <[EMAIL PROTECTED]> wrote:
> Tom's method works excellent, and I used it to create the video
> demonstrating my ADC application:
>
> http://scan.jsharkey.org/
>
> I also documented some hacks I used to get a Firewire MiniDV camera
> working as a high-quality video input in Linux.
>
> j
>
> On Jul 11, 11:40 am, "Justin (Google Employee)" <[EMAIL PROTECTED]>
> wrote:
>
> > I just came acrosshttp://www.tomgibara.com/android/camera-source
> > which provides a way to mock a camera in the SDK. I haven't tried it
> > out, it may work well or not at all, but it looks interesting and
> > potentially quite useful to those building apps that use a camera.
>
> > Cheers,
> > Justin
> > Android Team @ 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
[EMAIL PROTECTED]
Announcing the new M5 SDK!
http://android-developers.blogspot.com/2008/02/android-sdk-m5-rc14-now-available.html
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] How to put images in the ListView?

2008-07-16 Thread Pierre

Hi, all,

I would like to make a ListView with images in the list?
I have no idea how to put images in the list.
Anyone can tell me how to do it?

Thanks in advance.

Pierre
--~--~-~--~~~---~--~~
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]
Announcing the new M5 SDK!
http://android-developers.blogspot.com/2008/02/android-sdk-m5-rc14-now-available.html
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] Re: Running Background Process

2008-07-16 Thread Mark Murphy

Jaikishan Jalan wrote:
> I read the docs but could not really understand DEFAULT category. Can 
> you please explain what is the difference between - HOME and DEFAULT 
> Category?

Heh. I can try.

The docs say that HOME is "the first activity that is displayed when the 
device boots". In other words, that's for the Launcher itself.

The definition of DEFAULT seems to be somewhat inconsistent in the 
current SDK documentation. On the one hand, it is described as "the 
default action (center press) to perform on a piece of data", yet it is 
used in the ApiDemos only for the main activity, and elsewhere in the 
Intent documentation it is shown sprinkled in pretty much every 
intent-filter they have.

The key for categories and intent-filter elements seem to be: when in 
doubt, list anything that might match. You are penalized for not having 
the right category, by not getting the Intents you expect. You are NOT 
penalized for having too many -- if the Intent only matches some of what 
your filter wants, that's perfectly fine.

You might try tossing in DEFAULT into your intent-filter, and maybe 
LAUNCHER too, and see what happens. And, if we're lucky, hackbod or 
somebody will let us know the actual category we're supposed to be 
filtering upon. The only tutorial I'm seeing that spells it out, over on 
anddev.org, is from January, meaning it would be on the previous version 
of the SDK, so it might have changed in M5.

And, as an aside to anyone writing documentation for Android core or 
third-party components: if you are going to broadcast Intents that you 
expect others to pick up, please document BOTH the action AND the 
category, not just the action. If not, those of us trying to receive 
your Intent will have to guess, and, as a result, might be eaten by a grue.

-- 
Mark Murphy (a Commons Guy)
http://commonsware.com
Warescription: All titles, revisions, & ebook formats, just $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
[EMAIL PROTECTED]
Announcing the new M5 SDK!
http://android-developers.blogspot.com/2008/02/android-sdk-m5-rc14-now-available.html
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] Re: Running Background Process

2008-07-16 Thread Jaikishan Jalan
I read the docs but could not really understand DEFAULT category. Can you
please explain what is the difference between - HOME and DEFAULT Category?

On Wed, Jul 16, 2008 at 5:59 PM, Mark Murphy <[EMAIL PROTECTED]>
wrote:

>
> Jaikishan Jalan wrote:
> > Oh. I wonder where could be the problem. One possible location could be
> > in my AndroidManifest.xml. Here is how it looks like :
>
> 
>
>  > Do you think this is ok ?
>
> AFAIK, your uses-permission element is in the proper spot.
>
> Are you sure that "android.intent.category.HOME" is the proper category,
> and not "android.intent.category.DEFAULT"?
>
> --
> Mark Murphy (a Commons Guy)
> http://commonsware.com
> Android Training on the Ranch in September! http://www.bignerdranch.com
>
> >
>


-- 
Thanks,
Jaikishan

--~--~-~--~~~---~--~~
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]
Announcing the new M5 SDK!
http://android-developers.blogspot.com/2008/02/android-sdk-m5-rc14-now-available.html
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] Re: Running Background Process

2008-07-16 Thread Mark Murphy

Jaikishan Jalan wrote:
> Oh. I wonder where could be the problem. One possible location could be 
> in my AndroidManifest.xml. Here is how it looks like :



 > Do you think this is ok ?

AFAIK, your uses-permission element is in the proper spot.

Are you sure that "android.intent.category.HOME" is the proper category, 
and not "android.intent.category.DEFAULT"?

-- 
Mark Murphy (a Commons Guy)
http://commonsware.com
Android Training on the Ranch in September! http://www.bignerdranch.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
[EMAIL PROTECTED]
Announcing the new M5 SDK!
http://android-developers.blogspot.com/2008/02/android-sdk-m5-rc14-now-available.html
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] Re: Using C Shared Libraries on M5

2008-07-16 Thread Volker Gropp

On Jul 15, 9:16 pm, Shawn McMurdo <[EMAIL PROTECTED]> wrote:
> Has anyone been able to use shared libraries on M5?
> I am trying to build a simple hello world in C using a non system
> shared library and run on the M5 emulator.
> I followed the instructions from 
> here:http://honeypod.blogspot.com/2007/12/shared-library-hello-world-for-a...
> but I get a segmentation violation when I try to run on M5 emulator.
> Below is the strace output.
> Any suggestions?
> Thanks.
> Shawn

Hi,

sadly i cannot help you with the strace, but i ported a shared ANSI C
Lib to Android without problems. So i can assure you its working. Make
sure you are using the patched .xsc file with ld.

regards,
Volker Gropp
--~--~-~--~~~---~--~~
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]
Announcing the new M5 SDK!
http://android-developers.blogspot.com/2008/02/android-sdk-m5-rc14-now-available.html
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] Re: Does Android support IMS and SIP?

2008-07-16 Thread Volker Gropp

On Jul 15, 1:42 pm, Jagan B <[EMAIL PROTECTED]> wrote:
> Is there any API  for IMS and SIP for transfer the media files between
> two client applications made on Android?

Hi,

sadly there is no stack included. I'm working with mjSIP aswell, but
experienced big performance issues and some bugs in the Code. I'm
thinking about porting pjsip to android, thought media/audio will be a
problem, i guess.

regards,
Volker Gropp
--~--~-~--~~~---~--~~
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]
Announcing the new M5 SDK!
http://android-developers.blogspot.com/2008/02/android-sdk-m5-rc14-now-available.html
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] Re: Running Background Process

2008-07-16 Thread Jaikishan Jalan
Oh. I wonder where could be the problem. One possible location could be in
my AndroidManifest.xml. Here is how it looks like :


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










 
 





Do you think this is ok ?

On Wed, Jul 16, 2008 at 5:56 AM, hackbod <[EMAIL PROTECTED]> wrote:

>
> It is not an issue I am aware of.  That facility is used extensively
> by our own apps, and I don't know of them having a problem with it.
>
> On Jul 15, 3:01 am, "Jaikishan Jalan" <[EMAIL PROTECTED]> wrote:
> > Hello,
> >
> > As I mentioned in my last email about the random behavior of my
> application,
> > I have observed that my application many times does not receive
> > BOOT_COMPLETED action. Due to this my background process does not get
> > started. Is this a known bug that it is not definite that your
> > intentreceiver (listening to BOOT_COMPLETED) will not get executed
> everytime
> > when you launch the emulator? I have verified this by simply printing a
> log
> > message. Sometimes the message is logged ( when my application receive
> the
> > intent ) and many times it does not. Can anyone from Google Android team
> > confirm this?
> >
> >
> >
> > On Tue, Jul 15, 2008 at 3:21 PM, hackbod <[EMAIL PROTECTED]> wrote:
> >
> > > On Jul 14, 6:31 pm, Mark Murphy <[EMAIL PROTECTED]> wrote:
> > > > To make sure I'm interpreting this correctly...the IntentReceiver
> that
> > > > is the recipient of the Intents raised by the AlarmManager must be
> one
> > > > registered in AndroidManifest.xml (vs. one registered via
> > > > registerReceiver()), or else it will fall out of memory if/when the
> > > > service does. And at that point, the AlarmManager is (presumably)
> still
> > > > set up to send Intents to a non-existent IntentReceiver.
> >
> > > Yep.  So it will just broadcast the Intent, there will be nobody
> > > around to receive it, and *poof* that is the end of it.
> >
> > > > I hadn't thought that all the way through, but it makes sense. That's
> a
> > > > facet of top-level IntentReceivers that I hadn't appreciated --
> they're
> > > > "wired into" the Android runtime in such a way that they're always
> > > > registered, regardless of memory conditions.
> >
> > > Yep, this is one of the key uses of receivers, they allow your
> > > application to declare events it is interested in finding out about
> > > even when it is not running.  (Also they are a little cleaner to use
> > > with the alarm manager, since because they are published in the
> > > manifest, they are associated with an actual component, so the Intent
> > > you make can be explicitly targeted at that component rather than
> > > defining an ad-hoc action name.)
> >
> > > > Question: for Jaikishan's scenario, does he need the service? In
> other
> > > > words, does the IntentReceiver that handles Intents from the
> > > > AlarmManager have any particular speed requirement? I was under the
> > > > impression that IntentReceivers tied to activities might run on the
> UI
> > > > thread and so had to get their task done quickly...but will an
> > > > AlarmManager-triggered IntentReceiver have that same limitation? Or
> can
> > > > it do some network I/O and such before returning from
> onReceiveIntent(),
> > > > without impacting any foreground activity?
> >
> > > The onReceive() function does run on the main thread, so you can't
> > > spend a lot of time in it.  Currently, even if your main thread is not
> > > being asked to do other things like handle input events, if the
> > > receiver takes more than 10 seconds then the user will get an
> > > Application Not Responding dialog.  So if you are going to do a longer-
> > > running (or asynchronous) thing, you will need to have that wrapped in
> > > a service.  Of course networking stuff definitely falls in this
> > > category.
> >
> > > > I'm just trying to figure out the right pattern for this case. I
> don't
> > > > think it's a stretch to say that a fair number of Android apps will
> be
> > > > of the poll-network-for-changes-and-do-something pattern, and so this
> is
> > > > an important area for us to get a best practice down pat.
> >
> > > The "Alarm Service" sample code in ApiDemos at
> >
> > >http://code.google.com/android/samples/ApiDemos/src/com/google/androi.
> ..
> > > is intended to provide the best practices for this.  The current
> > > example is a little overly complex because of the need of the
> > > intermediate receiver.  In a future SDK where you can have the alarm
> > > manager directly start a service, this is a lot cleaner.
> >
> > > > Heck, I'm
> > > > hoping we'll work up a common service or something, where activities
> can
> > > > register URLs to be polled and Intents to be fired if/when those
> > > > documents change, so we can optimize network access and minimize
> battery
> > > > consumption.