[android-developers] SMSManger sendTextMessage - never get deliveryIntent

2013-03-10 Thread Lindsey Simon
Do you need RECEIVE_SMS permission to receive the deliveryIntent by any 
chance?

Here is my code - any help would be CRAZY appreciated =)
I always get the sent intent but never the delivery one.

// The intent action to be unique so that we can have multiple
// concurrent  pending intents.
// 
http://developer.android.com/reference/android/app/PendingIntent.html
String intentAction = TAG + - + callbackId;  // callbackId is 
unique per call
Intent intent = new Intent(intentAction);

PendingIntent sentPI = PendingIntent.getBroadcast(ctx, 0, 
intent, 0);

cordova.getActivity().registerReceiver(new BroadcastReceiver() {
@Override
public void onReceive(Context ctx, Intent intent) {
int resultCode = getResultCode();
int status = -1;
String details = ;
switch (resultCode) {
case Activity.RESULT_OK:
status = 0;
break;
case SmsManager.RESULT_ERROR_NO_SERVICE:
details = No service;
case SmsManager.RESULT_ERROR_NULL_PDU:
details = Null PDU;
case SmsManager.RESULT_ERROR_RADIO_OFF:
details = Radio off;
status = 1;
break;
}

JSONObject obj = new JSONObject();
try {
obj.put(status, status);
obj.put(details, details);
} catch (JSONException e) {
throw new RuntimeException(e);
}
sendAsyncResultStatus(callbackId, obj);
ctx.unregisterReceiver(this);
}
}, new IntentFilter(intentAction));

// The intent action to be unique so that we can have multiple
// concurrent  pending intents.
// 
http://developer.android.com/reference/android/app/PendingIntent.html
String deliveryIntentAction = TAG + -Delivery- + callbackId;
Intent deliveryIntent = new Intent(deliveryIntentAction);

PendingIntent deliveryPI = PendingIntent.getBroadcast(
cordova.getActivity(), 0, deliveryIntent, 0);

cordova.getActivity().registerReceiver(new BroadcastReceiver() {
@Override
public void onReceive(Context ctx, Intent intent) {
logger.log(Level.INFO, TAG +  DELIVERY intent YOYO!!);
String pdu = intent.getStringExtra(pdu);
logger.log(Level.INFO, TAG +  DELIVERY intent!! to:  +
sentToPhoneNumber + , pdu:  + pdu);

JSONObject obj = new JSONObject();
try {
obj.put(pdu, pdu);
} catch (JSONException e) {
throw new RuntimeException(e);
}
sendAsyncResultStatus(callbackId, obj);
ctx.unregisterReceiver(this);
}
}, new IntentFilter(deliveryIntentAction));

smsManager.sendTextMessage(phoneNumber, null, message, sentPI, 
deliveryPI);

-- 
-- 
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
--- 
You received this message because you are subscribed to the Google Groups 
Android Developers group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to android-developers+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




[android-developers] Might locationManager requestLocationUpdates / removeUpdates for dynamic config cause the GPS to completely stop working?

2013-02-28 Thread Lindsey Simon
I've got an app where we want to have dynamic values for minTime and 
minDistance depending on someone's proximity to their destination.

To accomplish this I'm just calling removeUpdates and then 
requestLocationUpdates after a period with different values. We pause 
anywhere from 15seconds to 3 minutes between these start/stops.

The problem is that on some devices we're seeing a situation where we just 
stop getting location updates. On a Galaxy S3 for instance, the GPS 
completely stops working - no app can get a location in fact. Only 
rebooting the phone seems to fix the problem.

Maybe I'm start/stopping the watches too aggressively and hitting some sort 
of bug?

Any insights would be extremely helpful.

I've found a few similar reports of this situation:
http://stackoverflow.com/questions/13594932/network-provider-not-providing-updated-locations
http://stackoverflow.com/questions/12630413/has-network-provider-behavior-changed-in-android-4-1-1

-- 
-- 
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
--- 
You received this message because you are subscribed to the Google Groups 
Android Developers group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to android-developers+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




[android-developers] Re: Might locationManager requestLocationUpdates / removeUpdates for dynamic config cause the GPS to completely stop working?

2013-02-28 Thread Lindsey Simon
I should add that while no other app can get a location, it seems like 
Google Maps is working aok.

On Thursday, February 28, 2013 6:14:33 PM UTC-8, Lindsey Simon wrote:

 I've got an app where we want to have dynamic values for minTime and 
 minDistance depending on someone's proximity to their destination.

 To accomplish this I'm just calling removeUpdates and then 
 requestLocationUpdates after a period with different values. We pause 
 anywhere from 15seconds to 3 minutes between these start/stops.

 The problem is that on some devices we're seeing a situation where we just 
 stop getting location updates. On a Galaxy S3 for instance, the GPS 
 completely stops working - no app can get a location in fact. Only 
 rebooting the phone seems to fix the problem.

 Maybe I'm start/stopping the watches too aggressively and hitting some 
 sort of bug?

 Any insights would be extremely helpful.

 I've found a few similar reports of this situation:

 http://stackoverflow.com/questions/13594932/network-provider-not-providing-updated-locations

 http://stackoverflow.com/questions/12630413/has-network-provider-behavior-changed-in-android-4-1-1


-- 
-- 
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
--- 
You received this message because you are subscribed to the Google Groups 
Android Developers group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to android-developers+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




[android-developers] Detect whether a user has Google Voice installed?

2013-01-16 Thread Lindsey Simon
I have a feature in my app I'd like to not turn on for users who have 
Google Voice installed.. Is there any way on Android to detect the presence 
of the App?
Thanks.

-- 
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