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