[android-developers] Scheduling a recurring Intent to fire off twice a day

2012-01-06 Thread Diego Tori
After reading lots of sample code into this matter, I'm trying to figure out the simplest way to achieve the following: I want to be able to schedule an Intent that calls back to my Alarm BroadcastReceiver, which in turn fires off my Service. However, I want to set up so that it calls said Intent

[android-developers] Re: Scheduling a recurring Intent to fire off twice a day

2012-01-06 Thread Diego Tori
of AlarmManager? http://developer.android.com/resources/samples/ApiDemos/src/com/examp... http://developer.android.com/reference/android/app/AlarmManager.html Kris On Fri, Jan 6, 2012 at 1:38 PM, Diego Tori diegotoridoesandr...@gmail.com wrote: After reading lots of sample code into this matter

[android-developers] Re: Scheduling a recurring Intent to fire off twice a day

2012-01-06 Thread Diego Tori
Also, the pending intents that I check with FLAG_NO_CREATE should be checking if said intents returned null in order to set them. On Jan 6, 3:37 pm, Diego Tori diegotoridoesandr...@gmail.com wrote: You have to assume that the functions already have an instance of AlarmManager. AlarmManager

[android-developers] Fetching a GPS Network Location within a short time frame (10 seconds)

2011-12-22 Thread Diego Tori
I'm trying to set up a quick and dirty GPS lookup via LocationManager which fetches a network location (within 500 meters) every half second for ten seconds. In other words, I'm just trying to find the correct coarse Criteria settings and the correct logic to stop checking after 10 seconds of no

[android-developers] Re: Fetching a GPS Network Location within a short time frame (10 seconds)

2011-12-22 Thread Diego Tori
enough the returned location. On Dec 22, 6:43 pm, TreKing treking...@gmail.com wrote: On Thu, Dec 22, 2011 at 5:04 PM, Diego Tori diegotoridoesandr...@gmail.comwrote: What I want to know is after I fetch the last known location as my initial best location and kick off my thread, how do I set up

[android-developers] Touch to erase portions of foreground ImageView to expose background View

2011-11-21 Thread Diego Tori
So I've been struggling with this for a better part of a day. Suppose I have a custom ImageView that I want to overlay over a background View (both within a RelativeLayout), which when touched, it erases portions of the View's source bitmap like the erase tool in MS Paint, exposing the View below

[android-developers] Toggling ViewSwitcher children on GridView click and focus change

2011-09-08 Thread Diego Tori
Right now, suppose I have a GridView with ViewSwitchers, and what I want to do is when the user clicks on an item, it switches my ViewSwitcher to the second child. However, when a user scrolls away from that item or clicks another one, I want it to reset the switcher for that previous item back to

[android-developers] Adapting ImageDownloader enhancements to my app

2011-08-15 Thread Diego Tori
Right now, I'm trying to modify ImageDownloader (http:// code.google.com/p/android-imagedownloader/source/browse/trunk/src/com/ example/android/imagedownloader/ImageDownloader.java) so I can implement a couple of enhancements particular to my app: First, I am going to adapt the code to utilize

[android-developers] Re: Broadcasting custom intent actions to background activities from foreground activity.

2011-06-09 Thread Diego Tori
at 4:16 PM, Diego Tori diegotoridoesandr...@gmail.com wrote: That's the thing, if I set a shared preference flag or cached flag via cache object, and they did try to check for that value in onResume, wouldn't the first activity from the back stack to get the foreground check its state

[android-developers] Re: Broadcasting custom intent actions to background activities from foreground activity.

2011-06-09 Thread Diego Tori
, Diego Tori diegotoridoesandr...@gmail.comwrote: So you're saying in this case it's better to just populate the UI in onResume for data that is dependent on the outcome of that event? That would be the case for a couple of activities that depend on it. However, I'm more concerned

[android-developers] Broadcasting custom intent actions to background activities from foreground activity.

2011-06-08 Thread Diego Tori
So I want to achieve the following: suppose I have one Activity in my app that generates an event that I want other Activities in my app's back stack to know about so they can react to it accordingly (i.e. update UI, refresh data via separate Thread, etc...). What strategies would I have to pursue

[android-developers] Re: Broadcasting custom intent actions to background activities from foreground activity.

2011-06-08 Thread Diego Tori
the foreground again? On Jun 8, 3:16 pm, Mark Murphy mmur...@commonsware.com wrote: On Wed, Jun 8, 2011 at 3:00 PM, Diego Tori diegotoridoesandr...@gmail.com wrote: So I want to achieve the following: suppose I have one Activity in my app that generates an event that I want other Activities

