Although i agree with your statement that such an app can be really annoying, depending on what needs to be done. this might be mandatory. A good example of that is a number verification process, where the app needs to verify the phone number used on the device. The best way to avoid getting the 1 star rating is explain to the user that the outgoing call with be through the native dialer and that this is mandatory for the app to operate. A reasonable user shouldn't get pissed over that :)
On Tuesday, December 3, 2013 5:23:40 PM UTC+2, MagouyaWare wrote: > > While that package name may be correct on the devices you tested, there is > no guarantee that it will be correct on ALL Android devices. Here is an > example from StackOverflow where the OP was having a problem using the > "com.android.phone" package: > > > http://stackoverflow.com/questions/11038286/android-phone-application-intent > > Hardware manufacturers can modify the Android OS pretty much however they > want. If they happen to use the com.android.phone package name then that > is merely a coincidence... nothing is stopping them from changing it to > something else should they choose to do so. > > I understand that there are product requirements that sometimes tie your > hands... However, in general I have found that when I receive a product > requirement that goes against Android best practices I am usually able to > explain why it isn't a good idea and am able to get the product requirement > changed. Sometimes I am successful but there have been times it didn't > work... it would be worth a try. > > Thanks, > Justin Anderson > MagouyaWare Developer > http://sites.google.com/site/magouyaware > > > On Mon, Dec 2, 2013 at 10:21 PM, Iqbal Ahmed <[email protected]<javascript:> > > wrote: > >> Hi Mr. Anderson, >> >> Thanks for your reply, >> >> I think the package name (com.android.phone) is same on all devices as I >> checked or debug but the dialer package names are different. As I got this >> package name have one OutgoingCallBroadcast class which broadcast the >> Intent.ACTION_CALL and android system find the dialers which implement this >> Intent as per my Knowledge, *If I am saying anything wrong please >> correct me.* >> >> And I hardcoded the package name because I did not get any option to do >> this task so I used this way. Actually call from the native dialer is a >> product requirement. So I have to implement. If you have any sample code >> related to this, please share with me >> >> Thanks >> >> >> On 2 December 2013 22:57, Justin Anderson <[email protected]<javascript:> >> > wrote: >> >>> Perhaps you should rethink forcing the user to use the native dialer... >>> especially where you are hard-coding the package name. Not only is that >>> just plain bad practice and really annoying for your end user, but the >>> native dialer may not have the same package name on all devices... >>> >>> Here is a real-world example: I used to use Google Voice as my default >>> option for making phone calls. I explicitly set it up that way. If I ever >>> came across an app that didn't respect the way I wanted to use my phone it >>> was immediately uninstalled and I gave the app an automatic 1 star rating. >>> >>> >>> Thanks, >>> Justin Anderson >>> MagouyaWare Developer >>> http://sites.google.com/site/magouyaware >>> >>> >>> On Wed, Nov 27, 2013 at 10:34 PM, Johnny <[email protected]<javascript:> >>> > wrote: >>> >>>> >>>> >>>> *Target: Call from native dialer only , bypass all dialers.* >>>> >>>> This is my method to call from Native Dialer , this method bypass the >>>> chooser dialog as I experienced. >>>> >>>> Intent i = CallUtils.callfromDefaultDialer(ctxt,dat[1]); >>>> ctxt.startActivity(i); >>>> >>>> >>>> public static Intent callfromDefaultDialer(Context ctxt, String no) { >>>> >>>> Intent i = new Intent(); >>>> i.setAction(Intent.ACTION_CALL); >>>> i.setData(Uri.parse("tel:" + no)); >>>> PackageManager pm = ctxt.getPackageManager(); >>>> List<ResolveInfo> list = pm.queryIntentActivities(i, 0); >>>> for (ResolveInfo info : list) { >>>> String pkgnam = info.activityInfo.packageName; >>>> if (pkgnam.toLowerCase().equals("com.android.phone")) { >>>> i.setClassName(pkgnam, info.activityInfo.name); >>>> return i; >>>> } >>>> } >>>> >>>> return i; >>>> } >>>> >>>> >>>> But some time it gives me option to choose . It gives me two dialog two >>>> choose, you can see the images in attachment.But second dialog >>>> (chooser_win.png) I bypass using above code. but when when i get the first >>>> dialog(call_win.png) then the second dialog(chooser_win.png) auto come >>>> up(you can say its root of chooser dialog). >>>> >>>> >>>> But using below code I bypass the first dialog (call_win.png). But not >>>> second dialog(chooser_win.png) >>>> >>>> public static Intent callfromDefaultDialer(Context ctxt, String no) { >>>> >>>> List<Intent> targetedShareIntents = new ArrayList<Intent>(); >>>> >>>> Intent i = new Intent(); >>>> i.setAction(Intent.ACTION_CALL); >>>> //i.addCategory(Intent.ACTION_DEFAULT); >>>> i.setData(Uri.parse("tel:" + no)); >>>> PackageManager pm = ctxt.getPackageManager(); >>>> List<ResolveInfo> list = pm.queryIntentActivities(i, 0); >>>> for (ResolveInfo info : list) { >>>> String pkgnam = info.activityInfo.packageName; >>>> Intent targetedShareIntent = new Intent(Intent.ACTION_CALL); >>>> if (pkgnam.toLowerCase().equals("com.android.phone")) { >>>> targetedShareIntent.setData(Uri.parse("tel:" + no)); >>>> targetedShareIntent.setClassName(pkgnam, >>>> info.activityInfo.name); >>>> targetedShareIntents.add(targetedShareIntent); >>>> //return targetedShareIntent; >>>> //i.setClassName(pkgnam, info.activityInfo.name); >>>> //return i; >>>> } >>>> } >>>> >>>> Intent chooserIntent = >>>> Intent.createChooser(targetedShareIntents.remove(0), "Select app to Call"); >>>> chooserIntent.putExtra(Intent.EXTRA_INITIAL_INTENTS, >>>> targetedShareIntents.toArray(new Parcelable[targetedShareIntents.size()])); >>>> >>>> return chooserIntent; >>>> } >>>> >>>> I tried this code to get Intent.EXTRA_INITIAL_INTENTS . but not got >>>> success. its giving always blank parcelable list. >>>> >>>> Intent intent = CallUtils.callfromDefaultDialer(ctxt,dat[1]); >>>> Parcelable<http://grepcode.com/file/repository.grepcode.com/java/ext/com.google.android/android/2.3.4_r1/android/os/Parcelable.java#Parcelable%5B%5D> >>>> [] pa = >>>> intent.getParcelableArrayExtra<http://grepcode.com/file/repository.grepcode.com/java/ext/com.google.android/android/2.3.4_r1/android/content/Intent.java#Intent.getParcelableArrayExtra%28java.lang.String%29> >>>> (Intent<http://grepcode.com/file/repository.grepcode.com/java/ext/com.google.android/android/2.3.4_r1/android/content/Intent.java#Intent.0EXTRA_INITIAL_INTENTS> >>>> .EXTRA_INITIAL_INTENTS<http://grepcode.com/file/repository.grepcode.com/java/ext/com.google.android/android/2.3.4_r1/android/content/Intent.java#Intent.0EXTRA_INITIAL_INTENTS> >>>> ); >>>> >>>> Intent >>>> <http://grepcode.com/file/repository.grepcode.com/java/ext/com.google.android/android/2.3.4_r1/android/content/Intent.java#Intent%5B%5D>[] >>>> initialIntents = null; >>>> >>>> >>>> >>>> >>>> if (pa != null) { >>>> >>>> initialIntents = new Intent >>>> <http://grepcode.com/file/repository.grepcode.com/java/ext/com.google.android/android/2.3.4_r1/android/content/Intent.java#Intent>[pa.length]; >>>> >>>> >>>> >>>> >>>> for (int i=0; i<pa.length; i++) { >>>> >>>> if (!(pa[i] instanceof Intent >>>> <http://grepcode.com/file/repository.grepcode.com/java/ext/com.google.android/android/2.3.4_r1/android/content/Intent.java#Intent>)) >>>> { >>>> >>>> >>>> >>>> >>>> Log.w >>>> <http://grepcode.com/file/repository.grepcode.com/java/ext/com.google.android/android/2.3.4_r1/android/util/Log.java#Log.w%28java.lang.String%2Cjava.lang.String%29>("ChooseActivity", >>>> "Initial intent #" + i >>>> >>>> >>>> >>>> >>>> + " not an Intent: " + pa[i]); >>>> >>>> } >>>> >>>> initialIntents[i] = (Intent >>>> <http://grepcode.com/file/repository.grepcode.com/java/ext/com.google.android/android/2.3.4_r1/android/content/Intent.java#Intent>)pa[i]; >>>> >>>> >>>> >>>> >>>> } >>>> >>>> } >>>> >>>> >>>> Reference of this Link: >>>> http://grepcode.com/file/repository.grepcode.com/java/ext/com.google.android/android/2.3.4_r1/com/android/internal/app/ChooserActivity.java >>>> >>>> >>>> >>>> -- >>>> You received this message because you are subscribed to the Google >>>> Groups "Android Developers" group. >>>> To post to this group, send email to >>>> [email protected]<javascript:> >>>> To unsubscribe from this group, send email to >>>> [email protected] <javascript:> >>>> 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 [email protected]<javascript:> >>>> . >>>> For more options, visit https://groups.google.com/groups/opt_out. >>>> >>> >>> -- >>> You received this message because you are subscribed to the Google >>> Groups "Android Developers" group. >>> To post to this group, send email to >>> [email protected]<javascript:> >>> To unsubscribe from this group, send email to >>> [email protected] <javascript:> >>> 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 a topic in the >>> Google Groups "Android Developers" group. >>> To unsubscribe from this topic, visit >>> https://groups.google.com/d/topic/android-developers/_oxhs-_fUjQ/unsubscribe >>> . >>> To unsubscribe from this group and all its topics, send an email to >>> [email protected] <javascript:>. >>> >>> For more options, visit https://groups.google.com/groups/opt_out. >>> >> >> >> >> -- >> Thanks & Regards >> Iqbal Ahmed >> (+919711667728) >> >> -- >> You received this message because you are subscribed to the Google >> Groups "Android Developers" group. >> To post to this group, send email to >> [email protected]<javascript:> >> To unsubscribe from this group, send email to >> [email protected] <javascript:> >> 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 [email protected] <javascript:>. >> For more options, visit https://groups.google.com/groups/opt_out. >> > > -- You received this message because you are subscribed to the Google Groups "Android Developers" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] 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 [email protected]. For more options, visit https://groups.google.com/groups/opt_out.

