【问题标题】:Migrating from Xamarin to React Native: Xamarin SQLite Folder Path从 Xamarin 迁移到 React Native:Xamarin SQLite 文件夹路径
【发布时间】:2017-10-17 23:04:53
【问题描述】:

我目前的公司正在将应用程序从 Xamarin 迁移到 React Native。 问题是从 React Native 获取存储在 Xamarin 中的 SQLite 中的当前令牌。

这是在 Xamarin 中初始化 SQLite 的代码:

public static SQLiteConnection conn = new SQLiteConnection(System.IO.Path.Combine
        (System.Environment.GetFolderPath(System.Environment.SpecialFolder.Personal), "user.db"));


我尝试使用以下方法从 RN 中检索:https://github.com/andpor/react-native-sqlite-storage

但似乎我们需要指定文件夹路径。而且我不知道文件夹路径在 Xamarin 中的位置。



提前感谢您的回答。

【问题讨论】:

    标签: android sqlite xamarin react-native


    【解决方案1】:

    System.Environment.GetFolderPath(System.Environment.SpecialFolder.Personal)

    • 在 Android 中:/data/data/@PACKAGE_NAME@/files
    • 在 iOS 中:@APP_PATH@/Documents

    【讨论】:

    • 那么,就我而言,它存储在 'data/data/@PACKAGE_NAME@/files/user.db' 中?数据库名称是什么?
    • 是的,您的情况是“数据/数据/@PACKAGE_NAME@/files/user.db”。数据库名称是您在新建 SQLiteConnection 时指定的“user.db”。
    猜你喜欢
    • 1970-01-01
    • 2016-09-17
    • 1970-01-01
    • 1970-01-01
    • 2014-02-08
    • 1970-01-01
    • 1970-01-01
    • 2016-08-13
    • 1970-01-01
    相关资源
    最近更新 更多