简体   繁体   English

如何使用C#(Xamarin)单击按钮即可将数据保存在Android的内部存储中

[英]How To Save Data In Android's Internal Storage On A Click Of A Button using C#(Xamarin)

I want to save some kind of data on a click of a button to the internal memory of the android. 我想单击一个按钮来保存某种数据到android的内部存储器。 Actually i want to create the backup of the data. 实际上,我想创建数据的备份。 Is there any such way? 有什么办法吗? Please help me with restoring of the backup as well. 请也帮助我还原备份。

Thanks in advance. 提前致谢。

If your data is Simple string then you need to create one Dependency Service in Xamarin Forms project and implement it into Android Project. 如果您的数据是简单字符串,则需要在Xamarin Forms项目中创建一个依赖服务,并将其实现到Android Project中。 In Android Project use shared preference for save and retrieve data. 在Android Project中,使用共享首选项保存和检索数据。

For Dependency service - https://developer.xamarin.com/guides/xamarin-forms/dependency-service/introduction/ 对于依赖性服务-https://developer.xamarin.com/guides/xamarin-forms/dependency-service/introduction/

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 如何使用C#Xamarin模拟Android中的电源按钮单击? - How to simulate a click on the power button in Android with C# Xamarin? 如何将一个TXT文件从Assets文件夹复制到SD /内部存储Android C#Xamarin - How to copy one TXT File from Assets folder to SD / Internal Storage Android C# Xamarin 如何在单击按钮时显示SfBusyIndi​​cator? C#xamarin.android天蓝色android - How to show a SfBusyIndicator on a button click? c# xamarin.android azure android 声明按钮单击时出错-Android C#Xamarin - Error when declaring Button Click - Android C# Xamarin 如何使用 Unity 从 android 内部存储访问图像和 3D object ZD7EFA19FBE7D3972FD5ADB6024223D74 - How to access Images and 3D object from android internal Storage using Unity C# 如何在按钮上发送远程通知单击? Xamarin.Android C# - How to Send a Remote Notification on a Button Click? Xamarin.Android C# 如何使用Selenium,Android和C#单击设备后退按钮 - How to click device back button using Selenium, android and C# C#Xamarin editText单击按钮,然后滚动到listview项,怎么办? - C# Xamarin editText click on button and then scroll to listview item, how? 下载文件到内部存储的某个路径{ C# Xamarin } - Download Files into a certain path in the internal Storage { C# Xamarin } C#Xamarin按钮ICommand或Click事件 - C# Xamarin button ICommand or Click event
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM