Android :: LocationManager RequestLocationUpdates And Pending Intents

Sep 8, 2010

in order to save some battery, I was wondering what happens if an activity registers a requestLocationUpdates and then the user (or the os) puts it in background or kills it. Will the location manger still be active and then will the pending intent still be fired? In other words, will the location manager still be alive even if its lancher does not exist anymore? I'd really love this scenario because allows me to link an intent service that handles the location updates without bothering of have something always running waiting for good news from location.

Android :: LocationManager requestLocationUpdates and pending intents


Android :: LocationManager.requestLocationUpdates With MinTime - 0 Not Working As Expected

Nov 22, 2010

I set locationManager.requestLocationUpdates(LocationManager.GPS_PROVIDER, 60000, 0f, this);

It has an odd behavior, locationChanged gets called every second instead of any time close to 1 minute. Secondly, locationChanged gets called every second for like 10 seconds, then stops completely, the gps satalites icon disappears, then only resumes again when the screen returns from display timeout.
what's wrong? I'm currently on android 1.5.

View 1 Replies View Related

Android :: Possible Bug With Intents / Pending Intents

Nov 7, 2009

I have some code that is creating and removing alarms, and which works great in Android 1.5 and 1.6 but breaks on the Android 2.0 AVD.The code that's giving this exception is: Code...

View 3 Replies View Related

Android :: Need Widget / Pending Intents

Apr 26, 2010

I've asked here a question about Task Killers and widgets stop working (SO Question) but now, I have reports of user that they don't use any Task Killer and the widgets didn't work after a while. I have a Nexus One and I don't have this problem.I don't know if this is a problem of memory or something. Based on the API: So, I don't know why widget stop working, if Android doesn't kill the Pending Intent by itself, what's the problem? Code...

View 1 Replies View Related

Android :: Pending Intents In Notifications

May 13, 2010

I would like to show a notification that displays the progress of an ongoing operation. That works well for me. But at the same time the remote view should contain cancel button to stop the ongoing operation. The usual content intent should still do something else, i.e. not cancel the ongoing operation. It seems though that I can only have one intent. Code...

View 3 Replies View Related

Android :: Reusing Intents With Notification / Pending

Nov 19, 2009

In my app, user starts a service and shows a notification from activity A. The notification creates a Pending Intent that will invoke activity A should the user tap on it. The problem with this behavior is that, if the user starts the service (which shows the notification), drags down the notification bar, then taps the notification, I now have two activity A's in the display stack, one on top of the other and both exactly the same. How can I re-use the original activity A in this situation so the user isn't duplicating activities?

View 4 Replies View Related

Android :: How To Tie Pending Intents To Specific Buttons On Widgets?

Sep 18, 2010

I have a Widget I am working on, that allows the user to have more then one instance of the widget on his screen. Each Widget ID maintains its own configuration file. However, for some odd reason my code that is responsible for setting up the buttons individually for each widget id is not working, only the first widget id is linked to each individual widget. Below is the code that is responsible.

private void TieClicks(Context context){
RemoteViews rViews;
PendingIntent editPendingIntent= null;
// Intent updateintent = new Intent(context,SyncNoteWidget.class);
// updateintent.setAction(SyncNote_Action_Widget_Update);
// PendingIntent pendingupdateintent = PendingIntent.getBroadcast(context, 0, updateintent, 0);
// rViews.setOnClickPendingIntent(R.id.widgettextview , pendingupdateintent);
// AppWidgetManager appWidgetManager = AppWidgetManager.getInstance(context);
int[] ids = appWidgetManager.getAppWidgetIds(new ComponentName(context, SyncNoteWidget.class));
for (int i =0;i< ids.length;i=i+1){
int wId = ids[i];
rViews = new RemoteViews(context.getPackageName(),R.layout.widget);
editPendingIntent = makeControlPendingIntentActivity(context, wId);
Log.v("syncnote", "tieing " + String.valueOf(wId));
rViews.setOnClickPendingIntent(R.id.widgeteditbutton, editPendingIntent);
appWidgetManager.updateAppWidget(wId, rViews);
editPendingIntent= null;
} }
private PendingIntent makeControlPendingIntentActivity(Context context,int appWidgetId) {
Intent active = new Intent(context, EditNote.class);
active.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK );
active.setAction(com.ntu.way2fungames.syncnote.SyncNoteWidget.SyncNote_Action_Edit);
active.putExtra(AppWidgetManager.EXTRA_APPWIDGET_ID, appWidgetId);
return(PendingIntent.getActivity(context, 0, active, 0 ));
}

View 2 Replies View Related

Android :: Broadcast Receivers Not Receiving Pending Intents

May 20, 2009

I've had an issue where no matter how I've tried to set it up I'm finding the Broadcast Receivers aren't receiving any Pending Intents. A look through LogCat confirms that the intents are launched, but they're not being executed. I managed to make a simple(ish) repro case. If you take the SimpleWiktionary widget by Jeff Sharkey http://code.google.com/p/wiktionary-android/ and make the following changes plus any required imports. Code...

