0

I was asked where to write the order to run the android program. Is it Main Activity or Manifest? .
We start in main activity and run accordingly . Someone said it is manifest where we right the order of running of the program. what is the correct answer?.

user260203
  • 11
  • 7
  • 1
    it is the manifest file where you write the order of the program and in main activity you write the code what you have plans for .... – Umair Jun 20 '14 at 05:28
  • use `Activity Life Cycle` for better navigation through your Activities. here:http://developer.android.com/reference/android/app/Activity.html –  Jun 20 '14 at 05:29
  • So what is the order of manifest? we can write activities without an order right. After main activity i can write the signup activity or search activity . so what order is there.? – user260203 Jun 20 '14 at 05:31
  • 1
    yes, you can write in any order in your `Manifest` file, the main execution of your Activity depends upon your Code not over the order in `Manifest` file. `Manifest` file is used just to save all the entry of your App's Activities an Permissions, there is nothing `Manifest` file to do with your order of program. –  Jun 20 '14 at 05:32
  • @JaiSharma "there is nothing Manifest file to do with your order of program" you mean MainAcitivity? question is "Where to write the order to run the program in android?" – user260203 Jun 20 '14 at 06:05
  • @user260203 what you actually want to do? –  Jun 20 '14 at 06:56

2 Answers2

1

Android Manifest is a summary of your android application. It has the information like which is the least android version compatible, what are the permissions it is using,what are the java files used and is the rotation of device possible etc.

On the other hand, Main activity is a java file which has the code to run the application. Like what will happen when the activity is created ( oncreate), what will happen when the application is destroyed or removed from memory (onDestroy).

The application can't work alone with just the java and XML files.

Like(a little bit off topic): When you make/draw a map, you have to give a key to your symbols or the reader will be confused. Similarly you have to give the manifest along with the java files or Android will be confused and the application will crash. The order doesn't matter on the working of the program as it is handled by the java file.

dhaval.s
  • 156
  • 7
0

It starts from the manifest where you have a single activity as action main and category launcher. Something like this.

 <activity
        android:name="com.proshore.rwd.MainActivity"
        android:label="@string/app_name"
        android:screenOrientation="portrait" >
        <intent-filter>
            <action android:name="android.intent.action.MAIN" />

            <category android:name="android.intent.category.LAUNCHER" />
        </intent-filter>
    </activity>

After that it all depends on the java code that you write.

Illegal Argument
  • 10,090
  • 2
  • 44
  • 61