我是Xamarin的新手,正在尝试创建一个应用程序。当我尝试在7以下的Android中创建SQLite数据库时,它运行良好。但是,当我尝试在7和7.1中创建数据库时,出现此错误。对于此问题,请参见Xamarin论坛的链接,并且我集成了代码:
public SQLite.Net.SQLiteConnection GetConnection()
{
var sqliteFilename = "ADB.db3";
string documentsPath = System.Environment.GetFolderPath(System.Environment.SpecialFolder.Personal);
var path = Path.Combine(documentsPath, sqliteFilename);
if (!File.Exists(path))
{
using (var br = new BinaryReader(Android.App.Application.Context.Assets.Open("ATSDB.db3")))
{
using (var bw = new BinaryWriter(new FileStream(path, FileMode.Create)))
{
byte[] buffer = new byte[2048];
int length = 0;
while ((length = br.Read(buffer, 0, buffer.Length)) > 0)
{
bw.Write(buffer, 0, length);
}
}
}
}
// var plat = new SQLite.Net.Platform.XamarinAndroid.SQLitePlatformAndroid();
var plat = new SQLite.Net.Platform.XamarinAndroid.SQLitePlatformAndroidN();
var conn = new SQLite.Net.SQLiteConnection(plat, …Run Code Online (Sandbox Code Playgroud) 我正在为 Android 和 IOS 创建 Xamarin Form PCL 项目。是否可以在屏幕上同时显示多个权限?我的应用程序正在使用位置、存储和相机权限。从我当前的代码来看,这是在不同页面上一一显示权限弹出窗口,就像使用相机之前一样,我显示相机权限弹出窗口。据我所知,我的应用程序需要三个权限,因此我想为所有三个权限显示一个弹出窗口。下面是我的存储权限代码。
public static async Task<dynamic> CheckStoragePermission()
{
var result = "";
try
{
var Storagestatus = await CrossPermissions.Current.CheckPermissionStatusAsync(Plugin.Permissions.Abstractions.Permission.Storage);
if (Storagestatus != PermissionStatus.Granted)
{
await Utils.CheckPermissions(Plugin.Permissions.Abstractions.Permission.Storage);
}
}
catch (Exception ex)
{
error(ex.Message, Convert.ToString(ex.InnerException), ex.Source, ex.StackTrace);
}
return result;
}
Run Code Online (Sandbox Code Playgroud)
希望有人以前以 xamarin 形式这样做过,我将感谢您对此的帮助。
我已将一个APK上传到Google Play商店。但是在直播之后,我在Google Play商店的直播APK中发现了一些问题。我当前的APK版本是1.5,我想在Google Play商店中取消当前的APK 1.5和上一个早期版本1.4。
感谢你的帮助。
我的Windows窗体有一个ADD按钮,每次单击后都会在窗体中添加一个组合框.问题是,我无法在运行时将其绑定到表列.使用现有数据绑定源在所有组合框中选择相同的值.我在C#中编码
这是示例代码:
ComboBox ocbNext = new ComboBox();
//HAVE set the rest of the properties right, the problem is with the databinding
ocbNext.DataSource = this.dummysubjectBindingSource;
ocbNext.DisplayMember = "sub_name";
ocbNext.ValueMember = "sub_name";
this.Controls.Add(ocbNext);
Run Code Online (Sandbox Code Playgroud) 如果我停留在我的默认页面上然后显示图像,但是当我继续浏览另一页图像时,我已将此放在我的MasterPage中.你能帮我解释为什么这不适用于另一页.
<ul id="scroller">
<div class="serv"> <a href="#" onmouseover="document.wordpress.src='images/wordpress-development_red.png'" onmouseout="document.wordpress.src='images/wordpress-development.png'"> <img src="images/wordpress-development.png" name="wordpress"><br />
WORDPRESS </a>
</div>
<div class="serv1"> <a href="#" onmouseover="document.Android.src='images/mobil-app-development_red.png'" onmouseout="document.Android.src='images/mobil-app-development.png'"> <img src="images/mobil-app-development.png" name="Android"/><br />
Android</a>
</div>
</ul>
Run Code Online (Sandbox Code Playgroud) 如何DateTimePicker在WinForms中只显示月份和年份?
我希望价值像January 2013.