View 8 Replies View Related

Android :: Multiple Notifications -/Pending Intents With Different Data?

May 11, 2010

Let's say I have a background service that performs several tasks. As it completes task A, it posts notification A with a certain intent and some extra data that indicates viewing result of A. As it completes task B, it posts notification B with a certain intent and some extra data that indicates viewing result of B. As it completes task C, it posts notification C with a certain intent and some extra data that indicates viewing result of C. At the end, the notification area has three notifications. Each one has the same intent, except for one of the extra data fields. I would expect that each one would load my activity with different extra data. They don't. When onNewIntent is called, each has the extra data field set to C. I have rooted out any possible aliasing and checked the data as it is placed into a notification. It seems to allow only one set of data per package. Is what I am attempting not possible? Has anyone accomplished what I am attempting? For example, have you had a service download several large files, and then had notifications that would open each of those. Code...

View 4 Replies View Related

Android :: Which Intent Flags When Setting Pending Intents?

Apr 30, 2010

I have one WidgetProvider but expect the user to have multiple instances of the widget on the home screen. When the user clicks on the widget, an intent is fired to start an activity A passing a String extra (which is specific to that instance of the app widget). Everything works fine unless the activity is already running, in which case the activity is shown in its previous state (and so the intent extra data is ignored). I've tried using various Intent flags (like FLAG_ACTIVITY_NEW_TASK) but they don't seem to help.

View 4 Replies View Related

Android :: Dropping Pending Intents / Clean Up Memory Appropriately?

Mar 16, 2010

Is it ok to drop Pending Intents in android if they are never used. Such as in an AppWidgetProvider where a Pending Intent that was never used be overwritten by a new Pending Intent. Or should we call cancel on all unused Pending Intents to clean up memory appropriately?

View 1 Replies View Related

Android :: RequestLocationUpdates() Parameters?

Apr 20, 2010

In requestLocationUpdates(LocationManager.GPS_PROVIDER, 0, 0, this); if I put time interval and distance as zero, will this work, or shall I need to give a value greater than zero.

View 4 Replies View Related

Android :: Emulator Is Stalled When RequestLocationUpdates API Is Used

Oct 21, 2009

When i use LocationManager.requestLocationUpdates API and send geo fix form the shell (the one you obtain using telnet localhost 5554), device emulator receives location updates only two times and then get stalled. Have anyone faced and solved this issue?Also i can't send updates from DDMS perspective in eclipse. When i send manual location updates using Emulator control view nothing happens in emulator. In devices view running emulator is shown as online and i can see logs from it in LogCat view.

View 3 Replies View Related

Android :: PendingIntent Vs LocationListener On RequestLocationUpdates?

Jun 25, 2010

you can subscribe to requestLocationUpdates via two ways one by specifing a PendingIntent the other is by using a LocationListener. When is advised the one and when the other?

View 1 Replies View Related

Android :: Retrieving GRP Coordinates - Getting Errors With GetLastKnownLocation And RequestLocationUpdates

May 2, 2010

I tried using both getLastKnownLocation and requestLocationUpdates to get GPS coordinates from emulator.

CODE:......

After that, i tried:

CODE:............

-or-

CODE:.............

-or-

CODE:........

I get the same error for all three:

CODE:.............

I have set the GPS coordinates in DDMS Location Controls, also set coordinates using telnet and geo fix.

My manifest file has all permissions, dont know why im getting errors

CODE:.......................

View 2 Replies View Related

Android :: LocationManager And It's Updates

Jul 20, 2010

Can someone tell me, what is the best way to deal with situations when there is no GPS signal or from some reason fix cannot be acquired?

The thing is that I thought that it would be sufficient just to use onStatusChanged method from LocationListener, but when there is no GPS signal it never calls this method. Why is that?

View 1 Replies View Related

Android :: GPS On - LocationManager Returns Null

Feb 5, 2010

The GPS on my Android phone is on, supported by the fact that :

location_manager.isProviderEnabled(LocationManager.GPS_PROVIDER)

returns true. Yet, the following line: Location location = location_manager.getLastKnownLocation(LocationManager.GPS_PROVIDER); returns null.

View 1 Replies View Related

Android :: LocationManager.getLastKnownLocation() Returns Null

Oct 22, 2009

So I'm trying to sample the gps coordinates just once in an application. I don't want to create a LocationListener object to constantly get gps updates. I want to wait until receiving the coordinates, and then proceed on to another task.

Here is a code snippet

CODE:.................

The loc variable is always null in the emulator. I tried using the command "geo fix latitude longitude" to set it, and also I tried using the DDMS way of setting it. Neither method had any effect on the code. Also the snippet isn't causing any exceptions.

View 3 Replies View Related

Android :: Unsubscribe LocationListener From Recieving Updates From LocationManager?

Jan 19, 2010

How do I unsubscribe a LocationListener from recieving updates from the LocationManager?

