1 Forms defines interfaces2 3 usingSystem;4 usingSystem.Collections;5 usingSystem.Collections.Generic;6 7 namespace 8 {9 Public InterfaceisystemsmsTen { One //Send SMS A voidSendsms (stringNumstringcontext); - } - } the - Platform Implementation - usingSystem; - usingSystem.Collections; + usingSystem.Collections.Generic; - usingxamarin.forms; + A usingAndroid.app; at usingandroid.content; - usingAndroid.runtime; - usingandroid.views; - usingAndroid.widget; - usingAndroid.os; - usingAndroid.telephony; in - using to +[Assembly:dependency (typeof(systemsms))] - namespace the { * Public classsystemsms:java.lang.object,isystemsms $ {Panax Notoginseng Publicsystemsms () - { the } + A Public voidSendsms (stringNumstringcontext) the { + varSmsuri = Android.Net.Uri.Parse ("Smsto:"+num); - varSmsintent =NewIntent (Intent.actionsendto, Smsuri); $Smsintent.putextra ("Sms_body", context); $ (Activity) forms.context). StartActivity (smsintent); - //Application.Context.StartActivity (smsintent); - the } - }Wuyi the}
View Code
Forms Android SMS