Forum Xamarin.Android

Unable to open database file (code 14)

Balaji.1405Balaji.1405 USMember ✭✭
edited July 2019 in Xamarin.Android
            SingleSignOnStatus ssoStatus = new SingleSignOnStatus();

            // Android Launcher uses the Android Content Provider service to store SingleSignOn Credentials
            Android.Net.Uri uri = Android.Net.Uri.Parse(SSO_QUERY_USERINFO);

            // Get the ContentResolver and query for the UserID field
            ContentResolver cr = Application.Context.ContentResolver;

            Android.Database.ICursor c = cr.Query(uri, projection, null, null, null);
            if ((c != null) && c.MoveToFirst())
                // Get UserID String
                int id = c.GetColumnIndex(SSO_QUERY_USERINFO_USERID);
                ssoStatus.Username = c.GetString(id);
                id = c.GetColumnIndex(SSO_QUERY_USERINFO_USERROLE);
                ssoStatus.UserRole = c.GetString(id);
                id = c.GetColumnIndex(SSO_QUERY_USERINFO_USEROSVersion);
                // Get UserOSVersion String
                ssoStatus.UserOSVersion = c.GetString(id);
                id = c.GetColumnIndex(SSO_QUERY_USERINFO_USERTERMINALID);
                // Get UserTerminalId String
                ssoStatus.UserTerminalId = c.GetString(id);

            return ssoStatus;


  • LeonLuLeonLu Member, Xamarin Team Xamurai

    When you enable the SSO, did you request following permissions? Do you want to enable the SSO for Azure?

    <uses-permission android:name="android.permission.GET_ACCOUNTS" />
    <uses-permission android:name="android.permission.USE_CREDENTIALS" />
    <uses-permission android:name="android.permission.MANAGE_ACCOUNTS" />

    If you still cannot open the database file, which error did you get?

Sign In or Register to comment.