mLocationManager = (LocationManager)this.getSystemService(LOCATION_SERVICE);
mListener = new LocationListener() {
public void onLocationChanged(Location location) {
Log.i("LocationListener", "Logging Change");
}
}
mLocationManager.requestLocationUpdates(LocationManager.GPS_PROVIDER,
5000, 1, mListener);

After I have exited the the view that created the LocationListener I am still getting log messages in the LogCat window. I understand that this is because I am orphaning the listener but I cannot see any destory method on the LocationListener nor can I see any "remove listener" style methods on the LocationManager object.

View 3 Replies View Related

Android :: How Often Does GetLastKnownLocation(LocationManager.NETWORK_PROVIDER) Return Null

Sep 10, 2010

Do the Android users have the chance to reset the NetworkProvider, so that the location will be null?
I came up with the idea, that its only possible to have that location null, after starting the device the very first time. But also than google will check the location right away for my opinion.

Sure, I'm implementing a default location for this rare case. I just want to know how seldom this case is.

View 3 Replies View Related

Android :: What Is Pending Intent?

Feb 17, 2010

Please clarify me What is Pending Intent with an example.

View 2 Replies View Related

Android :: What Pending Intent Is?

May 11, 2010

I am newbie to Android. I read the Android documents. Can anyone tell me what "Pending Intent" is?

View 1 Replies View Related

Android :: Cancelling Pending Toasts

Aug 13, 2009

I'm writing an application that demonstrates various gesture algorithms, and Toast after each one is detected. of course if the user goes all hogwild then the Toasts back up. can i flush the Toast queue somehow?

View 2 Replies View Related

Android :: Pending Intent ReceiverPermission

Oct 29, 2009

I've started using an AlarmManager for some tasks i'm doing and while setting up the pendingIntent to be broadcast I noticed there is no receiverPermission option. Can anyone tell me is it possible to set the receiver permission on a pendingIntent?

View 10 Replies View Related

Android :: Exception On Pending Intent

Aug 18, 2010

That message can occurr if the receiving code crashes or takes too long. I am writing an appwidget for my application, there are like multiple pending intents are there to launch an activity or receive a broadcast. The Problem I am facing is , some times I get exception saying that the Pending Intents cannot be delivered. And the widget does not responds to the touch from the user. please help me. I am not able to find any alternative also.

View 2 Replies View Related

Android :: Pending Intent Notification

Jun 9, 2010

I have a alarm thing going on in my app and it launches a notification that then when pressed launched an activity.The problem is that when I create more than one alarm then the activity launched from the notification gets the same extras as the first one. I think the problem is either with the intent i put in the pending intent or in the pending intent itself. I think I might need to put a flag on one of these but I dont know which one.The "details" extra is the same to every the next time a notification happens instead of having the different value.Until I set the intents I am sure that the correct value goes to the "details" so its a problem of getting the first intent everytime i press any notification. How can I make it to launch the correct intents?

View 2 Replies View Related

Android :: Way To Access Pending Notification

Sep 30, 2009

Is there a way to access pending notification or the previous notification that my application created?When I use Notification manager and use its setLatestEventInfo() method the last notification (with same intent) is updated. This is exactly what I want but when I update the notification, I want to access the existing notification's intent and get the key/value paris (Extras) and use that information to update the notification. For example in an SMS notification, I want to to get the current message (key/value pair or message itself) and update that with the new value. ( For giving the number of notifications, I can use the Notification.number, but that I want to access more values). One workaround that I am thinking is to put the data of first notification in database or in preference and access it when the second notification comes. But this is not exactly what I want, it is easier to use the existing notification instead of storing in database or preferences. Related Question: What do you suggest I use, Database or Preferences? Is there a best practise in terms of performance and elegance?

View 3 Replies View Related

Android :: Passing Data With Pending Intent

Jun 28, 2010

I would like to create some home screen app widgets that are entry points into an application. I can put a button in the app widget that uses setOnClickPendingIntent to start the activity. The problem occurs when I want to have two of these app widgets that are entry points to different parts of the activity. I need to be able to pass data into the activity that will distinguish these. Since both app widgets use a Pending Intent that starts the same activity, the two Pending Intents are shared and I can't reliably set extras for the corresponding intents.

View 2 Replies View Related

Android :: How To Check If A Pending Notification Was Delivered?

Aug 8, 2010

Is there a way for the sender of a Notification to know when that Notification is delivered to the receiver? i.e. Some method that can check if a the user has clicked on a given Notification.What I'm trying to accomplish is this: Have my Service send a notification with a PendingIntent to start ActivityA. But if the user starts ActivityA without clicking on the Notification, I would like the service to cancel the Notification and send a direct Intent to ActivityA

View 1 Replies View Related

Android :: Mulitple Instances Of Pending Intent

Sep 16, 2010

I created a widget that when clicked activates a PendingIntent.The problem is when I have more than one widget on the screen only the latest one will start the PendingIntent.I have read some about a unique request code, but not figured this out.Any ideas how I can have multiple widgets and the PendingIntents work for each?

View 1 Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved