Setting up Renderscript - android

I've decided to start learning Renderscript as a possible solution to my next project. However, I'm having trouble even getting Eclipse to run the thing. I'm importing the examples that come with the SDK 11. It seems to have trouble importing the headers. Eclipse doesn't recognize the directives like pragma or extern. Also, whenever I include a required file such as rs_core.h a message pops up stating llvm-rs-cc.exe has stopped working. I assume there's some sort of setup that I'm missing, but I can't find anywhere on the web that explains it.

"Replace /platforms/android-[11|12|13]/renderscript with the version located at /platforms/android-14/renderscript" see this question.

Related

Xamarin Forms Android Error Message Regarding Support Package and other packages

I am a complete newbie who has just about started android app. development using Xamarin Forms and VS2012. Only about 20-21 days of exposure I have got. I am trying to learn along the way through writing an imaginary practice app. But there are some errors I am getting. You can see them in the picture.
http://imagebin.ca/v/29PeHoLhwW1i
Can someone direct me what exactly it is saying and what I need to do in order to rectify them?Is there something wrong with the installation/environment or like some update? Or is it something else? What's with the "unzipping failed" message?
Some one kindly help me out here please. Facing great deal of difficulty in tackling this.
Many Thanks in advance.
As the error message says (see the third error message ), you need to install the "Android Support Repository" from the Android SDK manager.
The errors are telling you that Xamarin is looking for the support library, but that it cannot find the support library and thus the build failed.
#Tanis.7x and #Jason.
Just an update I want to post:
I went about reproducing this scenario: creating a new project, do some primary simple code, add 1,2 layouts et all. When I build the new project, these 9 errors don't appear. This is strange to me. Because: this is exactly what had happened to my main work also. These errors were not there. Something, somewhere happened along the line, due to which they started appearing suddenly; out of the blue. I remember, I had updated Xamarin version, also just added some packages like JSON.Net and it is only after that this error list appeared. Not before that, if I remember correctly. Which is weird to me. If you try to recreate by creating a brand new project these 9 errors won't appear. I tried recreating this twice; no errors.
Yes, I'm manually downloading the zip file. Hopefully this makes the compiler happy. I'll keep posted about the updates.
Thanks All!

"Cannot create extension" in Eclipse (Android)

I recently started using eclipse to compile my Android code (which I'm also pretty new at) and I tried to download another eclipse.exe that was supposed to be for C++. Anyways, I don't know if that would be the cause of my problems but I noticed that after I tried to give myself the option of compiling C++, just the main file in my Android project gave me the error "cannot create extension." Anyone know how I can fix this? Again, it's just in the one file so i wouldn't think it's a setting issue but I'm not really sure.
This is what my window looks like
TIA

Android ActionBarCompat Not working from the start

OK, I have been wanting to try the new ActionBarCompat, however, I am not able to run my programs in the emulator.
I have been trying to implement the following: http://antonioleiva.com/actionbarcompat-how-to-use.
and have been stuck on basically the first part. However, working with the author of that content, I was able to get further as I was not adding the project under sdk\extras\android\support\v7\appcompat folder like stated. However, I still think that might be the reason I cannot do this...
More detail can be found here: http://antonioleiva.com/actionbarcompat-how-to-use/#comment-43
Basically, on my first attempt, I just created an Android project, and changed the source code as indicated. Code would not run on the emulator. So I went back to the original code, and that ran on the emulator.
Checked online, found out I might need to add the \extras\android\support\v7\appcompat folder as a library to the project I am building. So I added that and a new android project was created. There were build errors from the start, but I failed at trying to add it as a library to my project, and deleted it....thinking this was way overboard.
After back and forth chats with author of linked website, I found out I had to do that overboard thing.
So I tried the following link to the T: (I cannot post more than 2 links due to low repuation...I will add this link as a comment below)
However, Eclipse would not allow me to add the appcompat Existing Android Project...but it did allow me to add the appcompat Existing (General) Project. I think this may be some of the problems??
Right now, I cannot run the project at all. Eclipse is showing a red exclamation mark on the project folder, but all the code seems to be fine. So I don't know what to do now...I recreated this project several times over, and this one was the one where I knew what to do...and I am still getting problems
So...
I decided to move to Android Studio...updated the IDE, updated the SDK manager to include the new support library, and other things. Created a new project, added to the build.gradle file as shown in the link provided below in the comment. I ran the ant build, and then built the project...tried to import the right things to allow ActionBarActivity, but I could not get that far.
I can import
"android.support.v7.*"
"android.support.vy.R" // and all folders within
but nothing allows me to add ActionBarActivity, and I don't know why.
FYI, I guess I would prefer a solution to Ecplise, as it seems like I actually got somewhere with it.
The best example to use is from here, and I would follow it closely. I had similiar issues when I first came across this. Problem was I misunderstood what I needed to do
http://developer.android.com/tools/support-library/setup.html#libs-with-res

libgdx and TWL: Android app force closes on any TWL menu, works fine on Desktop

I am implementing menus using TWL (http://twl.l33tlabs.org/) in an app written using Libgdx. The app runs fine if I don't start any menus, but as soon as I go to a menu screen it immediately force-closes. Menu screens work fine on the desktop version.
In which build path should TWL-android.jar be included (right now it behaves the same in main, android, and both)? And how will the program know to use the libraries from this .jar instead of the default gdx-twl.jar? Will I have to manually implement something in code to use one or the other depending on platform?
There does not seem to be any documentation or sample code of anyone using TWL on android, only mentioning that it can be done.
Running debugger attached to phone gives the following logcat error:
Could not find class 'com.badlogic.gdt.twl.Layout' referenced from method com.Nanners.OptionsScreen.<init>
I think that TWL-android.jar should be added to android project's build path too. Location of .jar is not relevant.
When you add TWL-android.jar. As that is Android specific you can't use it on the core project, so the classes you are importing are the ones from gdx-twl. To make it simpler to explain I will divide it in different escenarios.
You add TWL-android to your Android buildpath. But you use Gdx-twl in your core project. Which isn't added. Thus getting a:
Could not find class 'com.badlogic.gdx.twl.Layout'
You add both TWL-android AND Gdx-twl to your build path. Thus getting duplicated classes and:
Conversion to Dalvik format failed with error 1
Solution
If you use TWL-android classes, you can only do it inside the Android project:
Merge Core, Desktop and Android project. Or
Use Interfacing with Platform Specific
If you use Gdx-twl:
Don't do it.
Actually the best solution is to get rid of all twl stuff and use Scene2d.Ui instead. Its crossplatform and much easier to use.

Does UCDetector work for android projects?

I've got an android project that I started from an old standard Java project, so because of the vast difference in target platform, I have a lot of dead code to cleanup.
I've seen UCDetector recommended for finding unused public methods in java projects in Eclipse. I installed it as directed, and it just doesn't show up on the menu, and I have no idea how to get it to work.
Has anyone got this combo to work, or have another recommendation? Or know how to get it to show up?
(I've tried Find Bugs which found some good stuff, but it doesn't find unused public code.)
Big warning!
It might partially work, but beware, cause it doesn't seem to know about XML-defined callback functions.
If you have installed a callback function on a widget, say a button in an XML Style Sheet, and it is not called in code, UCdetector will think it has 0 references, and suggest it deleted. This obviously is wrong, and will render your code uncompilable.
There might be other similar issues, related to Android specifics.
Viggo
Yes, UCDetector works for android projects. I just installed it and it works.
It's available in context menu of project in Package Explorer.

Categories

Resources