Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 13 Next capture
2021 2022 2023
1 capture
13 Jun 22 - 13 Jun 22
sparklines
Close Help
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
  • Asset Store
  • Get Unity

UNITY ACCOUNT

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account
  • Blog
  • Forums
  • Answers
  • Evangelists
  • User Groups
  • Beta Program
  • Advisory Panel

Navigation

  • Home
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
    • Blog
    • Forums
    • Answers
    • Evangelists
    • User Groups
    • Beta Program
    • Advisory Panel

Unity account

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account

Language

  • Chinese
  • Spanish
  • Japanese
  • Korean
  • Portuguese
  • Ask a question
  • Spaces
    • Default
    • Help Room
    • META
    • Moderators
    • Topics
    • Questions
    • Users
    • Badges
  • Home /
This post has been wikified, any user with enough reputation can edit it.
avatar image
1
Question by taar1 · May 28, 2012 at 05:53 AM · androidandroid-manifestandroidjavaobject

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.

Comment
Add comment
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users

3 Replies

· Add your reply
  • Sort: 
avatar image
2

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

Comment
Add comment · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image
0

Answer by cenk5355 · Dec 21, 2012 at 08:59 AM

Thanks for your valuable sharing.

Comment
Add comment · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image
0

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?

Comment
Add comment · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users

Your answer

Hint: You can notify a user about this post by typing @username

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this Question

Answers Answers and Comments

6 People are following this question.

avatar image avatar image avatar image avatar image avatar image avatar image

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

Unable to retrieve return values from android library (aar file) to c# in unity 5.3.4p3 (string,int,bool) using AndroidJavaClass.Call() 3 Answers

Android export error -> CommandInvokationFailure: Failed to re-package resources. 0 Answers

App crashes on Android 7.11 2 Answers


Enterprise
Social Q&A

Social
Subscribe on YouTube social-youtube Follow on LinkedIn social-linkedin Follow on Twitter social-twitter Follow on Facebook social-facebook Follow on Instagram social-instagram

Footer

  • Purchase
    • Products
    • Subscription
    • Asset Store
    • Unity Gear
    • Resellers
  • Education
    • Students
    • Educators
    • Certification
    • Learn
    • Center of Excellence
  • Download
    • Unity
    • Beta Program
  • Unity Labs
    • Labs
    • Publications
  • Resources
    • Learn platform
    • Community
    • Documentation
    • Unity QA
    • FAQ
    • Services Status
    • Connect
  • About Unity
    • About Us
    • Blog
    • Events
    • Careers
    • Contact
    • Press
    • Partners
    • Affiliates
    • Security
Copyright © 2020 Unity Technologies
  • Legal
  • Privacy Policy
  • Cookies
  • Do Not Sell My Personal Information
  • Cookies Settings
"Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • Default
  • Help Room
  • META
  • Moderators
  • Explore
  • Topics
  • Questions
  • Users
  • Badges