Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to connect to other android native app Database #746

Closed
yasser-mas opened this issue Jan 28, 2018 · 1 comment
Closed

How to connect to other android native app Database #746

yasser-mas opened this issue Jan 28, 2018 · 1 comment

Comments

@yasser-mas
Copy link

I would like to connect to other android native application Database ,

I have created shared database in android native app and content provider

I have created a permission and uses permission to ionic app

I can access to database in ionic app from main activity before loadUrl(launchUrl);

by the below code :

  contentResolver = getContentResolver();
  cursor = contentResolver.query(table_URI, mColumnProjection, "grade > 8", null, null);

  // here is the cursor to choose among the database columns one by one and adding contents of the columns in the string builder

  if(cursor != null && cursor.getCount() > 0)
  {
    StringBuilder stringBuilderQueryResult=new StringBuilder("");
    while (cursor.moveToNext()){
      stringBuilderQueryResult.append(cursor.getString(0)+" , "+cursor.getString(1)+" , "+cursor.getString(2)+"\n");
    }
    Toast.makeText(this, stringBuilderQueryResult.toString()  , Toast.LENGTH_LONG).show();

  }else{
    Toast.makeText(this,"No Content" , Toast.LENGTH_LONG).show();
  }

but I can't access to database from Ionic native sqlite

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants