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 6127663
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T16:32:13+00:00 2026-05-23T16:32:13+00:00

I have a strange problem with developing in Scala on Android. I’m using sbt

  • 0

I have a strange problem with developing in Scala on Android. I’m using sbt android plugin and right now I’m trying to get content providers working, but…

I need to get array of columns, and I’m doing it exactly like in tutorial here: http://developer.android.com/guide/topics/providers/content-providers.html

Just replaced Java’s array code with Scala one. It looks like this:

val projection = Array(
  People.NAME,
  People.NUMBER
)

But then, scala compiler returns error

[error] /home/exine/proj/hello-world/src/main/scala/Activity.scala:12: value NAME is not a member of object android.provider.Contacts.People
[error]     People.NAME,
[error]            ^
[error] one error found

And actually it is member of this object, and it’s defined in interface android.provider.Contacts.PeopleColumns (which is implemented by People). I’ve tried getting it directly from PeopleColumns too without any success (same error). Is getting constants from Java in Scala somewhat different or I just made a stupid mistake somewhere?

UPDATE:

Next problem. When using ContactsContract.Contacts error stays the same, and when trying another method I can’t access ContactsContract.ContactsColumns directly because it’s protected interface.

[error] /home/exine/proj/hello-world/src/main/scala/Activity.scala:13: object ContactsColumns cannot be accessed in object android.provider.ContactsContract
[error]     ContactsColumns.LOOKUP_KEY,
[error]     ^
[error] one error found
  • 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-23T16:32:14+00:00Added an answer on May 23, 2026 at 4:32 pm

    This context is deprecated according to the reference. The new way is ContactsContract, and you should use that.

    Anyway, the problem is that this constant is a static defined on the interface PeopleColumns. Inheritance of statics is something that Java has but Scala doesn’t, and it’s frowned upon even in Java.

    Try importing PeopleColumns and using PeopleColumns.NAME instead — or, better yet, use the new, non-deprecated, way of doing things. Which I don’t explain because I have no knowledge of Android development.

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

Sidebar

Related Questions

I have a strange problem with lxml when using the deployed version of my
I have a strange problem on my htc hero. When launching camera, i get
I have a strange problem... I am developing a web app to search house
I am developing an Android application with MapView and I have a very strange
I have strange problem. I have own remote repository and upload their plugin. Then
I have strange problem: when I use mu repository stub I get strange exception:
I have a a strange problem with nuke modules i've been developing for a
My problem is somewhat strange. I have started developing a web page with Aptana
I am developing an Eclipse RCP application and have a strange problem: I open
I'm currently developing an responsive website. I have a very strange problem in Google

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.