I am trying to integrate unity to eclipse (more precise unity with qualcomm to eclipse) for android development. I followed the steps from here probably 10 times already and still have some features not to be working (Camera issues).
I am building an app which combines unity with qualcomm. I need a simple android development environment as well, so my idea is to make a part of it in unity and port to eclipse for further development.
If I build and launch my app straight from Unity everything works well: ARCamera, simple Camera and all other features work as intended. If I export the program to eclipse and launch it from there I get a black window on ARCamera and blue window if I change the view to simple Camera.
Does anyone has a clue what am I doing wrong?
If I am using qualcomm in eclipse (no unity) everything works
If I am using qualcomm in unity (no eclipse) everything works
If I try to export qualcomm with unity to eclipse - camera doesn't work
I am using HTC Nexus One
Mindaugai, do you have permissions properly set in the Manifest after you export to Eclipse? I'm refering to these:
<uses-permission android:name="android.permission.CAMERA" />
<uses-feature android:name="android.hardware.camera" android:required="true" />
You might also need this one:
<uses-feature android:name="android.hardware.camera.front" android:required="true" />
If someone is still interested what was the problem, the links above are missing few things:
Add classes.jar, QCAR.jar, and QCARUnityPlayer.jar to your custom Android project.
Copy config.xml and qcar-resources.dat from the StagingArea/raw/QCAR folder to the new project's assets folder.
Copy the AndroidManifest.xml file from the StagingArea to your new project as well.
Instead of extending PlayerActivity in your class, extend QCARPlayerActivity
By doing those things I managed to get it work.
I used
*Unity v. 1.5
*Vuforia SDK 1.5.9
*Android SDK 4.0
and I made it working, so either, the integration has been fixed or my slightly different approach just worked.
Here are steps I did:
Follow the integration instruction from here
In the library project add QCAR.jar and QCARUnityPlayer.jar from ./plugins to the build path
Make sure that those libraries are exported by checking proper checkboxes in Project properties > Java build path > Order and Export
Copy AndroidManifest.xml from the lib project to your custom project
Modify AndroidManifest.xml to link to your custom Activity that extends QCARPlayerActivity
It should work now.
Tips&Hints
If you are getting an error that says: error: Error: String types not allowed (at 'configChanges' with value 'fontScale|keyboard|keyboardHidden|locale|mnc|
mcc|navigation|orientation|screenLayout|screenSize|smallestScreenSize|uiMode|touchscreen').
just switch to higher SDK (I used 4.0 but 3.2 should work as well).
Related
I am currently working on a Xamarin.Forms application that uses native barcode scanning capabilities of the mobile device. I have integrated two different device SDKS from different manufacturers (Casio & Denso).
The main launcer is SplashActivity, which shows the splash screen, detects device info and launces one of the following:
CasioActivity
DensoActivity
These activities are responsible for subscribing to scan events raised by corresponding device.
Denso integration is done with a DLL file supplied by the manufacturer, while Casio integration is done through a Xamarin Bindings project, following this tutorial.
Deployment to Casio works fine but when I deploy the application on the Denso unit, I get the following error message in Visual Studio:
install_failed_missing_shared_library device.sdk is required
I believe that the Casio SDK (*.aar file) is forcing that the app runs only on Casio devices. I tried adding the following to the application manifest:
<uses-library android:name="device.sdk" android:required="false" />
and also tried adding the UsesLibrary attribute to all activities to make device.sdk optional but none worked. It appears that the bindings project is injecting the following to the manifest file on deployment:
<uses-library android:name="device.sdk" android:required="true" />
Is there any way to prevent the injection of the above line into the manifest file?
I would like to make the application compatible with both of these units.
I solved this by modifying the aar file.
Use 7zip to extract the aar file to a folder
Find the application manifest in the extracted folder
Set android:required attribute to false.
Zip the folder again
Change the file extension from .zip to .aar
Put the new file under Jars folder as shown here
I am having an issue in publishing my app in Google play when I include some plugins like cordova-plugin-geolocation in my app, as it adds the following 2 permissions in my manifest file
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
this causes an issue that some of the phones are not able to view the app in the google play as they tell me that android.hardware.location.network access is not compatible on those devices.
when I researched a bit more, I can see that this can be avoided by converting uses-permission to uses-feature and setting the android:required="false" then I can handle it in my code as this is not a must have feature for me.
My issue is I am unable to find how to change this in my visual studio project. can someone please help me understand whats the way to fix this?
Regards
Kiran
There is no way within VS to add contents to your Android projects manifest file. You will have to hand edit those, but beware that these changes would be over-written every time you build your project through VS. There are couple of ways you can workaround this -
You can add post_build Cordova hook that would update the Manifest file.
You can add a gulp task and hook this to MSBuild post_build event through VS.
SOak
(PM - Microsoft)
Using Eclipse, I was using android:minSdkVersion="10", got the error message that this was too low, and updated it to 18. After cleaning the project, refreshing and building Android Environment, I still get the same error message!
In Properties -> Android -> Project Build Target, I have selected Android 4.4.2, with an API level of 19.
in AndroidManifest.xml:
<uses-sdk android:minSdkVersion="18" android:targetSdkVersion="19"/>
ERROR:
"Call requires API level 17(current min is10):android.app.AlertDialog.Builder#setOnDismissListener"
How do I make sure my update in AndroidManifest really works?
Thanks in advance.
It has been a while since I've used Eclipse for Android development. If you're new to Android, I'd highly recommend that you check out Android Studio, instead.
Anyway, this sounds like a build issue. I'm imagining that you're using the default ant build script so in that case the most likely culprit is your project properties file.
Look for a file called "project.properties"
and add/modify a line to contain the following:
# Project target
target=android-18
It sounds like it's currently pointing to android-10. You can find more information on this file and others here.
I am trying to implement the ActionBar in a Mono Android application. Could someone provide me steps to including the ActionBar project in my solution? I have seen the sample projected provided at this url
https://github.com/xamarin/monodroid-samples/tree/master/ActionBarSherlock
Do I have to simply add a reference of the ActionBarSherlock project in that sample? When I attempt to add a reference to that project I get many errors such as "Error retrieving parent for item: No resource found that matches the given name 'android:TextAppearance.Holo.Widget.ActionBar.Menu'." in file abs_styles.xml
Has anyone else successfully added ActionBarSherlock to a Mono Android Project? Could you please provide me steps to get a simple example working?
Ok, this is how I got it working...
Open up the sample project and build just the 'ActionBarSherlock' project on Release mode. Make sure that the minimum target android version is 4.0.3 (required)
Take the dll and reference it in your project. I have found that you can get it to compile fine if your project has a minimum android version of 2.2 - I found that if you used profile version 2.1 it doesn't work, but that just might of been my app. Maybe your minimum version is too low? I also set my 'target' android to be the latest... I don't know if this helps too.
The reason I say to reference the dll instead of the project is that you will get the correct intellisense. Otherwise as you can see in the example project it does not (Makes working on it a pain!).
Make sure you have a reference to the v4 support lib in your project (Mono.Android.Support.v4)
The final step is that need to change your default theme to use a Sherlock theme. (see xml below for example)
Use the ActionbarSherlock.* namespaces when adding Actionbars etc...
Example manifest after adding ActionbarSherlock:
<manifest ...>
<uses-sdk android:minSdkVersion="8" android:targetSdkVersion="16" />
<application android:label="IDNT" android:theme="#style/Theme.Sherlock.Light.DarkActionBar" android:icon="#drawable/Icon">
</application>
</manifest>
BEWARE: There is a small issue with all this... If your project has a minimum version of under 3.0 (ie 2.2 as per my example) and you compile with linking (ie SDK assemblies only) you will get an error 'Mono.Cecil.ResolutionException: Failed to resolve Android.Database.IDatabaseErrorHandler'. I am currently sending support messages about this to Xamarin and will edit this post once I work out a fix.
EDIT: To fix the issue I have mentioned above make sure that the project options -> Application -> Minimum Android to target option is at LEAST 4.0.3. Your minSdkVersion can still be 7/8 or whatever so it will still run in older android versions. It also means you have to be careful you dont code in stuff that is for higher versions.
I'm a newbie for Android and I need help regarding this issue. I am developing a game using Eclipse. In my project, I added AndEngine and AndEngine Augmented Reality as libraries. I was testing the project out in my Android device, every time I tap the text which uses the class of AR, it force close. I was told to register AndEngine in my Android Manifest file. I have checked about it and used <uses-library />. Now, I placed these two lines in my manifest:
<uses-library android:name="org.andengine.extension.augmentedreality"
android:required="true"/>
<uses-library android:name="org.andengine"
android:required="true"/>
but I get this error message: Installation error: INSTALL_FAILED_MISSING_SHARED_LIBRARY
when I comment out those <uses-library /> lines, I can run the app but it force close when tapping the text that directs to the class of AR. Anything wrong in using it? Or any better way in doing it? Please post all your advises in an easy-to-understand-for-newbies way. THANK YOU!
<uses-library> is not meant to include libraries in your application. It is used to restrict app availability in Google Play based on the availability of a library already on the device like maps. AndEngine is a library project so include it in your build via Ant, Maven or whatever IDE you use.
In case you aren't familiar with what a library project is here's a link:
https://www.vogella.com/tutorials/AndroidLibraryProjects/article.html
If this element is present and its android:required attribute is set
to true, the PackageManager framework won't let the user install the
application unless the library is present on the user's device.
<uses-library> - specifies a shared library that the application must be linked against. This element tells the system to include the library's code in the class loader for the package.
creat a libs folder inside the res folder and put the AndEngine jars in it.set the class path of jar.