TelephonyTools

Discussions regarding 1C:Enterprise for mobile devices with Android, iOS, or Windows Phone.

#1
People who like this:0Yes/0No
Active user
Rating: 4
Joined: Mar 14, 2012
Company: GSPD

Help me, please!
I added some command line in "OnStart" procedure of Configuration:

Code
#If MobileAppClient Then
       TelephonyTools.AttachSMSMessageHandler(WriteSMS);
#EndIf
&AtMobileAppClient

Procedure WriteSMS(Command) Export
   // Ghi nội dung tin nhắn vào biểu ghi
   PhoneMessage = New SMSMessage;
   PhoneNumber = PhoneMessage.From; //Số điện thoại
   DateReceive = PhoneMessage.DateReceived; //Ngày nhận
   Content = PhoneMessage.Text;  //Nội dung tin nhắn
   Message(Content);
EndProcedure


But, when I write Configuration, 1C inform me that commands have an error:
{ManagedApplicationModule(37,47)}: unknown variable (WriteSMS)
      TelephonyTools.AttachSMSMessageHandler(<<?>>WriteSMS); (check: mobile client application)

I do not understand why?

 
#2
People who like this:0Yes/0No
Active user
Rating: 4
Joined: Nov 19, 2012
Company:

Ninh Giang Thi,

Code
TelephonyTools.AttachSMSMessageHandler("WriteSMS"); 


TelephonyTools.AttachSMSMessageHandler
Syntax:

AttachSMSMessageHandler(<ProcedureName>)
Parameters:

<ProcedureName> (required)

Type: String; NotifyDescription.
Name of the procedure enabled as a handler.
Description:

It enables the incoming SMS handle.
When an incoming SMS is received, a handler with the parameters specified below is called;
Message: SMSMessage,
Additional parameter (if used NotifyDescription).

Edited: Aleksey Bochkov - Feb 05, 2015 06:34 PM
 
#3
People who like this:0Yes/0No
Active user
Rating: 4
Joined: Mar 14, 2012
Company: GSPD

Aleksey Bochkov

Thanks for your help.

It runned, But I can read the SMS message in my Program. When a new message received, my program have no action. Can you give me a example or some command line instructions?
I want to write a program can read SMS on mobile device and write it's content to Information register.

 
#4
People who like this:0Yes/0No
Active user
Rating: 4
Joined: Nov 19, 2012
Company:

Ninh Giang Thi,

I guess you didn't check out Help information inside 1C at all ;).

Code
&AtClient
Procedure Attach(Command)
   
   #If MobileAppClient Then
      
      ND = New NotifyDescription("OnMessageReceived", ThisForm);
      
      TelephonyTools.AttachSMSMessageHandler(ND);
      
   #EndIf
   
EndProcedure

&AtClient
Procedure OnMessageReceived(SMSMessage, Params) Export
   
   Message(SMSMessage.Text);
   
EndProcedure

 
#5
People who like this:0Yes/0No
Active user
Rating: 4
Joined: Mar 14, 2012
Company: GSPD

Aleksey Bochkov,

I copied your code to my application, then I try to runed it. But I do not know why It is still not running.
(I leave it on "OnStart" procedure of Configuration). Otherwise, how can I read all SMS received before in my phone when application running?

May I have not egnough some important details in my app?

Edited: Ninh Giang Thi - Feb 07, 2015 08:50 PM
 
#6
People who like this:0Yes/0No
Active user
Rating: 4
Joined: Mar 14, 2012
Company: GSPD

Aleksey Bochkov,

Could you send me your example configuration that runned? I try to use your code in my configuration many time but it do not run.

 
#7
People who like this:0Yes/0No
Active user
Rating: 4
Joined: Nov 19, 2012
Company:

Ninh Giang Thi,
If you want to start it in OnStart - you should change it a bit. See the attachments.

Quote
Otherwise, how can I read all SMS received before in my phone when application running?

I think it is impossible. You can get only call log.
But you always can create small native application, run it from 1C and get whatever you want.
Check out "MobileDeviceApplicationLaunch" in Syntax assistant.

Download 1Cv8.cf (7.41 KB)
Edited: Aleksey Bochkov - Feb 09, 2015 09:03 PM
 
#8
People who like this:0Yes/0No
Active user
Rating: 4
Joined: Mar 14, 2012
Company: GSPD

Aleksey Bochkov,

I got your configuration, and then built it to my mobile.
But It did not run, my mobile use Android 4.2.2.
May I need some change in Configuration setup or change something in my mobile? Or it need special requirement?

 
#9
People who like this:0Yes/0No
Active user
Rating: 4
Joined: Nov 19, 2012
Company:

Ninh Giang Thi,
Sorry, I have no idea what is going on.

My phone - Galaxy S5, Android 4.4.2.
Mobile platform 8.3.5.96.
But I used developer mobile platform - configuration was loaded into platform as xml-file.
It is way much easier than building an apk each time.

 
Subscribe
Users browsing this topic (guests: 1, registered: 0, hidden: 0)
Be the first to know tips & tricks on business application development!

A confirmation e-mail has been sent to the e-mail address you provided .

Click the link in the e-mail to confirm and activate the subscription.