Win a copy of Learning OpenStack Networking: Build a solid foundation in virtual networking technologies for OpenStack-based clouds this week in the Cloud/Virtualization forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Liutauras Vilda
  • Campbell Ritchie
  • Tim Cooke
  • Bear Bibeault
  • Devaka Cooray
Sheriffs:
  • Jeanne Boyarsky
  • Knute Snortum
  • Junilu Lacar
Saloon Keepers:
  • Tim Moores
  • Ganesh Patekar
  • Stephan van Hulst
  • Pete Letkeman
  • Carey Brown
Bartenders:
  • Tim Holloway
  • Ron McLeod
  • Vijitha Kumara

android.app.Application  RSS feed

 
Ranch Hand
Posts: 75
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi all, I'm beginner here.

the open source code from package android.app.Application for method onCreate() is as below

/**
* Called when the application is starting, before any other application
* objects have been created. Implementations should be as quick as
* possible (for example using lazy initialization of state) since the time
* spent in this function directly impacts the performance of starting the
* first activity, service, or receiver in a process.
* If you override this method, be sure to call super.onCreate().
*/

public void onCreate() {
}


My question is
1) why nothing implement inside the body of onCreate() method for package android.app.Application?

2) if i create a class extends Application, i'm wondering why compiler will automatically run the onCreate() method from android.app.Application ->

public void onCreate()
{
// nothing inside here
}


since the body is empty... why the onCreate() method will run automatically?

3) why need to call the super.onCreate() since the body is empty?

please help
Thanks
 
author
Bartender
Posts: 5856
7
Android Eclipse IDE Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Which sources are you looking at? The ones for the SDK just mimic the API and don't do anything (they are all empty or have default return values). The actual code that runs in the emulator or on the device has the real code.
 
Jeansonne Pierre
Ranch Hand
Posts: 75
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
opps... means that it is not a real source code? i get it from
Application.Java

can you show me the real code?
thanks...
 
Ranch Hand
Posts: 57
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Why do you want it to do anything?

After all its your class that will do all the coding.

Systems are designed in such a way that they refer to calls to classes like these.So when you extend a class like this(something similar to the servlets Api) and call super it is then your class is identified by the system. I guess so!!!
 
Peter Johnson
author
Bartender
Posts: 5856
7
Android Eclipse IDE Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
This might have the source:
http://source.android.com/source/index.html
 
Jeansonne Pierre
Ranch Hand
Posts: 75
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
conclusion is
http://www.google.com/codesearch/p?hl=en#uX1GffpyOZk/core/java/android/app/Application.java
is not a real source code??

Thanks everybody
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!