I have a strange development problem in Scala on Android. I am using the sbt android plugin and now I am trying to get the content providers to work, but ...
I need to get an array of columns, and I do it exactly the same as in the tutorial: http://developer.android.com/guide/topics/providers/content-providers.html
Just replaced the Java array code with Scala one. It looks like this:
val projection = Array( People.NAME, People.NUMBER )
But then the Scala compiler returns an 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 in fact, this is a member of this object, and it is defined in the android.provider.Contacts.PeopleColumns interface (which is implemented by people). I tried to get it directly from PeopleColumns without any success (same error). Is getting constants from Java in Scala somewhat different, or did I just make a stupid mistake somewhere?
UPDATE:
The next problem. When using ContactsContract.Contacts, the error remains the same, and when I try another method, I can not access ContactsContract.ContactsColumns directly, because it is a secure 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
exine
source share