How do I get the Android R.file to update automatically quicker? - android

Sometimes the R.file updates immediately for me, other times it takes a long time to update when I add #+id in my xml files, is there a way to speed this automatic process up especially for times when it takes 15-20min

We need more details.
I'm assuming you are referring to your IDE not refreshing quickly enough.
What IDE are you using? If you are using eclipse for instance, you can select Project->Clean and do a clean build of your project. That will generate the R file again.

Related

Clean build before running Android application

During my development under Android I saw that if I don't clean before building and running the application, it will keep some old files giving me no-sense errors since they were fixed one or two runs before.
Have you ever experienced this problem? Any idea of how to prevent it / how to clean always before running the application on Eclipse?
This is not happen always. Most of the time if you not clear the project before build won't harm the application. I clear it form time to time, mostly when I change something in xml files, but for regular app checking I don't think you have to do it and I doubt that there is any method to clear before each build.

How to avoid the "User Operation is Waiting" dialog come out in Eclipse/ADT

As shown in the image, when I'm developing Android applications with auto build, sometimes this dialog will show. Is there any way to avoid this and make it just go through the process in the background?
It does not always show, but when it does, I need to wait for it for 5-10 seconds. That's annoying, especially considering that when the project gets bigger, it will go much slower.
UPDATED:
I did some researching:
Android compilation is slow (using Eclipse)
Android: eclipse workspace takes a long time to build?
http://groups.google.com/group/android-developers/browse_thread/thread/a16202975510de39
http://oae9.wordpress.com/2011/03/22/android-workaround-for-slow-building-workspace-problem-in-eclipse/
http://www.androidengineer.com/2010/06/using-ant-to-automate-building-android.html
Is it there any easier solution that is not using ANT?
Or any other best ANT script that can be applied easily?
How about you just uncheck the "Build Automatically" option. This doesn't speed the build process, but doesn't do it everytime you save a file.
You will still need to do a build that takes a bit of time - but you will only do it when you really want to compile your project (not everytime you make a change to the code).

Android application problems in Eclipse

I'm a .NET developer but I like JAVA so in my free time I play around with that. I don't normally use Eclipse but I installed the ADT eclipse plugin and Andriod SDK and I started learning and I made a new project with a TableLayout and it kinda looks good, and it runs ok on the emulator.
However... there a few things that drive me absolutely catatonic and perhaps I am doing something wrong so please help me out.
Firstly, if I change the main.xml file in whatever way, even by adding what is supposedly a correct parameter, it will start freaking out and will generate an error that just says "error" without specifying what that is, it will then generate a main.out.xml and then report an error that the main.out.xml is empty. It later won't let me delete that and will start generating a main.out.out.xml and so forth, even after I correct that original xml that caused the error.
The only way to get things going is to delete the bin folder, restart Eclipse, delete all the out xml files and then sometimes it will run the application or some other times it will start generating those 'out' files again and the loop goes on.
That way it takes hours to run a simple app even one without errors that used to run before.
Surely that was NOT how they intended it to work, is it??
Also.. there is no "Rebuild" button that will flush all files out automatically, or is it hidden somewhere? I am tired of manually deleting those automatically generated files and the build folder and all those out.xml files.
Also, while I'm at it, I also want to point out that the designer view sometimes disappears and there is nothing on earth that will bring it back, the only way is to create a new project and copy the main.xml to it and then it shows up again. Another bug?
I have the latest eclipse version:
Version: Indigo Service Release 2
Build id: 20120216-1857
If you have any clues how to get this to work, I will appreciate it!
Many thanks in advance
When you click the Run button with an XML file selected, Eclipse is running an XSL Transformation on that XML and producing the .out.xml file as the result. This is a feature of the Eclipse Web Tools feature, which you'll have if you installed the Eclipse for Java EE Developers package (it may be included in other packages, too).
As others have said above in the comments, to run your Android app, select the Project, right-click, and choose Run As > Android App. Once you've done that once, it will create a Launch Configuration that you can launch from the Run or Debug toolbar buttons (pressing the small down-arrow on the Run or Debug buttons brings up a list of Launch Configurations that you can select from, as well as an option to manage them).
There is a Preference that will make Eclipse always launch the last thing you ran or debugged, instead of trying to be smart about what is currently selected. Open the Preferences and navigate to Run/Debug > Launching; there you'll find the option under Launch Operation at the bottom of the window.

android project not getting built

I am a newbie to Android development, and am using Eclipse 3.7 Indigo on Ubuntu 11.10. I have the SDK and the ADT installed. I have two problems.
An Android project takes an awfully long time to get created.
When I restart Eclipse, all previously built Projects (even simple Hello World ones) have to be rebuilt, and this takes a really long time to build. While building the "details" dialog box shows
Loading data for Android 2.3.3
Android 2.3.3: Widgets and Layouts
then,
Building Workspace (where the progress bar seems to remain halted for eternity). At times it gets built after this. At other times, the first line in the HelloAndroid.java file shows an error, which when rebuilt yet again disappears.
So when I restart Eclipse, it takes approximately 10 minutes to get previously built projects running on the Emulator.
Any fixes to this?
Hard telling what the issue is without more information, but here are some thoughts:
Your machine may be underpowered. What OS, processor speed, RAM do you have?
If you have a very large amount of projects, or have some very large projects, then it can take a long time to build them when Eclipse starts. You can close a project (right-click the project in Package Explorer and click Close Project) so it will not be built and is not accessible until you open it later. Close projects you aren't actively working on, but may want to use again someday in the future.
The ADV (emulator) takes a long, long time to start up, yes. When you start it, make sure to select the option to start from snapshot and save to snapshot to save time starting it in the future.
And yes, you may want to reinstall everything again. Sometimes Eclipse just gets screwy.
It sounds like any of several items were improperly installed. Consequently, the directories of where your compiled libraries can't be found and must be regenerated each time. That is why it takes ten minutes or more: you're recompiling everything!
The time it will take for you to track everything down and repair the settings will be MUCH longer than the time to just do a fresh install.
Really.

Quick Build In Android with eclipse

I have a android project which is huge in size with more than 100 resource files, layouts and lot of codes. It takes about a minute and even more to completely build. Even when I change a single line or just give a space the whole project takes 1 minute to build. But I want it to consider only the changes and build quickly when there is very less change. Is there a way to do it. Any kind of help is appreciated. Thank you.
as long as I know partial builds are not possible. You can disable the "Build Automatically" (not 100% sure about the name, I don't have Eclipse open right now) option from Eclipse and start the build manually.
Could you comment out or just run the classes that have changed by themselves? I guess maybe this is one of the reasons they push encapsulation so much with object oriented programming.

Categories

Resources