Eclipse .XML files not showing ANY text - java

The past couple of days I've been having problems with Eclipse, such as appcompact_v7 making a new compact after each problem. Then App_compact wouldn't transfer the .jar files over automatically. NOW I'm having another problem, which is everytime I start a new Android Application Project the textView that says "Hello World!" is "invisible". It says it's on the layout, but it's not visible. Next problem i'm having is that anytime I add a button, TextView, or anything that has text, it's not visible, no matter what color I use with the text. 1. What is causing eclipse to do this? 2. What can I do to resolve these problems?
We're working on a final project for the class and this determines whether or not i pass the class, so i'm FREAKING out. Here is what my project looks like and what its showing :

Please change the theme on top it AppTheme by default. Try using any Holo.Light themes and see if it makes any difference.

I had this problem on last week.
Solution: update your Android SDK and check updates in Eclipse. If it's not work try backup projects and reinstall Android SDK.
Recommend: check locations of files in Android SDK. Google replace SDK files to another location. If it's true, replace files back.
P.S. I have got very bad English. Write comment if it's work. :)

Related

Android SDK - updating xml doesn't update app

I am completely new to Andoid Studio, Java, and app development in general.
With that, in order to learn, I downloaded Android Studio version 2.3. And, for my first project, I imported the accelerometer example from the sensors library. I opened it, poked around, didn't change/save anything, and ran/installed the app on my phone (simply clicking the RUN button from the SDK), and it worked fine ... I see the metal balls rolling across my screen.
NEXT, I figured I would make a small change to the project and see what I have to do to rebuild/remake the app, since I see 'make project', 'make app', 'rebuild', 'build apk', and 'synchronize' ... still not sure what all those do exactly.
So, my simple change was in the app/res/layout/main.xml file, and all I changed was
from:
android:background="#drawable/wood"
to:
android:background="#drawable/ball"
After this change, I went through every possible make, build, clean sequence I could think of, including the synchronize options within the different files. I've even disabled the instant run feature, uninstalled the app from my phone, restarted my phone, and restarted Android SDK. I even found a checkbox to "skip installation if APK has not changed" in the RUN/DEBUG configuration window.
What am I missing? Every time I RUN APP, it's as if no changes were made ... I get the same "wood" background from the original main.xml file.
Here is a link to the repo: https://github.com/googlesamples/android-AccelerometerPlay/
I checked the code and if you take a look to the AccelerometerPlayActivity you can see that the background of the view that acts as the activity content (SimulationView) is being set on this piece of code (in the onCreate method):
// instantiate our simulation view and set it as the activity's content
mSimulationView = new SimulationView(this);
mSimulationView.setBackgroundResource(R.drawable.wood);
setContentView(mSimulationView);
So, that's where you have to make your changes.

Android SDK Compiling Issue?

I tried and searched a long time for a solution but I was unable to find it, so I hope you can help me here :)
Here's my problem:
I started creating an Andoid App using the adt-bundle-windows-x86_64-20131030 and had to upgrade to adt-bundle-windows-x86_64-20140321. I now did several changes to the app and I try to run it, but it always shows outdated data. I had some activites and added them to the Manifest and they worked, but then I did some changes including the deletion of these activities. I removed them from the Manifest, I deleted their layouts, deleted all of their classes and took care they are never launched in the other activities.
Now when I try to run the app in the Emulator I'm still seeing the old activities with their menu exactly the same as it was before. One was the old Launcher Activity and got removed, but the emulator still shows the old deleted one.
I already searched all files and did a fulltext search using Sublime covering all files but the snippets I searched for where I'm sure they existed before can't be found.
Do you have a clue why it's compiling old code parts and where this is coming from?
Even if I'm renaming the .apk file in the "bin" folder a new file is created that's exactly the same one.
I hope you can help me :)
Best regards Christian

Eclipse Android SDK: Can't access layouts after adding 2nd activity

I'm very new to Android and Java developing. So far, everything worked pretty well. But i keep failing adding a 2nd activity and accessing its layout elements.
I used the manifest.xml wizard and file->new->other->android activity. This works well, adds a new java file and layout. Starting the activity works also pretty well.
My problem is that i can't access any elements of the new layout. When i try to create a button via "findViewById(R.id.?)" it shows elements that don't exist on the layout, but the elements on my layout are not shown. It seems that a layout from a previous project is used.
Additionaly the eclipse editor shows a warnining in a line above:
setContentView(R.layout.activity_secondactivity);
"activity_secondactivity cannot be resolved or is not a field".
This warning is not there until i type "R.id." and even if i delete it, it won't disappear.
In all tutorials on the web and youtube it seems to work so fine, i was trying different things for two days and can't figure it out. I would be very happy if anyone could help me out :)
Make sure you imported the right "R" (yourpackage.R) and not android.R. For example, if your package name is com.my.package, then you have to import com.my.package.R. And try clean your project (Project->Clean).

API Demo - Text-to-Speech - How to Change the "Again" Button to Something Else

Java Newbie here. Interested in learning about programming for Android. I'm going through the samples and tutorials on developer.android.com. Using Eclipse and Android SDK for developing. I was checking out the APIDemos and noticed that when compiling the TextToSpeechActivity file, and run it in my phone/emulator, I am able to click on the "Again" button and have it read aloud the text in the TextToSpeechActivity file. What I'd like to know is this.... I cannot figure out where this button is coming from, how it is getting labeled with the word "Again" on it and how it knows to be placed in that exact spot on the phone/emulator screen. Is the button being "built" by Java or is it an actual file located someplace else? I've looked through the various folders in the APIDemos project, but have not been able to locate a graphic that looks like the one showing on the phone/emulator. One last thing, when rolling over the button on the phone/emulator, the button turns from grey to orange. Any help with how this button is created, and how it knows where to be placed on the page would be appreciated.
Without looking at it in detail, I think you should probably be looking for an XML file. My understanding is that layout/components are often declared in XML files in an android project.

Official tutorial codes appearing red wave line in Eclipse not allowing me to compile

I am a beginner in Android programming. I was going through the official tutorial on Android developer site. When I copied the codes for the Grid View tutorial to Eclipse, many red wave underlines appeared which are not allowing me to compile. Every time I click the run button, it says "Your project contains error(s), please fix them before running your application."
I am using a WIN7 and followed every single step that is necessary for setting up the envrionment. I had no problem at with previous tutorials such as Hello Android, Linear Layout, Relative Layout, and Table View.
Does anyone have the same experience and have a solution for this? I have tried to clean and re-build the project, which doesn't help.
It would probably be helpful to provide a link to the gridview tutorial you speak of. I'll assume you meant this one: http://developer.android.com/resources/tutorials/views/hello-gridview.html
First things first: Did you download the sample art? Did you put it in res/drawable?
What errors were you getting?
Are you certain you are working in an Android project and not a standard Java project?

Categories

Resources