As the title says, I have an existing Android project and I want to import Unity classes.jar so I can access the UnityPlayer.UnitySendMessage.
I found this other question with similar goal, but the answers were unintelligible or unhelpful.
I also found this on the Unity forums, but it is apparently very outdated (2011).
Essentially, all I'm trying to do is:
Open up an Android application.
Select which scene (or, preferably, more than one scene) I want to view from the Unity app.
Launch the Unity GearVR application.
Play the selected scene(s).
I've already got steps 1 and 3 working, and steps 2 and 4 I'm making work by loading each scene up as a different APK and launching a specific APK depending on which scene I want to view, but, ideally, I could host all the scenes in a single application so I could then watch several off the scenes in a row (and also so I could cut down significantly on memory usage).
I've found some tutorials on using UnityPlayer.UnitySendMessage, so I think I can get it working if I can only get Android Studio to recognize and use UnityPlayer.UnitySendMessage, but if you have any other ideas, I appreciate those as well!
I've found some tutorials on using UnityPlayer.UnitySendMessage, so I
think I can get it working if I can only get Android Studio to
recognize and use UnityPlayer.UnitySendMessage
Get classes.jar from one of the sub-folders from
<UnityInstallationDirectory>\Editor\Data\PlaybackEngines\AndroidPlayer\Variations\mono
or
<UnityInstallationDirectory>\Editor\Data\PlaybackEngines\AndroidPlayer\Variations\il2cpp
depending on if you are using mono or IL2CPP as Scripting Backend to build your Android Project.
Import it into Android Studio. Right-click on it and click Add As library and Android Studio should add it as library. See this if you are still confused. You can now use UnityPlayer.UnitySendMessage.
As for the rest of your question, I think that you should look into this answer. It explains how you can show Unity scene in a sub-view. That is another way to get what you want.
Related
I am quite new to azure hubs. But spent three days to understand the flow(to use in xamarin forms).
Currently tying to link with android only(through xamarin forms). So when I thought everything needed is ready(GCM key and azure access policies) from my side, I started coding using vs2015.
First thing I did was creating "Blank portable cross platform" project.
Then,tried to install Microsoft.Azure.NotificationHubs package. PFA
But I am getting following errors( related to Profile259).
I spent whole day to understand what error is saying and I understood that package is expecting different target framework than what I am referring.
So I tried changed to other versions and through some blogs I found that maybe this Profile259 directory is missing.But it's all there.
Package is expecting .Net Framework 4.5 Full Profile. I cross checked it by following the link
I updated my azure version.Nuget package is also latest.
So what could possibly go wrong.
Please guide me in right way to get push notifications in devices.
PFA below.
I had to add it as a component. Go to the Components under the Android and iOS project, select edit components off the context menu, and add the "Azure Messaging by Xaramin" component. You'll probably have to download it by clicking "Get More Components".
If you're working on Android only for now, try removing all other targets from screenshot #2. There's a chance the error message is caused by one (or all) of the Windows targets.
I'm very new to eclipse, and for a first project I want to make an android app. The problem is that every time I try to create the project, I get all these errors about 'Theme.AppCompact.something". I know many people have asked this question, but either I can't get it to work or I don't understand. If you could answer like I'm 5 or use screenshots that would be great (since I have been trying to fix this forever now).
I'm very interested about java and eclipse (coming from C# unity) and I want to start this android project but I cannot with this error.
I am new in developing apps for Android with Java Eclipse.
I get a simple problem: after following the procedure explained here:
http://www.tutorialspoint.com/android/android_hello_world_example.htm
I tried to push the "Finish" button to create my first app, but it doesn't work: the wizard remains open and nothing happens.
Also, I have several problems in the Demo apps, errors like:
'<>' source operator is not allowed for source level
and many more.
I guess I created problems with the configurations.
Thanks if you can help me to create my first app for Android and to load
the demos.
It is really had to tell what is the problem, but as Abdullah advised to use android studio because it is well designed to develop android applications. and most of the company's now days use android studio as there IDE preference, but still its developer's choice. Eclipse ADT plugin is buggy
I am new to android app development. I need to develop a very simple app that could detect coloured circles.Can someone please tell me in detail how to use openCV Circle Recognition code in developing a simple android app that can detect coloured circles. I am currently using openCV+ Eclipcs but it does not allow me to compile the source code in to .apk file
I have already done what u are saying...I have done the following
I download the full NVidia tegra-devpack-2.0-windows-2013-02-06-14961502 and installed It contains both android ADT for eclipse and eclipse also. It also contains the open CV and it automatically configures everything.
Everything works fine when I make a new android app like “my first HELLO WORLD app” and I can even install it to my android phone that means everything is working fine and everything is configured correctly.
The problem arises when I try to import the source code of the “CVCamera” an common app for detecting circles in android devices
When I import it in the eclipse as an android project from existing code it gives me following 2 errors
(a) Project 'CVCamera' is missing required Java project: 'OpenCV'
(b) The project cannot be built until build path errors are resolved.
I have tried lots of things I even tried to link the open CV library to the project but of no use
I have a simple objective I want to develop an android application for detection of coloured circles by using the already available code on the web. Please help me in achieving the following
I am using openCV4android . I can even create new apps but the problem arises when i try develop the application by using already made source code. I am using the sources code of the CV camera app which has been already developed by so many developers Following is the link of the error I am getting in the eclipse.
Please see the image
Following is the link of the CV camera application which I am trying to import
stanford.edu/class/ee368/Android/OpenCV/CVCamera_Canny.zip
Here is the link for another error “Build path entry is missing: OpenCV”
image
building workspace problim image
Use opencv4android in eclipse.
Before that you should deploy android ADT for eclipse, or download bundle for android dev.
Then follow the tutorial at opencv official site to start your way to android.
Use hough transform for circle detection.
You must link JavaCV lib into your project rather than OpenCV.
Android app cannot use OpenCV(C++) unless you use JNI, which is far beyond the scope of this question.
So please follow the tutorial for using JavaCV on Android rather than doing the import stuff on your own. Please make some JavaCV examples compile and run on your phone before you try to adapt the code.
Besides I strongly recommend you use openCV4android, which is sure to work, rather than JavaCV + Android, which takes your considerable time coping with configuration and integration.
I have a project template , when i want to produce a unique application manually to update it to the market. I will follow these steps :
Right click in the package name
Refactor, then Rename
Renaming the package in minifest then update the version code
finally to clean the code from imports errors such as *.R; errors
My question is there any tool that automate this refactoring process without being involved on it ?
i tried to create a java tool but it consumes memory and some things i have to finalize it manually , i'm searching for this since 3 days and nothings gives you a clear answer.
My question is there any tool that automate this refactoring process without being involved on it ?
The new Gradle-based build system can handle this scenario. In fact, it allows you to separate the package name used by R.java (to keep it consistent) and the package name used for determining whether the app is unique on the device and in the Play Store.
I recommend that you watch "The New Android SDK Build System" video from the Google I|O 2013 conference to learn more about what it can do, as Xav definitely covers this scenario.
Note that while it is not a "right click", it should make scripting a solution fairly easy.
Thank you all, I've solved this problem by converting the template project into JAR and let another small project handle every thing , I've created a small method that updates the minifest in that small project and i had to update package,ver name and ver code ONLY ,then I've generated the APK using ANT ,however i tested the project and it works fine , hope this will help another people