> I have done some modifications to my code, following your
> indications.
>
> I have created a new class, ProximityIntentReceiver to receive the
> PROXIMITY_ALERT action .
>
> class ProximityIntentReceiver extends IntentReceiver
> {
> @Override
> public void onReceiveIntent(Context context, Intent intent)
> {
> String action = intent.getAction();
>
> if (action.equals(PROXIMITY_ALERT))
> showAlert("Proximity alert.",1, "Alert message.", "OK",
> false);
> }
> }
At least with the emulator, you will get dozens of intents per second
while you are in proximity of the target location. Using showAlert(),
therefore, is not a recommended idea, as you may get dozens of alert
dialogs stacked atop each other.
If you are merely looking to confirm that you are receiving the intent, I
would use android.util.Log.
> In DDMS perspective I saw that I need to add ACCESS_CELL_ID permission
> to use proximity alert, it's true? I add it into AndroidManifest.xml .
You definitely need some permissions. I think I use ACCESS_LOCATION,
ACCESS_CELL_ID, and the GPS one (I forget the name), just to make sure I
have what I need.
> I run the application and the alert is fired :) But ... I have the
> next error:
>
> An error has ocurred in net.mobilefight.trackbuilder.
> java.lang.OutOfMemoryError.
That could be from several dozen (or hundred) alert dialogs. Try switching
to android.util.Log and see if that clears up the problem.
> Is normal that the mock GPS continue working although the activity is
> closed?
Yes.
--
Mark Murphy (a Commons Guy)
http://commonsware.com
The Busy Coder's Guide to Android Development -- coming in June 2008!
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google
Groups "Android Beginners" group.
To post to this group, send email to [email protected]
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-beginners?hl=en
-~----------~----~----~----~------~----~------~--~---