android - Same project cannot run well - android

I'm developing a simple application which uses Google maps API V2, it all works fine without problems where the map displayed yesterday. Today I uses the exactly the same project, the map cannot be displayed, only the plus and minus symbol.Other parts are all fine.
Besides, it's now getting some error on xml files when i try to change any code on it, such as "Incorrect line ending: found carriage return (\r) without corresponding newline (\n)" . It's totally work fine before this.
I'm still a beginner for all these.Maybe anything wrong with my Eclipse?

It does sound like more of an eclipse/line encoding problem then an android problem.
Try opening the file's properties and then under "Resources".
You should see on the right hand side a "Text file encoding" section.
Check that these settings make sense for your platform and project.
More generally speaking, you might also wish to check your eclipse preferences.
Goto: General -> Workspace
There should be a "Text file encoding" and "New Text file line delimiter" sections.
You will want to make sure these are appropriate so this problem doesn't come back
EDIT: After changing these settings you will want to rebuild the problem (aka. Project -> Clean) to make sure it all applied

Related

Customised settings no longer marking errors and problems

Until yesterday I had no problem with android studio and it's worked fine but today I have some problems with it .
For example, in my code I write " Strng s; ", as you can see I have wrong spelled the String, and android studio not tell me that this line is wrong.
or by default when you write code and use some libraries like Log or Dialog, android studio automatically import the necessary lib files but mine, it doesn't include them and also it does not mark it and tells me that I need to include the library.
so It make the coding very hard and full of problems .
How can I solve these problems?
Go File -> Settings
If you go into Code Completion, Auto Import and PostFix Completion along with setting your Code Style settings you have a lot of flexibility in what you choose the ide to show you.
In terms of you losing your settings, a file may have been deleted or over written, it's hard to say, it's something you learn to keep track of with your ides. Make a note of which folder your settings are saved to.

Firefox for Android: can't modify anything on about:config

TLDR: firefox for android does not show expected about:config screen.
Firefox: 39.0
Phone: Nexus 5
I am trying to install and configure an extension on firefox for Android.
I've been following these instructions, which work fine until I have to alter the filepath in about:config.
At this stage, I need to modify the settings to show firefox where a certain .txt file is. I can easily find the setting I wish to modify, but cannot find a way modify it.
The expected menu (with Modify) never shows up, and instead the only options I can get are "copy name" and "copy value".
Images of the expected interface, and actual interface:
Expected interface (from walk-through):
Actual interface (screenshot):
After searching, trying to find the modify option:
Eventually, with a lot of trial and error, got it fixed. The about:config interface has changed since the guide I was following was pasted, but it ended up being a very good step by step anyway.
Solution:
The new interface has an area where there is nothing written, which you need to over-write with the desired path (in my case it ended up being /storage/sdcard0/silent_block_directory).
Two pieces of advice to avoid making the same mistakes as I did:
1. Don't point the path at the .txt file, but rather at the parent directory
2. Don't look for the modify button, it does not exist any more.

Android Studio detects no changes with copied files so can't PUSH to Git

A very common thing that I tend to do is when I need to update a graphic or something in the drawable-nodpi folder, or any other folder for that matter, Android Studio doesn't detect the change so of course when I try to "PUSH" to GitHub it doesn't actually push and just tosses me the "No Changes Detected" message.
Is there a way to push anyways? Just to force a commit on specific files that I want to push because I know for a FACT there was a change and I need it submitted?
Lately I been having to delete it first from within Android Studio, then save the file, then add it to GIT then try a commit, but even this works only 70% of the time and is very annoying.
Perfect Example.... I have a splashimage.png in the drawable folder, I am in Photoshop and I change something then do an override to the splashimage.png with my change, but of course Android Studio doesn't see this as a change so I can't Commit this file to Git or anything.
Are you using external editors like photoshop when editing files? If so, press refresh in Android Studio to make it detect changes in file system. Then it says something has changed and suggest you to commit. Of course you can use command line to add changes anyway and commit without even using Android Studio.
Apparently the item I was looking for was the Synchronize. I just go to the file and Right Click > Synchronize and it then does a check against the last one manually and see's if it was different. Kind of a Refresh like Kuitsi had stated, but its called Synchronize. Also some reason I can't get it to work by just clicking Synchronize next to the SAVE icon at the top under File menu. Not sure why.
Whats your git status after you copy the file? Do you commit the changes, before pushing?
Have the same problem. Resolved.
The multi-root project used to work just fine for years, detecting changes in sub gits, properly pushing/pulling per sub, but not anymore. After some playing with a broken merge, it has stopped working. And that's not a local git repo issue. Cloned it from scratch - same issue. Changes (doesn't matter internal or external) are not detected by the Studio VCS facility, though git from console shows changes, View/Recent Changes shows them, Local Changes tab doesn't show any (single Default changelist).
It looks like something has happened with the VCS roots detection or related settings. Fixed with Preferences/version Control adding missing roots manually. I wish there is an option to rescan a folder or to delete some settings file and have the studio detecting these roots again.

Android studio does not create files

I added a new fragment to my project in Android studio like the way I did it a couple of times before, but now it says that this file das not exist (and is read only). I cannot edit a thing in it but also do not know how to correctly close it, so I can't use the name, which I really want...
I cannot find the file anywhere within my project and it is also not listed in the project+path (Name/App/src/main/...) but in the entire windows location (E:/...).
And how can I create a permanent file, or better, why does it not work any more?
This must be a fault on your side. Are you sure you are in the right folder? This is the only explanation I could think of. So you creat the files but outside of your project's folder, so you cannnot edit them or anything else, but read them...
Bene
Make sure that you have no LINT ERRORS.
For checking it:
Go to the bottom right side of Android Studio. Tap on "Gradle Console" tab.
If you have some errors(red text) - remove them and try again.

Android SDK sample app question:

If you go into the standard Note pad accessory application, the first available note menu entry is going to be...
<untitled>
My question is this: Where is "<untitled>" coming from in the code? The code is in the NotePad sample in the SDK if you want to built a project from existing source real fast. I just can't find where "<untitled>" is spelled out anywhere in the source or resources.
(Else, is this instead some kind of ultra low level string that Android's API hands to the GUI if there's nothing specified for a title? Which can't be changed?)
In the NotePadProvider.java appears that this string cames from android.R.string. To find that file you need to go here: SDKpath/platforms/version_you_are_programming/data/res/values. There is the string.xml file and that file is internal to the OS, I doubt you can change it.

Categories

Resources