Is it possible through android Manifest file to put some sort of condition which invokes different activity as main activity of the app based on underlying android platform ?
In my case I want a different main activity for API-8 to 11 and from 11 onwards I want a different activity as main activity.
So I am using following code right now in the android manifest file
<activity
android:name="myapp.org.MainActivity"
android:screenOrientation="portrait" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
Please advise, I have an app whose 5-10 % users are still on platform 2.2 and 2.3 and it is too much of a pain to keep supporting old platforms.
Please advise,
thanks, Ahmed
Explanation Why I want to do it:
The application foot print is small only 0.6 MB only, My plan was to copy entire code and enhance it for newer versions which will probably double the foot print. then based on platform launch appropriate mainactivity and if platform is newer mainactivity from newer part of code will execute and legacy code will never get a chance to execute (I believe) and vice versa,
The only flaw I could think of is if the android system somehow instantiates classes directly which probably only happens if I declare a broadcast receiver in the manifest, which I don't .. so I was hoping it is safe to publish single binary to all users and at runtime suitable code will execute. The legacy code will be thrown away from the main binary as the number of users drop further.
All the code is in project which is android library and the main app is a stub which uses the library and if I realise the scenario I have painted above, I will have two android libraries, one legacy one and new.