Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6707805
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T07:40:58+00:00 2026-05-26T07:40:58+00:00

According to android documentation it has full sqlite support. Does it mean that I

  • 0

According to android documentation it has full sqlite support. Does it mean that I can use core functions as part of projection for query, like this:

final ContentResolver cr = getContentResolver();    
final String [] projection = new String []{
    ...,
    ...,
    "replace(...) as replacedCol"
};

Cursor c = cr.query(uri, projection, null, null, null);

This snippet throws IllegalArgumentException (Invalid column replace(…)).
So is there way to use core functions in sqlite queries?

edit the error is likely to be caused by ContentProvider, which checks for allowed columns, so it seems that using functions with content resolver is impossible.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-26T07:40:59+00:00Added an answer on May 26, 2026 at 7:40 am

    projection in provider query <> columns in sql query

    usually ContentProvider contains

    static final HashMap<String, String> map = new HashMap<String, String>();
    static {
      map.put("NameInProjection", "RealDBColumn AS NameInProjection");
      map.put("replacedCol", "replace(...) as replacedCol");
    }
    

    and in query method of ContentProvider we use it like

    public Cursor query(Uri uri, String[] projection, String selection, String[] selectionArgs, String sortOrder) {
      SQLiteQueryBuilder builder = new SQLiteQueryBuilder();
      builder.setTables(table);
      builder.setProjectionMap(map);
      return builder.query(mDB.getReadableDatabase(), projection, selection, selectionArgs, null, null, sortOrder);
    }
    

    so SQLiteQueryBuilder translate projection to real query using the map

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

According to the Android documentation, Instrumentation.ActivityMonitor is able to return an Activity that is
According to Androids documentation I get the impression, that Android only supports ISO 8601
According to what I have found so far, I can use the following code:
According to the feedparser documentation , I can turn an RSS feed into a
Calling setFocus(null) on the ItemizedOverlay does not 'unfocus' current marker. According to the documentation:
Can anyone tell me how to make a flexible AppWidgets in Android according to
As you can see in architecture diagram below android platform has been built using
According to http://developer.android.com/guide/practices/screens_support.html Normal screen with hdpi can have few resolutions, like 480X800 600x1024
I have an Android app that uses the AlarmService. According to the docs, I
In android, I am trying to implement an application that can play videos. In

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.