Desciprtion Function In Android - android

I learning android programming and in my first step I want to know what each function do
I discovered that all description about the function is found in activity.class.
IS my information right?
if it right I have a problem in activity.class in eclipse
and the error msg is the source attachment doesn't contain the source for the file Activity.class
what can i do ?

Here is all the information, that you need to know about activity http://developer.android.com/reference/android/app/Activity.html

Related

Confused on MainActivity.java again

So I'm still fairly new to Android Studio and programming in general and I'm trying to follow this course by Udacity. The problem is that in MainActivity.java all it says in mine is
#Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
// ...
}
while they have more Override Methods such as OnOptionsItemSelected, etc. I believe I was told by them to set it to "Blank Activity", which I believe is "Empty Activity" now, and I think the problem is the updates that have been made since there video had been made and now, but I'm just looking for a solution for this. Any help would be appreciated. I hope I am making sense here Thanks.
What you're looking for is "Basic Activity" instead of "Empty Activity" and you should be able to continue following the tutorial.
If they have the xml files and java files available, once you copy and paste it should look the same as well.
Sounds like you didn't really know about Android's coding framework, and need to read some example or tutorial.
I'm not have any relation about the following site, but as my point of view, it's a good Android coding tutorial.
Android - Hello World Example
OnOptionItemSelected is a callback method which handles menus.
You only need the onCreate callback method in order to display a sample Hello world! and then follow the Udacity course.
You can erase the others if you have created a blank activity instead of an empty one.

Template Proposals in Android Studio

In Eclipse, I can put my cursor on a method name and hit ctrl-space and I get a list of available template proposals.
In Android Studio, when I'm typing a method name and open paren, I get a list of template proposals, but afterwards, how do I see the list again? I've already got show quick doc on mouse move, but that only shows the method signature I selected at first. I want to see alternatives to what I selected the first time through.
How do I show alternative method signatures, aka alternative template proposals?
EDIT:
Thanks to AndroidMechanic for answering Ctrl-P.
Here is what it looks like in Android Studio:
Here is what it looks like in Eclipse: . Notice that you're presented with the documentation in Eclipse, which I find helpful. But Ctrl-P gets me most of the way there.
In android studio to see all method overloads click inside the parenthesis and hit Ctrl + P. This will show you the different combinations you could pass as parameters to a method.

Hello world android - creation with errors

I'm trying to create my first app with Android but I've encountered some problems.
Following a tutorial and making:
new android application -> blank activity
The default result should be:
With MainActivity.java and R.Java inside it.
But instead I've got this:
There are a lot of errors and the R.Java file is missing.
I can obtain a result similar to the tutorial one (with no errors), creating a new android application and unchecking create activity, but this time MainActivity.java under src is totally missing.
Maybe I could copy the MainActivity.java of the first project and put into the second one, but I prefer understand why it doesn't work.
Thanks for the help.
Best regards.
its import library problem
Right click on you application----->Android
under library view ,
check if you have this red error then remove the library and add it again

Where can I find the source code of Android class SQLiteOpenHelper?

I want to take a look at the Android SQLiteOpenHelper class implementation, can somebody points me the location?
The link you want is:
https://android.googlesource.com/platform/frameworks/base/+/refs/heads/master/core/java/android/database/sqlite/SQLiteOpenHelper.java
But even better let me share a great tip:
This extension for Google Chrome
https://chrome.google.com/webstore/detail/android-sdk-search/hgcbffeicehlpmgmnhnkjbjoldkfhoin?hl=en-GB adds the ad (as in Android Developer) keyword to your searchbar so you can type ad TextView and it will bring you directly to TextView on this example AND will add a link "View Source" next to the class name inside the site https://developer.android.com/reference so for any class you want to see the source it's just a click away.
You can find all the existing versions here: http://grepcode.com/search?query=SQLiteOpenHelper&n=

Android DDMS exceptions?

As i'm new to android, i really couldn't understand the errors or execptions shown in the android DDMS,I'm using Eclipse ..
Can anyone please share some very frequent exceptions that appear in DDMS and how to handle them......
We should explain exceptions here for you? Maybe you should try to read the name of the exception... most of them are named understandable. And the very first thing you should do to learn about exceptions is to read their documentation: the very famous one for example: http://developer.android.com/reference/java/lang/NullPointerException.html
If that didnt help, try to search with google or here on StackOverflow...
If you opened any xml files, this error shoud occur. Close all xml files of your application.
I'm not certain but I'm also having the same problem. I believe it occurs when you try to call something that is out of context. For example if you tried to call
TextView myTextView= (TextView)findViewById(R.id.myTextView);
when you had set a contentView as something that did not contain 'myTextView'
Hope this helps!
I think this type of error occurred when you have edited the .xml file and rebuild the project.
If you have opened any xml files, save all the .xml files and Close all xml files of your application.
and run the project. this way i run my application when this type of error occurred.

Categories

Resources