https://developer.xamarin.com/recipes/android/fundamentals/activity/pass_data_between_activity/ xamarin的官網執行個體 超實用 https://developer.xamarin.com/recipes/android/controls/webview/call_csharp_from_javascript/ xamarin的官網 JS調用服務 超實用 https://developer.xamarin.com/recipes/android/controls/webview/load_local_content/ xamarin的官網 手機嵌入網頁開發 超實用 https://docs.microsoft.com/zh-cn/xamarin/android/app-fundamentals/broadcast-receivers 官網 廣播器使用 https://developer.xamarin.com/api/type/Android.Content.BroadcastReceiver/ 官網 函數文檔 https://docs.microsoft.com/zh-cn/xamarin/android/platform/android-manifest
xamarin清單網址
apk打包,打包就是存檔之後進行分布,存檔和分布是特有名詞,沒有準确的文檔,要參考下面兩個網站,自己學習完成。
https://blog.csdn.net/xsfqh/article/details/76974580 http://blog.yn137.com/yi-dong-app-kai-fa/xamarin-for-android-%E6%89%93%E5%8C%85%E7%BC%96%E8%AF%91apk%E6%96%87%E4%BB%B6%E8%AF%A6%E7%BB%86%E5%9B%BE%E6%96%87%E6%95%99%E7%A8%8B.html service長存設定,這邊部落格寫的很好。 https://blog.csdn.net/mad1989/article/details/22492519 輔助網站 http://www.android-studio.org/ 安卓官網社群 沒啥用 http://www.runoob.com/android/android-tutorial.html 安卓菜鳥教程 入門實用添加View.IOnClickListener ,btn_search.SetOnClickListener(this);開啟監聽
OnClick(View v)裡判斷控件 if (v.Id == Resource.Id.btn_search)
[Activity(Label = "Main", MainLauncher = true, Icon = "@drawable/icon")]
public class MainActivity : Activity,IGongAnView,View.IOnClickListener
{
TextView txt_result;
Button btn_search;
EditText btn_sitedomain;
protected override void OnCreate(Bundle bundle)
{
base.OnCreate(bundle);
SetContentView(Resource.Layout.Main);
txt_result = FindViewById<TextView>(Resource.Id.txt_result);
btn_search = FindViewById<Button>(Resource.Id.btn_search);
btn_sitedomain = FindViewById<EditText>(Resource.Id.btn_sitedomain);
btn_search.SetOnClickListener(this);
}
public void OnClick(View v)
{
if (v.Id == Resource.Id.btn_search)
{
string sitedomain = btn_sitedomain.Text;
string pattern = @"^[a-zA-Z0-9][-a-zA-Z0-9]{0,62}(\.[a-zA-Z0-9][-a-zA-Z0-9]{0,62})+$";
Regex reg = new Regex(pattern);
if (string.IsNullOrEmpty(sitedomain))
{
Toast.MakeText(this, "請輸入域名", ToastLength.Short).Show();
}
else if (reg.IsMatch(sitedomain))
{
progressDialog.Show();
presenter.showResult(sitedomain);
}
else
{
Toast.MakeText(this, "域名錯誤,請重新輸入", ToastLength.Short).Show();
}
}
}
}