- Home /
Using Android JAR library (Smaad SDK) with Unity
I have to integrate a Japanese Ad-Service (similar like AdMob) to a Unity Android game and have problems getting this to work. It's pretty easy to get it to work in an Android project but I just can't get it working in the Unity Android game.
To integrate it in an Android project all I need to do is adding this code:
import jp.gmotech.MoreApps.MoreAppsActivity;
import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
public class MySmaadActivity extends Activity {
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
Intent i = new Intent(getApplication(), MoreAppsActivity.class);
i.putExtra("MoreAppsZoneId", "MY_USER_ID");
startActivity(i);
}
}
What I need to do now is to have the exact same functionality in the Unity Android game. So by pressing a button a window should open displaying the content of MoreAppsActivity.class.
I already integrated TapJoy to Unity which works great. So I think the namespace with a second Android plugin might be a problem?
I've followed a lot "creating an Android plugin for Unity" tutorials already but so far I had no luck getting this to work. If someone could help me with a step-by-step tutorial that would be great. Especially the namespace part and how to actually call the MoreAppsActivity.cass (Android view) is a bit confusing to me.
Thanks a lot for any help.
Answer by taar1 · Jun 05, 2012 at 02:13 PM
Okay, I figured out how to implement Smaad SDK into a Unity Android project. I've written a detailed tutorial on how to integrate this.
Here is the link: Tutorial on how to integrate Smaad SDK in a Unity Android game
Answer by xia_summer · May 20, 2014 at 11:13 AM
I've already use this
UnityPlayer.currentActivity.runOnUiThread(new Runnable() {
public void run() {
...
}
}
but there comes out:
Exception: java.lang.RuntimeException: Can't create handler inside thread that has not called Looper.prepare()
could you tell me why?
Your answer
Follow this Question
Related Questions
Get Phone number of android mobile device - Android native code to Unity c# 3 Answers
Using CustomUnityPlayerActivity, which inherits from UnityPlayerActivity, will cause problems. 0 Answers
Android export error -> CommandInvokationFailure: Failed to re-package resources. 0 Answers
App crashes on Android 7.11 2 Answers