2017년 7월 20일 목요일

Using phonecall with saved contacts


I have made Phonecaller and Texting successfully using option to enter phone number while creating app on PC.

I wanted to do that while app is running on Android device.
Is there any way to do that - to add phone number(s) in app memory and use them for Phonecaller?

I suppose that it can be done combining TinyDB and PhoneNumberPicker, but at this moment I can't figure that out.

So can someone please give me some tips how to do that.

--

I think it would be a good idea to post the blocks you have so far, otherwise we need to shoot in the blind.

-- 
thank you for your answer.
Here are blocks for Texting and PhoneCall.



This works great with phone number entered here:

But I wanted to do as I described in first message - to be able to add number/s in app(while it is running on Android device).

--
What's the BlueTooth device, and how does it fit into your scheme?

-- 
What about putting a TexBox in your design, tick the NumbersOnly checkbox. Fill the TextBox in when running your app with the desired phonenumber and set the phonenumber just before you make the call to the PhoneCall component.
??

-- 
bluetooth device is Arduino with HC-05 module.
It works flawless.

that's great idea, but if I'm understand well, in that way, number will have to be entered every time when app is started (after you close the app completely)?
I mean, it won't be saved in app, right?
Do I need for that TinyDB?

--
I tried now to play with TinyDB, but I obviously lost somewhere a little bit.
Here are new blocks.








When I enter number in Text Box and click Save number, I get message ''Number added''.
But, when I try to call it from memory, by clicking on Open list, I'm getting message 'true' on Text Box.

So, I need some tips where I made big mistake...

-- 
Yes, you are trying to send true, because that is the value of TextBox.Numbersonly.
The Numbers only attribute is something you should set in the design screen, to prevent your user from typing abc as phone number.
As tag for the TinyDB you should use something like 'phonenumber'. And as value TextBox.Text. Try that. I did not see the actual phone call in your blocks anymore, where is it?
You can debug your work, when conncet d to the AI Companion by clicking with your right mouse button on a block and choose DoIt. You can see what the value of something is, or execute a procedure etc.

--
Most AI2 blocks have tool tips, little pop up bubbles explaining them,
that appear if you hover your cursor on them in the Blocks Editor.

-- 
See the TinyDB section of this FAQ for some easy samples ...

-- 
Thank you very much both for your help.
I managed to make it work with next blocks:


So at this moment, everything works as I  wanted.
I will write here in case I need more help.

--

Hi,
I have new question, it is same app but with different problem.
My app contains Texting, and problem is that when I receive SMS, phone shows it via built in SMS app and also via Mit App.
How can I disable that Mit App show SMS notification on screen every time I receive SMS?

-- 


댓글 없음:

댓글 쓰기