I'm fairly new to Android programming but have experience with other areas. I used to use a program called AutoIT for programming scripts used in Windows. When building the project there was an option that would clean up my code.
Giving each line proper indents, removing blank lines and I even think here as an option that would remove unused variables as well. I believe this was a plug in or add-on script that did this during build. Does Android Studio have something similar?
I want to answer just this image, but I can't. There has to be at least 30 characters.
Related
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.
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.
I have an android library in the form of an eclipse project that I want to integrate with unity3d. I know I can make a jar from eclipse and drop it in unity's plugins/android folder. However as I understand it that necessarily strips out the resources from the project.
If I export the unity game to an eclipse project, I can right-click and add the android project as a library. However I don't like this approach because it doesn't fit with our current automation process - which basically just script's unity's build dialog.
I'd like a way to tell unity that I want this eclipse project linked as an android library on export. Does anyone know a way to do that, or how to pack the resources into the jar or another way of getting this stuff to talk?
One possible way to go is using Unity's Build Player Pipeline. Depending on the platform you are working on you then have to set up a shell script or do your stuff in C#.
It's some year ago that I were a Java/Eclipse expert as I am working on iOS now. The Android Developers page shows some way to manipulate projects via command line.
Maybe the better way to go is using Eclipse switches like --import (s. 1st answer in Create an Eclipse project on the command line? and the link provided) but on the other hand I can't find the switch in the help pages.
Well, not really a bounty answer but maybe some inspiration :-)
The only real answer I've found is that in 4.2, you can drop an eclipse project in plugins/android and it will be linked correctly. Just have to hang on I suppose. :-/
I've used Eclipse and vim variously as development environments for Android applications and found both the Eclipse plugin and the command-line SDK tools to be of similar capability.
Since I haven't explored either in its entirety, however, I'd like to ask:
What advantages are there to using Eclipse over the command-line tools and vice-versa?
I could see:
(Eclipse) nice GUI for debugging
(ant/adb/android) more amenable to automation
(hybrid) you can have it all, can't you!?
I'm especially interested in specific features that may be a deal-breaker for one and move a developer in the direction of the other.
Using Eclipse as a development environment for Android doesn't preclude you from also building with Ant to hook into nightly builds or CI tools. You could even configure Eclipse to build using your Ant buildfile if you wanted. If you want some kind of CLI build tool, you might also consider Maven, as it also has plugins to enable building Android apps.
It has been some time (like six months) since I have used eclipse, so maybe it is better now, but I gave up on it because I found it to be very slow and buggy. Maybe it is the integration with ADT, but several times I spent hours hunting down problems that turned out to be fixed if I killed and restarted eclipse (and these problems were not fixed if I did a "clean" within eclipse). After doing that a few times, I felt like throwing the computer against the wall.
"ant clean" is much easier and faster than stopping and restarting eclipse.
Across my personal projects and multiple professional instances of building Android apps, I've always used both types of builds. You'll want to use Ant (or Maven, if you prefer) to set up continuous integration and automated testing. Trying to get that working with Eclipse (which I did a long time ago when the Android SDKs were first coming out) is a nightmare, while Ant/Maven is easily used from any of your favorite CI tools (I've usually used Hudson for this). If there's nothing unusual about your project, it'll be a snap to put together continuous integration, and off you go.
Meanwhile, for just day to day development work, using Eclipse to build your app locally works just fine. But that can easily be left up to the individual developer. I'd make the build that your CI system is running the canonical build, but I do use Eclipse for my normal development.
I'd use Eclipse until such time as you are happy with the debug build. Then you can set up Ant to produce the signed release build.
You can set it up to use the same source files as Eclipse but put the output binaries outside your workspace. You can also set it to use your release.keystore, sign it automatically and obfuscate the code all in one go.
I've set it up to do this. I open a command line (DOS box) move to the projects home directory (\dev\projects\Eclipse\Project1 say), I type "Ant release" and the apk ends up in \dev\projects\AntBuilds\Project1\bin as Project1-release.apk.
If you want the best of both worlds, you might want to look at the m2eclipse-android-integration Eclipse plug-in which allows you to use your command-line Maven build in the ADT/Eclipse environment as well:
https://code.google.com/a/eclipselabs.org/p/m2eclipse-android-integration/
Well for me im just a beginner, but I find eclipse much easier to work with. Android is a pretty complicated to get used to (for me) so having everything layed out in a GUI is preferable to command line. Plus SDK updates and such are easier to get.
Can anyone describe a good Vim setup for Android Development? I'm using Eclipse for now but I would really like to use Vim because it's faster and I like it better. I'm not interested in Eclim for example.
I'm interested in what Vim plugins are used (for Java, autocomplete etc.), how the .vimrc looks like and how the whole process of building/running applications works (as efficiently as possible).
I've once had to do some Android development on a netbook, and set up a nice Vim setup for this purpose. Seriously, it's easier than it seems:
Run emulator from the command line. It's better to do it anyway. I started mine with something like this:
emulator -avd BlaDevice -no-boot-anim -scale 0.65 -show-kernel
To build and reinstall your modified app to the emulator, simply run ant reinstall from the project root. Map this command in Vim to your key combination of choice.
I've used typical Vim setup: NERDTree, FuzzyFinder, and omnicomplete. Java syntax highlighting works out of the box.
Never bothered to install Eclim, omnicomplete works just fine in most cases.
I have been working on a vim plugin for android development: https://github.com/hsanson/vim-android. Still work in progress but it has most functionality needed for android development using vim.
I still have some issues to solve but most are not related to the plugin:
Gradle errors from aapt report the wrong file. This makes jumping to the error
from the quickfix window a pain as it opens the wrong file.
I cannot make javacomplete work correctly. When auto completing a class I wrote
it gets stuck in "Searching..." and when auto completing a library or external JAR
method javacomplete spits hundreds of errors making it impossible to use.
I've only done a little bit of Android development with VIM, but I'd very much suggest getting your head around Ant (which the SDK uses to build projects from the command line), and perhaps Maven if you're daring. You'll be using Ant a lot!
There are a few tab/auto-complete VIM scripts around, but don't expect them to be anywhere near as quick or useful as Eclipse. I've found myself doing a lot more typing than I'm used to from Eclipse...
Both of what #Dave and #buru suggested led me to work on a plugin for Vim that'd help you work on development in Vim for Android applications. Feature parity to top-level tools like the visual development isn't there yet, but I was wondering if we could generate some components by using Fries and extending it.
The plugin is called android.vim and it was on Github # jalcine.github.io/android.vim. I'm very open to ideas and pull-requests so feel free!
Edit: I've taken down this plugin because I haven't the time or focus to work on it :(
I have just create a vim script for android development, it is called adt.vim, and I am using it, hope you will like it.
http://www.vim.org/scripts/script.php?script_id=4330
If any suggestion, please tell me, it is still under improve