I am just very new on android development and Oxygene. A simple demo is runnging, but how can I use the SupportLibrary with it’s Material Design Theme? I already added the appcompat-v7 package as reference into VS, but in the uses section a cannot use e.g.: android.support.v7.app.AppCompatActivity
Thanks for the quick response, but there is no such namespace e.g. android.support…
I clicked on add reference and selected: appcompat-v7-23.0.1-sources
But it seems, adding this reference does nothing. Is there something else to do?
That’s the wrong one, you want android-support-v7-appcompat, and android-support-v4, and set both to have CopyLocal true (properties of the reference). I’ll work on hiding the *sources and *docs.
Hm … where do find them?
In the reference list, there is not such a package name. I am using the SDK folder which Android Studio is using: C:\Users\USERNAME\AppData\Local\Android\sdk
It seems that package name is composed of folders:
C:\Users\USERNAME\AppData\Local\Android\sdk\extras\android\m2repository\com\android\support\appcompat-v7\23.1.0
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="org.me.androidapplication8">
<!-- the android:debuggable="true" attribute is overwritten by the compiler when the debug info option is set -->
<application
android:label="@string/app_name"
android:icon="@drawable/icon"
android:theme="@style/Theme.AppCompat.Light"
android:debuggable="true">
<activity android:label="@string/app_name" android:name="org.me.androidapplication8.MainActivity">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
</application>
<uses-sdk android:minSdkVersion="4" />
</manifest>
The activity:
using java.util;
using android.app;
using android.content;
using android.os;
using android.util;
using android.view;
using android.widget;
namespace org.me.androidapplication8
{
public class MainActivity: android.support.v7.app.AppCompatActivity
{
public override void onCreate(Bundle savedInstanceState)
{
base.onCreate(savedInstanceState);
// Set our view from the "main" layout resource
ContentView = R.layout.main;
}
}
}
Seems older android versions give a very strange class load exceptions, the newer ones give a proper error. Anyway I’m glad it’s solved. Turned this into a snippet for future use Creating an AppCompatActivity in Elements