Android sample application - android

I just started working with Android apps and was trying few sample programs. I noticed an issue with the main.xml file. It happened twice today, I added few new layout views in main.xml (Using Layout and XML both), as soon as I made a modification and tried running the program, the R.java class would throw an error, also a new file called main.out.xml is getting created automatically. On top of this, when I am trying to "clean" the project, it deletes the R.java file altogether. Why is it acting this way?

This is a bug in the eclipse IDE relating to android development. I had the same problem when I first started. You need to make sure that the file that is currently being edited (i.e. active in the editor) is a java source file when you try to run the project. If any other file is active, such as your main.xml file then it ends up creating this main.out.xml that is a garbage file. To fix, just delete the garbage main.out.xml and make sure a java file is active and hit run and you are back to normal.

Try deleting that tmp file and re-cleaning the project

Related

Error on Add file to deploy in Android, with firemonkey delphi Xe7

Which file I manage the deploy Itemns to remove/add manually my database? When I click add file on tool bar (Second button), and select the sqlite file on explorer, I receive an exception below.
It was working very well, and I changed many times the database version before.
But now, I delete the sqlite file and can't submit the file again.
I hope to delete some file on explorer to reset the deploy list. Somebody can help-me?
ps: I restarted delphi and also the windows.
I found the file ProjectName.deployproj. The file has a xml structure with all icons, database and ini specification. I change the file manually but didn't fence the error. I got that the error just occur when I add a filename found in xml. But when I click delete on deploy windows, It don't removes the file. Like has another reference I can not change manually. Some idea? Thanks in advance.

Opening project in Eclipse

I've googled for the answer and read many forums and stackoverflow threads but I still can't get it to work.
I just started trying to develop my first Android app, and after following the instructions listed on the website, when I started the project, it opened with two tabs, one showing a java file, and the other showing an xml file. The tab with the xml file also had this simulation of an android phone on it where I could play around with the GUI.
When I stopped working on it, I closed all the tabs and closed eclipse, but now I want to work on it again and I don't know how to get it back to the setup showing the java and the xml file with the little simulation. I don't even know where the activity_main.xml is located.
I don't want to create a brand new project.
I tried importing a project, but the finish button is always grayed out or it wont let me import because it says that a project already exists in the workspace, or after I click on the folder containing all the bin, res, src, etc. files, and I click OK to import it, nothing happens.
Is it possible to just click on a single file, like the .sln file in visual studio, that will automatically launch eclipse with your project ready to go?
The activity_main.xml is located in your_project/res/layout.
Just open Eclipse and navigate to this directory in Package Explorer window:
When you double click the activity_main.xml you should see the XML and Graphical Layout tabs at the bottom.
Here is a description of android project structure:
http://developer.android.com/tools/projects/index.html#ApplicationModules
Make sure you uncheck the copy attribute when you import the project, this solve the project is already exit problem, and you can try both Existing Project Into Workspace and Existing Android Code Into Workspace.
The layout file lay in project_name/res/layout.
Source file lay in project_name/src.
You can double click to open your files, and your files remain open the next time you open eclipse, only if you don't close them when you exit the eclipse.
There are a few ways to reopen your project again:
Try to open the project explorer:
-> Window -> View -> Project Explorer -> Hit refresh
Open your .project file (in your workspace) an edit the name in the xml name tag and try do import again.
Please make a backup before.

Android Workspace corrupted and lost all projects data

I was working on android using eclipse, Last day without any reason All projects closed. When i try to open them, an error occurred, i.e ".Project file is missing".
I change the work space and copy all files to new workspace and then try to import but not work.
when i see the files inside my projects folders, all files are of size 0 kb. mean all data from all files got deleted.
Is there any way to restore that project files??? I was working on My Final Year project from the last 2 months and again goes to same start state. Please help me if there is any way to recover. Thanks

Have issue while saving activity_main.xml

I have created the android application project but if i try to save the "activity_main.xml" it is saying that.
Message
The original file 'activity_main.xml' has been deleted or is not accessible.
If I click ok it is trying to replace the xml. But it did not happen before. I am using eclipse.
If I create any other activity and try to save that xml then it is working fine. This error is happening only for launcher activity with the project name FCI.
It works fine if I change the project name.
This issue occurs to me every time I delete a project from a workspace, and then import one with the same name from another location. (Using eclipse Kepler sr 2)
I guess eclipse caches the workspace session metadata, but doesn't update it on such overwrites.
Restarting the workbench solves this problem every time.
Please try to restart your eclipse... I hope it would work for you

Android Setting Background

I'm trying to change the background of my first app to a png I have. I put the png in a newly created folder called "drawable." When I go to browse my "drawable" I can't see it's "children" or files. The only error of sorts that it gives me is "You must... rce item" anyone run into this? Android API 7 by the way.
Put the png in /res/drawable and then do a clean on your project in eclipse to force the .R class for your app to be recreated. You might also need to do an f5/refresh in eclipse on the project to get it to see that you have added a file in filesystem to /res/drawable.

Categories

Resources