I'm new to Android development. I crated a project with two packages, each having their own launcher activities i.e, its kind of each package can be a separate application. Now is it possible to create a apk file for each package separately?
-
1a project can have only one apk..and there should be only one launcher activity in the whole project.. – Wasim Ahmed Jun 13 '14 at 10:16
-
Just out of curiosity. What is the scenario behind needing two apks? – amalBit Jun 13 '14 at 10:19
-
For testing purpose.. – RAVITEJA SATYAVADA Jun 13 '14 at 10:20
3 Answers
Now is it possible to create a apk file for each package separately?
Sorry but what you asking is not possible. Every project has always built only one apk.
but you can archive this by creating two different project with different Package Name
.

- 47,665
- 9
- 93
- 114
-
Yeah, this is possible.But i'm asking if there is any possibility like mentioned in my question. – RAVITEJA SATYAVADA Jun 13 '14 at 10:19
-
You can create a library project, that contains the main logic of your app.
And then you create two seperate projects that contain the application specific logic, launcher activities, icons, etc.
The application package's rely on the library for shared logic, and you compile them to their own apk.

- 52,015
- 16
- 101
- 139
When using the new build system you can create a separate apk for each buildType and flavor with different package identifiers.
This is kind of a steep learning curve for a beginner, but definitely worth it as it reduces the overall overhead for your purpose. Also it's the future.

- 17,182
- 6
- 67
- 87