How to use Android Studio with Cocos2d-x - android

I work as an android programmer for just under a year now, and I just started to learn about android game development. The framework I choose to work with is Cocos2d-x.
I have seen guides and tutorials on how to use Cocos2d-x with eclipse, but I'd really like to know if it's possible to be used with Android Studio.
From what I've read, it is now possible to build NDK projects with gradle in Android Studio, which is good news. Nevertheless, I have yet to find any information about C++ programming using Android Studio. Eclipse uses the CDC ( https://www.eclipse.org/cdt/ ) plugin to achieve this.
Is there anything similar to be used with Android Studio? I have found some C/C++ enabling plugins for the IntelliJ Platform, but they were no longer updated.
Has anyone else tried this before? Did it work? Can you provide a step-by-step guide, for a newbie like me, who's dealing with this kind of problems for the first time?
Thank you for you time,
haxm

Android Studio currently isn't well set-up for native programming. While the build system supports the NDK, there's no editor support for C++ files (it's not as if it won't work, but the IDE won't give you any editing assistance), and neither is there any debugging support. JetBrains has announced that they're working on new C++ support for IntelliJ, and this is something we're looking at for Android Studio, but it's not on the roadmap yet.

Recent version of cocos2dx v3 (from github for example)
have proj.android-studio project
At this moment I have no success to build it but maybe in future it will be fixed

I just went through the setup for this example code. The project compiles and has a ton of sample code. Scott Barta's answer still stands as an important caveat, but wanted to share the link in case it was useful.
I also found this useful for some NDK background/how-to.

Related

Can I completely remove android support for my LittleKT project?

I am trying to create a LittleKT project in Visual Studio Code. I tried building a Gradle instance of the project but was told that I did not have an Android SDK. I installed the Android SDK Tools and got pretty far. I was unable to use a key emulator that I needed and was wondering if I could completely remove android support for my project.
Any advice pertaining to LittleKT or how to install the needed emulator I need would be greatly appreciated. I did not include many details as to doing that because that is not the point of this question. Plus, there are plenty of discussions pertaining to that issue.
Thanks

Is it possible to run the same source code in eclipse and android studio?

I am new to android development, So I am not sure if this question is very silly
I was wondering if the same source code can run in both eclipse and android studio
If this is possible how to do it, and what points should be considered?
If not what are the road blocks to accomplish this.
Simple answer: Yes, you can "write" (not run) in both IDE's.
Aside: You really don't even need an IDE. If using Gradle, you can write code using any text-editor, then compile, build, test, and install all using Gradle.
If this is possible how to do it?
Well, Android Studio can import Eclipse projects. That is pretty well documented.
Eclipse (unofficially) has an Andmore project and also supports Gradle projects.
what are the road blocks to accomplish this
If using Eclipse, it's not supported by the Android team anymore, and you'll likely be missing out on features that are actively added to Android Studio.

OpenCV face detector sample in Android Studio

I cannot make the sample (Facedetection) coming with the OpenCV4Android work in Android Studio.
Is there a tutorial for facedetection that would address the users of Android Studio?
Because it does not work to import the Eclipse project that is attached to the library as sample.
I am sure it's because of the NDK dependency, but I cannot seem to get it to work. I installed the NDK, added it to the Path, still no change.
Better yet, is there any way of avoiding the use of the NDK in a facedetection application?
I would appreciate any help in making this work in the Android Studio
I've just uploaded to github a simple sample using OPENCV libraries. Everything is setup already to get it to run really quick. My AndroidStudio is 2.0 Preview 2 (released 5 days ago). Hope isn't too late or at least others may find it useful for quick troubleshooting during installation.
Best.

Can I use Visual Studio as an IDE for cocos2d-x 3.0rc2, c++ development?

So I plan on building for Android with cocos2d-x 3.0rc2 and there isn't a whole lot of updated documentation on what all I'm supposed to do to get up and running. I have the whole environment set up already. I can run tests and make some basic sprites just by editing the C++ files in Notepad++, however I need to get to a point where I am actually set up in an IDE. There are tutorials of importing projects into ADT, which I have gotten to run but I cannot edit the *.cpp files from inside eclipse. Is that how I'm supposed to set up my environment? Do people usually just edit in a basic text editor and run from command line or is there something I'm missing.
I also opened up the Visual Studio solution that comes with a new project and inside that I have auto completion and it's a nice environment, but there is still the hassle with makefiles that I just can't get working. I tried using some of the extended features and using CocoStudio exports in my projects and the compiler won't have any of that. Is there just a lack of documentation for people who are not comfortable developing for Android already?
When I make a new class, or use a new include, do I have to manually add that that to a makefile? If so, where is somewhere that I can learn how that process works and be able to apply it to new situations?
I feel lost because I'm not too used to getting into all the 'nitty-gritty' bits of development.
If someone wants to help me out understanding all this, I would be immensely appreciative.
Thanks,
Vynlar
Visual Studio 2012 is supported. Here is documentation on setting up Cocos2d-x v3.0 with Visual Studio: http://cocos2d-x.org/wiki/How_to_run_cpp-tests_on_Windows
This question is like two years old, but if anyone hits it in search results there is now a Visual Studio project to target Android devices with Cocos2d-x. It's not integrated with the cocos template system, so it currently needs to be updated per cocos version. Currently it's for VS 2015 Update 3 and Cocos 3.12.
https://blogs.msdn.microsoft.com/vcblog/2016/07/12/cocos2d-x-visual-studio-android-project/
I was the developer on this, so I can be contacted with any questions.

Scala, Android and Eclipse

I've started learning Scala, and I... I think I'm in love. I've only coded small test snippets so far, but since I currently working in Android development, what I really want to do is try my hand at writing Android applications in Scala.
I've found articles and questions on the matter, but mostly referring to older versions of the three tools (Android SDK/Scala/Eclipse), so the general question is:
Is anybody coding Android apps in Scala right now, with the latest SDK, Scala 2.9 and Eclipse Indigo? How viable is it?
And, in particular:
How's the interaction/integration between Scala's features and the Android library?
What's the state of the Scala plugin for Eclipse? I've read all the features you'd expect are there, but I'd like to know first-hand stories, specially about the debugger.
How well does the build process (scala to java to dalvik, ant, proguard, etc.) automate?
Thanks!
We are using Scala heavily to test our Android code - you can read a writeup of how we're doing so here. We use Ant or SBT to compile - there's an excellent SBT plugin for Android development.
Having said all of that, I'm not sure that I would recommend Scala for production Android development. In particular Scala 2.9.x is basically unusable as there is no good way to get the libraries to work on Android. You can read about the issue here.
It's a real pity, as Android development would benefit considerably from Scala if we could get it working properly.
Solution found here to use the latest Android SDK, with Eclipse 3.7.2 and Scala 2.9 :
https://stackoverflow.com/a/11084146/1287856
It completely handles the android library
You can make Android Library out of scala projects as usual
The build process is completely automated, including proguard-ing and exporting the project with the regulard Android tools.
I started to implement the android application (a twitter client) from the book "Learning Android" with Scala 2.9.0-1 a while ago.
In my opinion you can use it. I had only one problem with the parameter list at AsyncTask (see this link, problem #3).
If you want to checkout out the project, you can find it here.
This video from ScalaDays 2011 may be hepful:
Scala on Android: Real-world Experience at Bump Technologies by Michael Galpin
EDIT:
If you really really want to run Scala code on Android (and not really make an app, but for yourself), then I have an easier solution. It depends on if your phone supports the procedure. In summary the steps are:
Install Ubuntu on your device (as described here). This will not affect the Android installation.
Boot Ubuntu, install JDK, Scala, etc, copy your Scala jars and run from there.

Categories

Resources