[android-developers] Re: Broadcasting custom intent actions to background activities from foreground activity.

2011-06-08 Thread Diego Tori
Keep in mind that this is not a one-time event. Rather it is an event that the user generates, all I want those other activities to know is whether or not the event was generated by the user while in the background. On Jun 8, 4:16 pm, Diego Tori diegotoridoesandr...@gmail.com wrote: That's

[android-developers] Re: comparison between viewstub and latoutinflater to add view at runtime?

2011-05-19 Thread Diego Tori
If I recall correctly, ViewStub acts as a lazy XML include, in that the referenced view only gets added to the view hierarchy in the time that it's inflated, not ahead of time. The gain on this method is that it makes it quick and cheap to inflate a view, however, once it's inflated, it cannot

[android-developers] Re: Effective way to manage binding/unbinding from local service across multiple activities

2011-05-12 Thread Diego Tori
Apparently, it was leaking memory due to the fact that I wasn't properly unbinding from the service when exiting the activities. That and there were certain cases where I wasn't carrying over the Service bindings when rotating, thus it was creating a new connection every time. All is good now.

[android-developers] Effective way to manage binding/unbinding from local service across multiple activities

2011-05-05 Thread Diego Tori
Targeting and building from API Level 4 and above. Right now, I'm dealing with an issue in which I'm trying to maintain bindings to my local service across multiple activities, and stop the service when the last connection is unbound. In a nutshell, my service just calls a system service in a

[android-developers] Re: Calling a system service in fixed intervals within another service

2011-04-27 Thread Diego Tori
Sorry to bump the thread, but after creating a HandlerThread, all of the locking stopped and the service stopped on a dime after unbinding even when it waited for the allotted time before the next scan. Anyways, I was wondering if I managed to implement it correctly: class MyHandlerThread

[android-developers] Re: Calling a system service in fixed intervals within another service

2011-04-18 Thread Diego Tori
So yeah, I managed to try calling the wifi scanner in this fashion within my thread: private Object _lock = new Object(); private final long SLEEP_TIME = 15000; //Scan every 15 secs private final long WIFI_SCAN_TIMEOUT = 6; //One minute timeout for getting called

Re: [android-developers] Re: Calling a system service in fixed intervals within another service

2011-04-18 Thread Diego Tori
I don't think it's doing any blocking operations at all since startScan calls back onReceive rather quickly (even on a G1), and then I just use the returned SSID data to call back to the activities bound to the service based on the existence of a pre-determined SSID that I'm trying to find in

[android-developers] Calling a system service in fixed intervals within another service

2011-04-15 Thread Diego Tori
As the question implies, I am wondering how I could write a thread that would call a system service and then wait a certain amount of time before calling said system service's function that calls back to onReceive from a registered BroadcastReceiver. In other words, I am trying to call the Wifi

[android-developers] Re: Calling a system service in fixed intervals within another service

2011-04-15 Thread Diego Tori
it sleep before the onReceive gets called again? On Apr 15, 6:27 pm, Kostya Vasilyev kmans...@gmail.com wrote: Use AlarmManager for this, it's more reliable and easier to use than coding a thread with sleep/wait. 16.04.2011 2:24 пользователь Diego Tori diegotoridoesandr...@gmail.com написал

[android-developers] Re: Calling a system service in fixed intervals within another service

2011-04-15 Thread Diego Tori
:43 PM, Diego Tori diegotoridoesandr...@gmail.com wrote: That's the thing, it has to be short intervals in between scans since this has almost real-time implications, no greater than 15 secs at most, so I dunno how AlarmManager would fit into the equation. Is there any chance you can show me

[android-developers] Call back to an Activity in the bottom of the stack from a global Activity.

2011-03-22 Thread Diego Tori
I already know that I can pass Bundled data through setResult from one Activity back to another. However, suppose I have an global Activity that can be launched from anywhere in my app since it is mapped to a button that appears in my title bar in almost all of my activities. Long story short,

[android-developers] Re: Call back to an Activity in the bottom of the stack from a global Activity.

2011-03-22 Thread Diego Tori
. On Mar 22, 10:22 pm, TreKing treking...@gmail.com wrote: On Tue, Mar 22, 2011 at 7:17 PM, Diego Tori diegotoridoesandr...@gmail.comwrote: From either Home (ActivityA), or any other activity (Activity B, C, etc...) that can open out my global activity (ActivityX), it should find a way