开发者

Android & iOS access number dialing

I am very new to both these operating systems so please excuse me if my question is basic :-)

We are planning a secure dialing system which means dialiing 2 numbers in one phone number dailing session.

Currently we have a system which allows us to dail an access number, wait for a tone and then dial a full telephone number.

It'开发者_JAVA百科s a bit elaborate but like I said, it's a security feature.

What we are now trying to do is create Android and iPhone apps that will allow us to dial the access number + telephone number at the click of a virtual button :-)

Can anyone tell me how this can be accomplished programmatically? I need to implement something like access-number#phone-number or anything that works.

Thanks.


Both iphone and android support making phone calls in the same sort of manner.

You need to construct a URL and 'run' the url. Both iphone and android don't support any sort of call control so you have to make do with the url to make a phone call. They both support 'pause' character and dtmf tones in the url.

The iphone don't support some characters, notably the '#' and '*' characters. Because the '#' character is not supported (for security reasons), it can make it hard dealing with PBX systems.

On the android you have to 'encode' characters manually or using URLEncoder. I have not had any luck supporting the '#' character in Android but I have seen reports of it working. You will need to test this to see if it works for you.

For iphone you use the UIApplication openURL: to a tel link.

e.g.

[[UIApplication sharedApplication] openURL:[NSURL URLWithString:@"tel:123456p12345"]];

For android you use the INTENT_DIAL or ACTION_CALL.

INTENT_CALL will display the phone dialler with you number filled out. It does not require any special setup.

e.g.

Intent dialIntent = new Intent(Intent.ACTION_DIAL, Uri.parse("tel:123456"));
startActivity(dialIntent);

ACTION_CALL requires the CALL_PHONE permission in your manifest file. e.g.

AndroidManifest.xml:

Intent dialIntent = new Intent(Intent.ACTION_CALL, Uri.parse("tel:123456%2C12345"));
startActivity(dialIntent);


I'm not quite sure if this is what you're looking for but.

You could create a button in your layout. Create a pointer to it in your main activity // findViewById();

OnClickListener on the Button.

in the onClick, fire a Dial Intent with the number of choice.

If this isn't what you're looking for I'm afraid I'll need a bit more information on what it truely is, because at this point that's the only thing I can manage to think of with the description given.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